@deskwork/studio 0.15.0 → 0.17.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 (75) hide show
  1. package/dist/components/scrapbook-item.d.ts +20 -0
  2. package/dist/components/scrapbook-item.d.ts.map +1 -1
  3. package/dist/components/scrapbook-item.js +21 -2
  4. package/dist/components/scrapbook-item.js.map +1 -1
  5. package/dist/lib/entry-resolver.d.ts +19 -6
  6. package/dist/lib/entry-resolver.d.ts.map +1 -1
  7. package/dist/lib/entry-resolver.js +40 -33
  8. package/dist/lib/entry-resolver.js.map +1 -1
  9. package/dist/pages/dashboard/affordances.d.ts.map +1 -1
  10. package/dist/pages/dashboard/affordances.js +13 -1
  11. package/dist/pages/dashboard/affordances.js.map +1 -1
  12. package/dist/pages/dashboard/affordances.ts +13 -1
  13. package/dist/pages/review-scrapbook-drawer.d.ts.map +1 -1
  14. package/dist/pages/review-scrapbook-drawer.js +10 -1
  15. package/dist/pages/review-scrapbook-drawer.js.map +1 -1
  16. package/dist/pages/review-scrapbook-drawer.ts +11 -1
  17. package/dist/pages/scrapbook/dispatch.d.ts +50 -0
  18. package/dist/pages/scrapbook/dispatch.d.ts.map +1 -0
  19. package/dist/pages/scrapbook/dispatch.js +104 -0
  20. package/dist/pages/scrapbook/dispatch.js.map +1 -0
  21. package/dist/pages/scrapbook/image-readers.d.ts +24 -0
  22. package/dist/pages/scrapbook/image-readers.d.ts.map +1 -0
  23. package/dist/pages/scrapbook/image-readers.js +135 -0
  24. package/dist/pages/scrapbook/image-readers.js.map +1 -0
  25. package/dist/pages/scrapbook/index.d.ts +21 -0
  26. package/dist/pages/scrapbook/index.d.ts.map +1 -0
  27. package/dist/pages/scrapbook/index.js +96 -0
  28. package/dist/pages/scrapbook/index.js.map +1 -0
  29. package/dist/pages/scrapbook/render.d.ts +68 -0
  30. package/dist/pages/scrapbook/render.d.ts.map +1 -0
  31. package/dist/pages/scrapbook/render.js +315 -0
  32. package/dist/pages/scrapbook/render.js.map +1 -0
  33. package/dist/pages/scrapbook/text-helpers.d.ts +40 -0
  34. package/dist/pages/scrapbook/text-helpers.d.ts.map +1 -0
  35. package/dist/pages/scrapbook/text-helpers.js +92 -0
  36. package/dist/pages/scrapbook/text-helpers.js.map +1 -0
  37. package/dist/pages/scrapbook/types.d.ts +26 -0
  38. package/dist/pages/scrapbook/types.d.ts.map +1 -0
  39. package/dist/pages/scrapbook/types.js +12 -0
  40. package/dist/pages/scrapbook/types.js.map +1 -0
  41. package/dist/pages/scrapbook.d.ts +8 -8
  42. package/dist/pages/scrapbook.d.ts.map +1 -1
  43. package/dist/pages/scrapbook.js +8 -600
  44. package/dist/pages/scrapbook.js.map +1 -1
  45. package/dist/pages/scrapbook.ts +11 -660
  46. package/dist/routes/api.d.ts.map +1 -1
  47. package/dist/routes/api.js +111 -2
  48. package/dist/routes/api.js.map +1 -1
  49. package/dist/routes/entry-annotation-body.d.ts +29 -0
  50. package/dist/routes/entry-annotation-body.d.ts.map +1 -1
  51. package/dist/routes/entry-annotation-body.js +80 -0
  52. package/dist/routes/entry-annotation-body.js.map +1 -1
  53. package/dist/routes/scrapbook-file.d.ts +1 -1
  54. package/dist/routes/scrapbook-file.js +1 -1
  55. package/dist/routes/scrapbook-mutation-dispatch.d.ts +29 -0
  56. package/dist/routes/scrapbook-mutation-dispatch.d.ts.map +1 -0
  57. package/dist/routes/scrapbook-mutation-dispatch.js +63 -0
  58. package/dist/routes/scrapbook-mutation-dispatch.js.map +1 -0
  59. package/dist/routes/scrapbook-mutation-envelope.d.ts +93 -0
  60. package/dist/routes/scrapbook-mutation-envelope.d.ts.map +1 -0
  61. package/dist/routes/scrapbook-mutation-envelope.js +147 -0
  62. package/dist/routes/scrapbook-mutation-envelope.js.map +1 -0
  63. package/dist/routes/scrapbook-mutations.d.ts +25 -7
  64. package/dist/routes/scrapbook-mutations.d.ts.map +1 -1
  65. package/dist/routes/scrapbook-mutations.js +67 -92
  66. package/dist/routes/scrapbook-mutations.js.map +1 -1
  67. package/dist/server.d.ts.map +1 -1
  68. package/dist/server.js +16 -2
  69. package/dist/server.js.map +1 -1
  70. package/package.json +2 -2
  71. package/dist/pages/review.d.ts +0 -68
  72. package/dist/pages/review.d.ts.map +0 -1
  73. package/dist/pages/review.js +0 -561
  74. package/dist/pages/review.js.map +0 -1
  75. package/dist/pages/review.ts +0 -710
@@ -52,6 +52,16 @@ export interface ScrapbookAddress {
52
52
  * viewer uses in its URL.
53
53
  */
54
54
  path: string;
55
+ /**
56
+ * Optional UUID of the calendar entry whose scrapbook this addresses.
57
+ * When present, the standalone-viewer URL appends `?entryId=<uuid>` so
58
+ * the server resolves the listing via `scrapbookDirForEntry` —
59
+ * symmetric to the mutation API's entry-aware addressing (#191/#205).
60
+ *
61
+ * Falls back to slug-template addressing when absent (legacy callers
62
+ * and ad-hoc / organizational paths that aren't tracked entries).
63
+ */
64
+ entryId?: string;
55
65
  }
56
66
  /**
57
67
  * Read the first slice of a text/JSON scrapbook file for inline
@@ -79,6 +89,11 @@ export interface ScrapbookItemRendererOptions {
79
89
  * read-only binary endpoint. The endpoint is read-only by design —
80
90
  * Phase 16's image / PDF previews need a stable URL, but full
81
91
  * scrapbook CRUD remains in the standalone viewer's surface.
92
+ *
93
+ * When `address.entryId` is present, sends `entryId=<uuid>` so the
94
+ * server resolves via the entry's sidecar (entry-aware addressing —
95
+ * #205, symmetric to the mutation API). Slug-template addressing
96
+ * (`path=`) is the fallback when no entry id is available.
82
97
  */
83
98
  export declare function scrapbookFileUrl(address: ScrapbookAddress, filename: string, opts?: {
84
99
  secret?: boolean;
@@ -86,6 +101,11 @@ export declare function scrapbookFileUrl(address: ScrapbookAddress, filename: st
86
101
  /**
87
102
  * Build the URL to the standalone scrapbook viewer for an address —
88
103
  * the operator's "open scrapbook" jumping-off point.
104
+ *
105
+ * When `address.entryId` is present, appends `?entryId=<uuid>` so the
106
+ * server route resolves the listing via `scrapbookDirForEntry`
107
+ * (entry-aware addressing — #205). Slug-only fallback is preserved
108
+ * when no entry id is available.
89
109
  */
90
110
  export declare function scrapbookViewerUrl(address: ScrapbookAddress): string;
91
111
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"scrapbook-item.d.ts","sourceRoot":"","sources":["../../src/components/scrapbook-item.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,EAGL,KAAK,aAAa,EAEnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAgB,KAAK,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAM9D,gDAAgD;AAChD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAC7B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,KACb,MAAM,GAAG,IAAI,CAAC;AAEnB,MAAM,WAAW,4BAA4B;IAC3C;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,gBAAgB,CAAC;CACxC;AASD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,gBAAgB,EACzB,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GAC9B,MAAM,CAQR;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAIpE;AA+DD;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,gBAAgB,EACzB,IAAI,EAAE,aAAa,EACnB,IAAI,GAAE,4BAAiC,GACtC,OAAO,CA8DT;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,CAAC,EAAE,gBAAgB,GACz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53,13 +53,23 @@ const TEXT_PREVIEW_LINES = 8;
53
53
  * read-only binary endpoint. The endpoint is read-only by design —
54
54
  * Phase 16's image / PDF previews need a stable URL, but full
55
55
  * scrapbook CRUD remains in the standalone viewer's surface.
56
+ *
57
+ * When `address.entryId` is present, sends `entryId=<uuid>` so the
58
+ * server resolves via the entry's sidecar (entry-aware addressing —
59
+ * #205, symmetric to the mutation API). Slug-template addressing
60
+ * (`path=`) is the fallback when no entry id is available.
56
61
  */
57
62
  export function scrapbookFileUrl(address, filename, opts = {}) {
58
63
  const params = new URLSearchParams({
59
64
  site: address.site,
60
- path: address.path,
61
65
  name: filename,
62
66
  });
67
+ if (address.entryId !== undefined && address.entryId.length > 0) {
68
+ params.set('entryId', address.entryId);
69
+ }
70
+ else {
71
+ params.set('path', address.path);
72
+ }
63
73
  if (opts.secret)
64
74
  params.set('secret', '1');
65
75
  return `/api/dev/scrapbook-file?${params.toString()}`;
@@ -67,11 +77,20 @@ export function scrapbookFileUrl(address, filename, opts = {}) {
67
77
  /**
68
78
  * Build the URL to the standalone scrapbook viewer for an address —
69
79
  * the operator's "open scrapbook" jumping-off point.
80
+ *
81
+ * When `address.entryId` is present, appends `?entryId=<uuid>` so the
82
+ * server route resolves the listing via `scrapbookDirForEntry`
83
+ * (entry-aware addressing — #205). Slug-only fallback is preserved
84
+ * when no entry id is available.
70
85
  */
71
86
  export function scrapbookViewerUrl(address) {
72
87
  // The path is already kebab-case + slash-separated; encodeURI keeps
73
88
  // the slashes literal while escaping anything else (defensive).
74
- return `/dev/scrapbook/${address.site}/${encodeURI(address.path)}`;
89
+ const base = `/dev/scrapbook/${address.site}/${encodeURI(address.path)}`;
90
+ if (address.entryId !== undefined && address.entryId.length > 0) {
91
+ return `${base}?entryId=${encodeURIComponent(address.entryId)}`;
92
+ }
93
+ return base;
75
94
  }
76
95
  // ---------------------------------------------------------------------------
77
96
  // Per-kind preview detection
@@ -1 +1 @@
1
- {"version":3,"file":"scrapbook-item.js","sourceRoot":"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M,CAAC,IAAI,CAAA;oCACgB,IAAI,CAAC,IAAI,oBAAoB,IAAI,CAAC,IAAI;kCACxC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;;4CAEV,IAAI,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,IAAI;;kCAE/C,QAAQ;mCACP,SAAS;WACjC,CAAC,CAAC;AACb,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,uBAAuB,CACrC,OAA0B;IAE1B,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC;IACvE,OAAO,MAAM,CAAC,IAAI,CAAA;;yFAEqE,IAAI;WAClF,CAAC,CAAC;AACb,CAAC"}
@@ -3,13 +3,26 @@
3
3
  * handlers use this when they need both metadata (from the sidecar) and
4
4
  * the live document content (from the markdown artifact on disk).
5
5
  *
6
- * The artifact path depends on stage: scrapbook docs (idea/plan/outline)
7
- * for early stages, the canonical `index.md` for Drafting / Final /
8
- * Published. Off-pipeline stages (Blocked / Cancelled) carry their
9
- * priorStage so the resolver can locate the artifact even when the
10
- * entry is paused.
6
+ * Issue #222 (Option B + hybrid refinement) `index.md` is always
7
+ * "the document under review" for index.md-canonical entries. The
8
+ * studio renders `index.md` regardless of `currentStage`. Per-stage
9
+ * scrapbook files are frozen snapshots produced by `approveEntryStage`.
11
10
  *
12
- * Pipeline-redesign Task 33 Phase 6 entry resolver.
11
+ * Resolution order (T1 + non-index.md fallback):
12
+ * 1. If the sidecar carries an `artifactPath`:
13
+ * a. Prefer `<dirname(artifactPath)>/index.md` IF it exists on disk
14
+ * (T1's index.md-canonical case).
15
+ * b. Otherwise fall back to `artifactPath` itself. Supports
16
+ * shared-directory layouts (multiple entries per directory,
17
+ * each addressed by its own filename) — e.g. deskwork's own
18
+ * feature-doc layout where prd.md / workplan.md / README.md
19
+ * share a directory.
20
+ * 2. No artifactPath: try `<contentDir>/<slug>/index.md` (pre-#140
21
+ * entries that the doctor migration hasn't processed yet).
22
+ *
23
+ * Pre-T1 the resolver routed by stage (Ideas → idea.md, Planned →
24
+ * plan.md, Outlining → outline.md, Drafting/Final/Published →
25
+ * index.md). That routing has been retired — see Issue #222.
13
26
  */
14
27
  import type { Entry } from '@deskwork/core/schema/entry';
15
28
  interface ResolveResult {
@@ -1 +1 @@
1
- {"version":3,"file":"entry-resolver.d.ts","sourceRoot":"","sources":["../../src/lib/entry-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAMH,OAAO,KAAK,EAAE,KAAK,EAAS,MAAM,6BAA6B,CAAC;AAEhE,UAAU,aAAa;IACrB,KAAK,EAAE,KAAK,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB;AAaD,wBAAsB,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAoB5F"}
1
+ {"version":3,"file":"entry-resolver.d.ts","sourceRoot":"","sources":["../../src/lib/entry-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAOH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAEzD,UAAU,aAAa;IACrB,KAAK,EAAE,KAAK,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB;AAqBD,wBAAsB,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAK5F"}
@@ -3,46 +3,53 @@
3
3
  * handlers use this when they need both metadata (from the sidecar) and
4
4
  * the live document content (from the markdown artifact on disk).
5
5
  *
6
- * The artifact path depends on stage: scrapbook docs (idea/plan/outline)
7
- * for early stages, the canonical `index.md` for Drafting / Final /
8
- * Published. Off-pipeline stages (Blocked / Cancelled) carry their
9
- * priorStage so the resolver can locate the artifact even when the
10
- * entry is paused.
6
+ * Issue #222 (Option B + hybrid refinement) `index.md` is always
7
+ * "the document under review" for index.md-canonical entries. The
8
+ * studio renders `index.md` regardless of `currentStage`. Per-stage
9
+ * scrapbook files are frozen snapshots produced by `approveEntryStage`.
11
10
  *
12
- * Pipeline-redesign Task 33 Phase 6 entry resolver.
11
+ * Resolution order (T1 + non-index.md fallback):
12
+ * 1. If the sidecar carries an `artifactPath`:
13
+ * a. Prefer `<dirname(artifactPath)>/index.md` IF it exists on disk
14
+ * (T1's index.md-canonical case).
15
+ * b. Otherwise fall back to `artifactPath` itself. Supports
16
+ * shared-directory layouts (multiple entries per directory,
17
+ * each addressed by its own filename) — e.g. deskwork's own
18
+ * feature-doc layout where prd.md / workplan.md / README.md
19
+ * share a directory.
20
+ * 2. No artifactPath: try `<contentDir>/<slug>/index.md` (pre-#140
21
+ * entries that the doctor migration hasn't processed yet).
22
+ *
23
+ * Pre-T1 the resolver routed by stage (Ideas → idea.md, Planned →
24
+ * plan.md, Outlining → outline.md, Drafting/Final/Published →
25
+ * index.md). That routing has been retired — see Issue #222.
13
26
  */
14
27
  import { readFile } from 'node:fs/promises';
15
- import { join } from 'node:path';
28
+ import { existsSync } from 'node:fs';
29
+ import { basename, dirname, join } from 'node:path';
16
30
  import { readSidecar } from '@deskwork/core/sidecar';
17
31
  import { getContentDir } from '@deskwork/core/config';
18
- const STAGE_ARTIFACT = {
19
- Ideas: (s, d) => join(d, s, 'scrapbook', 'idea.md'),
20
- Planned: (s, d) => join(d, s, 'scrapbook', 'plan.md'),
21
- Outlining: (s, d) => join(d, s, 'scrapbook', 'outline.md'),
22
- Drafting: (s, d) => join(d, s, 'index.md'),
23
- Final: (s, d) => join(d, s, 'index.md'),
24
- Published: (s, d) => join(d, s, 'index.md'),
25
- Blocked: null,
26
- Cancelled: null,
27
- };
28
- export async function resolveEntry(projectRoot, uuid) {
29
- const entry = await readSidecar(projectRoot, uuid);
30
- // #140: prefer the explicit artifactPath when set; fall back to the
31
- // slug+stage heuristic only for entries that don't have one (entries
32
- // created pre-#140 fix and not yet doctor-repaired).
33
- let artifactPath;
32
+ function resolveIndexPath(projectRoot, entry) {
34
33
  if (entry.artifactPath) {
35
- artifactPath = join(projectRoot, entry.artifactPath);
36
- }
37
- else {
38
- const stage = entry.priorStage ?? entry.currentStage;
39
- const pathFn = STAGE_ARTIFACT[stage];
40
- if (pathFn === null) {
41
- throw new Error(`No artifact path for stage ${stage}`);
42
- }
43
- const contentDir = getContentDir(projectRoot);
44
- artifactPath = pathFn(entry.slug, contentDir);
34
+ const absArtifact = join(projectRoot, entry.artifactPath);
35
+ // Strip the scrapbook segment for legacy `<dir>/scrapbook/<file>.md`
36
+ // shapes; otherwise dirname(absArtifact) IS the doc dir.
37
+ const dir = basename(dirname(absArtifact)) === 'scrapbook'
38
+ ? dirname(dirname(absArtifact))
39
+ : dirname(absArtifact);
40
+ const indexPath = join(dir, 'index.md');
41
+ // T1's index.md-canonical preference: only if it actually exists.
42
+ // Otherwise fall back to artifactPath (shared-directory layouts).
43
+ if (existsSync(indexPath))
44
+ return indexPath;
45
+ return absArtifact;
45
46
  }
47
+ const contentDir = getContentDir(projectRoot);
48
+ return join(contentDir, entry.slug, 'index.md');
49
+ }
50
+ export async function resolveEntry(projectRoot, uuid) {
51
+ const entry = await readSidecar(projectRoot, uuid);
52
+ const artifactPath = resolveIndexPath(projectRoot, entry);
46
53
  const artifactBody = await readFile(artifactPath, 'utf8');
47
54
  return { entry, artifactBody, artifactPath };
48
55
  }
@@ -1 +1 @@
1
- {"version":3,"file":"entry-resolver.js","sourceRoot":"","sources":["../../src/lib/entry-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,C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G,OAAO,CAuC3E"}
1
+ {"version":3,"file":"affordances.d.ts","sourceRoot":"","sources":["../../../src/pages/dashboard/affordances.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAgB,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAExD,OAAO,KAAK,EAAE,KAAK,EAAS,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAQ7E;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,GAAG,OAAO,CAK9E;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAE7D;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAkD3E"}
@@ -8,6 +8,7 @@
8
8
  * universal-verb skills are the canonical action path.
9
9
  */
10
10
  import { html, unsafe } from "../html.js";
11
+ import { scrapbookViewerUrl } from "../../components/scrapbook-item.js";
11
12
  const REVIEW_STATE_LABEL = {
12
13
  'in-review': 'in review',
13
14
  iterating: 'iterating',
@@ -62,7 +63,18 @@ export function renderRowActions(entry, defaultSite) {
62
63
  // primary value is the dashboard ↔ scrapbook entry point existing at
63
64
  // all, and most projects have a single site). Slug already contains
64
65
  // any hierarchical path segments.
65
- const scrapLink = `/dev/scrapbook/${defaultSite}/${entry.slug}`;
66
+ //
67
+ // #205: thread the entry's UUID through `scrapbookViewerUrl` so the
68
+ // standalone viewer's server route resolves the listing via
69
+ // `scrapbookDirForEntry` for entries whose on-disk path doesn't match
70
+ // the slug template (e.g. feature-doc layouts under
71
+ // `docs/<version>/<status>/<slug>/`). Falls back to slug-template
72
+ // addressing for entries without an id binding.
73
+ const scrapLink = scrapbookViewerUrl({
74
+ site: defaultSite,
75
+ path: entry.slug,
76
+ entryId: entry.uuid,
77
+ });
66
78
  if (isLinearActiveStage(stage)) {
67
79
  buttons.push(html `<a class="er-btn er-btn-small" href="${reviewLink}"
68
80
  title="open the review surface for ${entry.slug}">open →</a>`);
@@ -1 +1 @@
1
- {"version":3,"file":"affordances.js","sourceRoot":"","sources":["../../../src/pages/dashboard/affordances.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,EAAgB,MAAM,YAAY,CAAC;AAGxD,MAAM,kBAAkB,GAAgC;IACtD,WAAW,EAAE,WAAW;IACxB,SAAS,EAAE,WAAW;IACtB,QAAQ,EAAE,UAAU;CACrB,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,KAA8B;IACnE,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,MAAM,CAAC,wEAAwE,CAAC,CAAC;IAC1F,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAA,kCAAkC,KAAK,wBAAwB,KAAK,KAAK,kBAAkB,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACjI,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAAY;IACnD,OAAO,KAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;AACzD,CAAC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAY,EAAE,WAAmB;IAChE,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,MAAM,KAAK,GAAG,KAAK,CAAC,YAAY,CAAC;IACjC,MAAM,UAAU,GAAG,+BAA+B,KAAK,CAAC,IAAI,EAAE,CAAC;IAC/D,qEAAqE;IACrE,qEAAqE;IACrE,qEAAqE;IACrE,oEAAoE;IACpE,kCAAkC;IAClC,MAAM,SAAS,GAAG,kBAAkB,WAAW,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;IAEhE,IAAI,mBAAmB,CAAC,KAAK,CAAC,EAAE,CAAC;Q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C,IAAI,CAAC,IAAI,CAAA,wCAAwC,UAAU;2CAC5B,KAAK,CAAC,IAAI,cAAc,CAAC,CAAC;QACjE,IAAI,KAAK,CAAC,WAAW,KAAK,WAAW,EAAE,CAAC;YACtC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA;uCACgB,KAAK,CAAC,IAAI;mGACkD,CAAC,CAAC;QACjG,CAAC;QACD,IAAI,KAAK,CAAC,WAAW,KAAK,UAAU,EAAE,CAAC;YACrC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA;uCACgB,KAAK,CAAC,IAAI;yEACwB,CAAC,CAAC;QACvE,CAAC;IACH,CAAC;SAAM,IAAI,KAAK,KAAK,WAAW,EAAE,CAAC;QACjC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,wCAAwC,UAAU;0EACG,CAAC,CAAC;IAC1E,CAAC;SAAM,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,WAAW,EAAE,CAAC;QACxD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA;oCACe,KAAK,CAAC,IAAI;wEAC0B,CAAC,CAAC;IACxE,CAAC;IAED,uDAAuD;IACvD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA;YACP,SAAS;sFACiE,CAAC,CAAC;IAEtF,OAAO,MAAM,CAAC,oCAAoC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;AAC/E,CAAC;AAED,SAAS,mBAAmB,CAAC,KAAY;IACvC,OAAO,CACL,KAAK,KAAK,OAAO;QACjB,KAAK,KAAK,SAAS;QACnB,KAAK,KAAK,WAAW;QACrB,KAAK,KAAK,UAAU;QACpB,KAAK,KAAK,OAAO,CAClB,CAAC;AACJ,CAAC"}
@@ -9,6 +9,7 @@
9
9
  */
10
10
 
11
11
  import { html, unsafe, type RawHtml } from '../html.ts';
12
+ import { scrapbookViewerUrl } from '../../components/scrapbook-item.ts';
12
13
  import type { Entry, Stage, ReviewState } from '@deskwork/core/schema/entry';
13
14
 
14
15
  const REVIEW_STATE_LABEL: Record<ReviewState, string> = {
@@ -68,7 +69,18 @@ export function renderRowActions(entry: Entry, defaultSite: string): RawHtml {
68
69
  // primary value is the dashboard ↔ scrapbook entry point existing at
69
70
  // all, and most projects have a single site). Slug already contains
70
71
  // any hierarchical path segments.
71
- const scrapLink = `/dev/scrapbook/${defaultSite}/${entry.slug}`;
72
+ //
73
+ // #205: thread the entry's UUID through `scrapbookViewerUrl` so the
74
+ // standalone viewer's server route resolves the listing via
75
+ // `scrapbookDirForEntry` for entries whose on-disk path doesn't match
76
+ // the slug template (e.g. feature-doc layouts under
77
+ // `docs/<version>/<status>/<slug>/`). Falls back to slug-template
78
+ // addressing for entries without an id binding.
79
+ const scrapLink = scrapbookViewerUrl({
80
+ site: defaultSite,
81
+ path: entry.slug,
82
+ entryId: entry.uuid,
83
+ });
72
84
 
73
85
  if (isLinearActiveStage(stage)) {
74
86
  buttons.push(html`<a class="er-btn er-btn-small" href="${reviewLink}"
@@ -1 +1 @@
1
- {"version":3,"file":"review-scrapbook-drawer.d.ts","sourceRoot":"","sources":["../../src/pages/review-scrapbook-drawer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAYH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAOtD,OAAO,EAA4B,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAqFnE,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,aAAa,EAClB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,aAAa,GAAG,IAAI,EAC3B,IAAI,EAAE,MAAM,EACZ,KAAK,CAAC,EAAE,YAAY,GACnB,OAAO,CA6DT"}
1
+ {"version":3,"file":"review-scrapbook-drawer.d.ts","sourceRoot":"","sources":["../../src/pages/review-scrapbook-drawer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAYH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAOtD,OAAO,EAA4B,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAqFnE,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,aAAa,EAClB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,aAAa,GAAG,IAAI,EAC3B,IAAI,EAAE,MAAM,EACZ,KAAK,CAAC,EAAE,YAAY,GACnB,OAAO,CAuET"}
@@ -101,6 +101,15 @@ export function renderScrapbookDrawer(ctx, site, entry, slug, index) {
101
101
  const secretItems = summary?.secretItems ?? [];
102
102
  const total = items.length + secretItems.length;
103
103
  const loader = makeInlineTextLoader(ctx, site, entry, slug, index);
104
+ // #205: prefer entry-aware addressing for the "open viewer ↗" link
105
+ // when this drawer renders for a tracked calendar entry. The standalone
106
+ // viewer's server route resolves the listing via `scrapbookDirForEntry`
107
+ // when `entryId` is present, matching the entry-aware mutation API.
108
+ // Falls back to slug-template addressing when the entry has no id
109
+ // binding (pre-doctor entries, legacy / organizational paths).
110
+ const viewerAddress = entry !== null && entry.id !== undefined && entry.id !== ''
111
+ ? { site, path: slug, entryId: entry.id }
112
+ : { site, path: slug };
104
113
  return unsafe(html `
105
114
  <aside class="er-scrapbook-drawer" data-scrapbook-drawer aria-label="Scrapbook for this entry">
106
115
  <header class="er-scrapbook-drawer-handle" data-drawer-toggle role="button" tabindex="0"
@@ -110,7 +119,7 @@ export function renderScrapbookDrawer(ctx, site, entry, slug, index) {
110
119
  <span class="er-scrapbook-drawer-peek" aria-hidden="true">
111
120
  ${unsafe(renderPeek(items, secretItems))}
112
121
  </span>
113
- <a class="er-scrapbook-drawer-open" href="${scrapbookViewerUrl({ site, path: slug })}"
122
+ <a class="er-scrapbook-drawer-open" href="${scrapbookViewerUrl(viewerAddress)}"
114
123
  title="Open the standalone scrapbook viewer"
115
124
  onclick="event.stopPropagation()">open viewer ↗</a>
116
125
  <button class="er-scrapbook-drawer-toggle" type="button" data-drawer-toggle
@@ -1 +1 @@
1
- {"version":3,"file":"review-scrapbook-drawer.js","sourceRoot":"","sources":["../../src/pages/review-scrapbook-drawer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,oBAAoB,GAGrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAIzD,OAAO,EACL,uBAAuB,EACvB,0BAA0B,EAC1B,kBAAkB,GAEnB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAgB,MAAM,WAAW,CAAC;AAEnE;;;;;;;;;;;;GAYG;AACH,SAAS,oBAAoB,CAC3B,GAAkB,EAClB,IAAY,EACZ,KAA2C,EAC3C,IAAY,EACZ,KAAoB;IAEpB,MAAM,YAAY,GAAG,KAAK;QACxB,CAAC,CAAC,oBAAoB,CAAC,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC;QACvE,CAAC,CAAC,IAAI,CACF,iBAAiB,CAAC,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,EACpD,IAAI,EACJ,WAAW,CACZ,CAAC;IACN,OAAO,CAAC,QAAQ,EAAE,QAAQ,EAAE,EAAE;QAC5B,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,YAAY,CAAC,IAAI,CAA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AI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC;UAErD,WAAW,CAAC,MAAM,GAAG,CAAC;QACpB,CAAC,CAAC,MAAM,CAAC,IAAI,CAAA;;;iEAGwC,WAAW,CAAC,MAAM;;oBAE/D,0BAA0B,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,CAAC;uBACxD,CAAC;QACZ,CAAC,CAAC,EACN;;aAEK,CAAC,CAAC;AACf,CAAC"}
@@ -156,6 +156,16 @@ export function renderScrapbookDrawer(
156
156
  const secretItems = summary?.secretItems ?? [];
157
157
  const total = items.length + secretItems.length;
158
158
  const loader = makeInlineTextLoader(ctx, site, entry, slug, index);
159
+ // #205: prefer entry-aware addressing for the "open viewer ↗" link
160
+ // when this drawer renders for a tracked calendar entry. The standalone
161
+ // viewer's server route resolves the listing via `scrapbookDirForEntry`
162
+ // when `entryId` is present, matching the entry-aware mutation API.
163
+ // Falls back to slug-template addressing when the entry has no id
164
+ // binding (pre-doctor entries, legacy / organizational paths).
165
+ const viewerAddress: { site: string; path: string; entryId?: string } =
166
+ entry !== null && entry.id !== undefined && entry.id !== ''
167
+ ? { site, path: slug, entryId: entry.id }
168
+ : { site, path: slug };
159
169
 
160
170
  return unsafe(html`
161
171
  <aside class="er-scrapbook-drawer" data-scrapbook-drawer aria-label="Scrapbook for this entry">
@@ -166,7 +176,7 @@ export function renderScrapbookDrawer(
166
176
  <span class="er-scrapbook-drawer-peek" aria-hidden="true">
167
177
  ${unsafe(renderPeek(items, secretItems))}
168
178
  </span>
169
- <a class="er-scrapbook-drawer-open" href="${scrapbookViewerUrl({ site, path: slug })}"
179
+ <a class="er-scrapbook-drawer-open" href="${scrapbookViewerUrl(viewerAddress)}"
170
180
  title="Open the standalone scrapbook viewer"
171
181
  onclick="event.stopPropagation()">open viewer ↗</a>
172
182
  <button class="er-scrapbook-drawer-toggle" type="button" data-drawer-toggle
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Scrapbook page listing dispatch — entry-aware vs slug-template
3
+ * resolution. Mirrors the post-#191 envelope/dispatch split for
4
+ * mutations: dispatch chooses the addressing mode, render stays free
5
+ * of the resolution branch.
6
+ */
7
+ import { type ScrapbookSummary } from '@deskwork/core/scrapbook';
8
+ import type { StudioContext } from '../../routes/api.ts';
9
+ /**
10
+ * Error class surfaced by the page route to translate into HTTP status
11
+ * codes (`server.ts` maps these onto 400/404 responses).
12
+ */
13
+ export declare class ScrapbookPageError extends Error {
14
+ readonly status: 400 | 404;
15
+ constructor(message: string, status: 400 | 404);
16
+ }
17
+ /**
18
+ * #168 Phase 34 ship-pass — when the scrapbook path matches a tracked
19
+ * calendar entry with a stamped UUID, return the entry's id so the aside
20
+ * can render a "← back to review" link AND the client can address
21
+ * mutations via `entryId` (#191 fix). Returns null when no entry matches
22
+ * (organizational subdirs, ad-hoc paths, or pre-doctor entries lacking
23
+ * an id) — the link is then omitted and mutations fall back to slug-
24
+ * template addressing.
25
+ *
26
+ * Failures (calendar absent, parse error) fall through to null so a
27
+ * transient calendar issue never blocks the scrapbook render.
28
+ */
29
+ export declare function lookupEntryId(ctx: StudioContext, site: string, path: string): string | null;
30
+ /**
31
+ * #205 — listing + dir-resolution dispatch. Two addressing modes:
32
+ *
33
+ * - Entry-id mode: `entryId` is validated as a UUID, the sidecar is
34
+ * read, and the listing resolves via `listScrapbookForEntry` so
35
+ * non-kebab-case entries (feature-doc layouts, dotted version
36
+ * segments, etc.) read items from the entry's artifact-parent
37
+ * `scrapbook/` directory. Symmetric to the entry-aware mutation API.
38
+ * - Slug mode: legacy / organizational paths under the site's content
39
+ * dir. Resolves via `scrapbookDirAtPath` + `listScrapbook` (the
40
+ * pre-#205 behavior).
41
+ *
42
+ * Returns the resolved `scrapbookDir` (absolute) plus the listing
43
+ * summary so the caller threads both through to render helpers.
44
+ */
45
+ export declare function resolveListing(ctx: StudioContext, site: string, path: string, entryId: string | null): Promise<{
46
+ scrapbookDir: string;
47
+ result: ScrapbookSummary;
48
+ resolvedEntryId: string | null;
49
+ }>;
50
+ //# sourceMappingURL=dispatch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../../../src/pages/scrapbook/dispatch.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,EAKL,KAAK,gBAAgB,EACtB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,QAAQ,CAAC,MAAM,EAAE,GAAG,GAAG,GAAG,CAAC;gBACf,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,GAAG;CAK/C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,aAAa,EAClB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GACX,MAAM,GAAG,IAAI,CAYf;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,cAAc,CAClC,GAAG,EAAE,aAAa,EAClB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GAAG,IAAI,GACrB,OAAO,CAAC;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,gBAAgB,CAAC;IAAC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC,CA0C7F"}
@@ -0,0 +1,104 @@
1
+ /**
2
+ * Scrapbook page listing dispatch — entry-aware vs slug-template
3
+ * resolution. Mirrors the post-#191 envelope/dispatch split for
4
+ * mutations: dispatch chooses the addressing mode, render stays free
5
+ * of the resolution branch.
6
+ */
7
+ import { existsSync } from 'node:fs';
8
+ import { readCalendar } from '@deskwork/core/calendar';
9
+ import { findEntry } from '@deskwork/core/calendar-mutations';
10
+ import { resolveCalendarPath } from '@deskwork/core/paths';
11
+ import { listScrapbook, listScrapbookForEntry, scrapbookDirAtPath, scrapbookDirForEntry, } from '@deskwork/core/scrapbook';
12
+ import { readSidecar } from '@deskwork/core/sidecar';
13
+ import { UUID_RE } from "../../routes/scrapbook-mutation-envelope.js";
14
+ /**
15
+ * Error class surfaced by the page route to translate into HTTP status
16
+ * codes (`server.ts` maps these onto 400/404 responses).
17
+ */
18
+ export class ScrapbookPageError extends Error {
19
+ status;
20
+ constructor(message, status) {
21
+ super(message);
22
+ this.status = status;
23
+ this.name = 'ScrapbookPageError';
24
+ }
25
+ }
26
+ /**
27
+ * #168 Phase 34 ship-pass — when the scrapbook path matches a tracked
28
+ * calendar entry with a stamped UUID, return the entry's id so the aside
29
+ * can render a "← back to review" link AND the client can address
30
+ * mutations via `entryId` (#191 fix). Returns null when no entry matches
31
+ * (organizational subdirs, ad-hoc paths, or pre-doctor entries lacking
32
+ * an id) — the link is then omitted and mutations fall back to slug-
33
+ * template addressing.
34
+ *
35
+ * Failures (calendar absent, parse error) fall through to null so a
36
+ * transient calendar issue never blocks the scrapbook render.
37
+ */
38
+ export function lookupEntryId(ctx, site, path) {
39
+ if (!(site in ctx.config.sites))
40
+ return null;
41
+ try {
42
+ const calendarPath = resolveCalendarPath(ctx.projectRoot, ctx.config, site);
43
+ if (!existsSync(calendarPath))
44
+ return null;
45
+ const cal = readCalendar(calendarPath);
46
+ const entry = findEntry(cal, path);
47
+ if (!entry || !entry.id)
48
+ return null;
49
+ return entry.id;
50
+ }
51
+ catch {
52
+ return null;
53
+ }
54
+ }
55
+ /**
56
+ * #205 — listing + dir-resolution dispatch. Two addressing modes:
57
+ *
58
+ * - Entry-id mode: `entryId` is validated as a UUID, the sidecar is
59
+ * read, and the listing resolves via `listScrapbookForEntry` so
60
+ * non-kebab-case entries (feature-doc layouts, dotted version
61
+ * segments, etc.) read items from the entry's artifact-parent
62
+ * `scrapbook/` directory. Symmetric to the entry-aware mutation API.
63
+ * - Slug mode: legacy / organizational paths under the site's content
64
+ * dir. Resolves via `scrapbookDirAtPath` + `listScrapbook` (the
65
+ * pre-#205 behavior).
66
+ *
67
+ * Returns the resolved `scrapbookDir` (absolute) plus the listing
68
+ * summary so the caller threads both through to render helpers.
69
+ */
70
+ export async function resolveListing(ctx, site, path, entryId) {
71
+ if (entryId !== null) {
72
+ if (!UUID_RE.test(entryId)) {
73
+ throw new ScrapbookPageError(`invalid entryId`, 400);
74
+ }
75
+ let entry;
76
+ try {
77
+ entry = await readSidecar(ctx.projectRoot, entryId);
78
+ }
79
+ catch (e) {
80
+ // readSidecar throws "sidecar not found" with ENOENT; map to 404.
81
+ const reason = e instanceof Error ? e.message : String(e);
82
+ if (/sidecar not found/i.test(reason)) {
83
+ throw new ScrapbookPageError(reason, 404);
84
+ }
85
+ throw e;
86
+ }
87
+ const scrapbookDir = scrapbookDirForEntry(ctx.projectRoot, ctx.config, site, { id: entry.uuid, slug: entry.slug });
88
+ const result = listScrapbookForEntry(ctx.projectRoot, ctx.config, site, { id: entry.uuid, slug: entry.slug });
89
+ return { scrapbookDir, result, resolvedEntryId: entry.uuid };
90
+ }
91
+ // Slug-mode: legacy back-compat. listScrapbook returns
92
+ // { exists: false, items: [] } for missing dirs, so an empty
93
+ // scrapbook is not an error path. Real errors (slug validation,
94
+ // scrapbookDir resolution failures, FS permission issues)
95
+ // propagate to the studio's error handler.
96
+ const scrapbookDir = scrapbookDirAtPath(ctx.projectRoot, ctx.config, site, path);
97
+ const result = listScrapbook(ctx.projectRoot, ctx.config, site, path);
98
+ // Best-effort lookup so the back-link to the review surface still
99
+ // renders for slug-template entries that happen to match a calendar
100
+ // entry by slug.
101
+ const resolvedEntryId = lookupEntryId(ctx, site, path);
102
+ return { scrapbookDir, result, resolvedEntryId };
103
+ }
104
+ //# sourceMappingURL=dispatch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dispatch.js","sourceRoot":"","sources":["../../../src/pages/scrapbook/dispatch.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;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,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;IAC/D,CAAC;IACD,uDAAuD;IACvD,6DAA6D;IAC7D,gEAAgE;IAChE,0DAA0D;IAC1D,2CAA2C;IAC3C,MAAM,YAAY,GAAG,kBAAkB,CAAC,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IACjF,MAAM,MAAM,GAAG,aAAa,CAAC,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IACtE,kEAAkE;IAClE,oEAAoE;IACpE,iBAAiB;IACjB,MAAM,eAAe,GAAG,aAAa,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IACvD,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,eAAe,EAAE,CAAC;AACnD,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Scrapbook image-format readers — pure functions on Buffer headers.
3
+ *
4
+ * Recognizes PNG, JPEG, WebP, and GIF; returns null for unrecognized
5
+ * signatures or truncated/malformed buffers. Used by the scrapbook
6
+ * card meta to render `{W} × {H}` next to the image kind chip.
7
+ *
8
+ * Each format is parsed from its file-header structure (no external
9
+ * dependency); each branch returns null on any unexpected byte rather
10
+ * than throwing, so a corrupt image still renders with empty meta.
11
+ */
12
+ export interface ImageDimensions {
13
+ readonly width: number;
14
+ readonly height: number;
15
+ }
16
+ /**
17
+ * Read width × height from a buffer. Recognizes PNG, JPEG, WebP, and
18
+ * GIF; returns null for unrecognized signatures or truncated/malformed
19
+ * buffers.
20
+ */
21
+ export declare function readImageDimensions(buf: Buffer): ImageDimensions | null;
22
+ export declare function readJpegDimensions(buf: Buffer): ImageDimensions | null;
23
+ export declare function readWebpDimensions(buf: Buffer): ImageDimensions | null;
24
+ //# sourceMappingURL=image-readers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image-readers.d.ts","sourceRoot":"","sources":["../../../src/pages/scrapbook/image-readers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAiCvE;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAoCtE;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAyCtE"}