sandcms 0.5.2 → 0.6.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 (151) hide show
  1. package/README.md +6 -4
  2. package/dist/admin/Account.svelte +4 -1
  3. package/dist/admin/ApiKeys.svelte +159 -0
  4. package/dist/admin/ApiKeys.svelte.d.ts +3 -0
  5. package/dist/admin/AssetAttachment.svelte +6 -4
  6. package/dist/admin/BlueprintFields.svelte +86 -0
  7. package/dist/admin/BlueprintFields.svelte.d.ts +15 -0
  8. package/dist/admin/Collection.svelte +40 -7
  9. package/dist/admin/Editor.svelte +57 -17
  10. package/dist/admin/Fields.svelte +217 -144
  11. package/dist/admin/Fields.svelte.d.ts +1 -0
  12. package/dist/admin/FocusPicker.svelte +136 -0
  13. package/dist/admin/FocusPicker.svelte.d.ts +11 -0
  14. package/dist/admin/Gallery.svelte +40 -34
  15. package/dist/admin/GlobalSearch.svelte +56 -0
  16. package/dist/admin/GlobalSearch.svelte.d.ts +3 -0
  17. package/dist/admin/Inbox.svelte +8 -5
  18. package/dist/admin/LinkField.svelte +116 -0
  19. package/dist/admin/LinkField.svelte.d.ts +17 -0
  20. package/dist/admin/MediaLibrary.svelte +41 -14
  21. package/dist/admin/MediaPicker.svelte +12 -2
  22. package/dist/admin/Navigation.svelte +62 -0
  23. package/dist/admin/Navigation.svelte.d.ts +7 -0
  24. package/dist/admin/NotificationSettings.svelte +2 -2
  25. package/dist/admin/SearchList.svelte +55 -0
  26. package/dist/admin/SearchList.svelte.d.ts +42 -0
  27. package/dist/admin/SelectField.svelte +3 -1
  28. package/dist/admin/SelectField.svelte.d.ts +1 -0
  29. package/dist/admin/Shell.svelte +16 -24
  30. package/dist/admin/UnsavedChanges.svelte +1 -1
  31. package/dist/admin/Users.svelte +11 -5
  32. package/dist/admin/client.js +2 -1
  33. package/dist/admin/generated/admin.css +145 -0
  34. package/dist/admin/navigation.d.ts +7 -0
  35. package/dist/admin/navigation.js +25 -0
  36. package/dist/admin/types.d.ts +5 -1
  37. package/dist/admin/uploads.js +27 -6
  38. package/dist/blueprints/conditions.d.ts +2 -0
  39. package/dist/blueprints/conditions.js +4 -0
  40. package/dist/blueprints/extends.d.ts +5 -0
  41. package/dist/blueprints/extends.js +76 -0
  42. package/dist/blueprints/files.d.ts +3 -1
  43. package/dist/blueprints/files.js +35 -2
  44. package/dist/blueprints/layout.d.ts +4 -0
  45. package/dist/blueprints/layout.js +12 -0
  46. package/dist/blueprints/load.d.ts +1 -1
  47. package/dist/blueprints/load.js +127 -12
  48. package/dist/blueprints/types.d.ts +38 -1
  49. package/dist/blueprints/validate.js +30 -6
  50. package/dist/cli/cloudflare.js +15 -3
  51. package/dist/cli/doctor.js +6 -3
  52. package/dist/cli/files.js +1 -1
  53. package/dist/cli/scaffold.js +8 -6
  54. package/dist/cli/setup.js +9 -2
  55. package/dist/cli/upgrade.js +2 -1
  56. package/dist/email-failure.d.ts +17 -0
  57. package/dist/email-failure.js +22 -0
  58. package/dist/index.d.ts +2 -1
  59. package/dist/index.js +1 -0
  60. package/dist/link.d.ts +17 -0
  61. package/dist/link.js +44 -0
  62. package/dist/notification-fields.js +1 -1
  63. package/dist/search.d.ts +8 -0
  64. package/dist/search.js +1 -0
  65. package/dist/server/access.d.ts +2 -0
  66. package/dist/server/access.js +59 -23
  67. package/dist/server/admin-load.d.ts +29 -2
  68. package/dist/server/admin-load.js +4 -2
  69. package/dist/server/api-access.d.ts +31 -0
  70. package/dist/server/api-access.js +52 -0
  71. package/dist/server/api-pagination.d.ts +34 -0
  72. package/dist/server/api-pagination.js +87 -0
  73. package/dist/server/api.js +224 -32
  74. package/dist/server/auth.d.ts +1150 -0
  75. package/dist/server/auth.js +11 -1
  76. package/dist/server/cms.d.ts +1208 -4
  77. package/dist/server/cms.js +2 -0
  78. package/dist/server/content.d.ts +17 -2
  79. package/dist/server/content.js +89 -14
  80. package/dist/server/db/migration-data.js +24 -0
  81. package/dist/server/db/migrations/0001_independent_password_resets.sql +3 -0
  82. package/dist/server/db/migrations/0002_email_failure_reason.sql +1 -0
  83. package/dist/server/db/migrations/0003_direct_r2_uploads.sql +10 -0
  84. package/dist/server/db/migrations/0004_agent_api_keys.sql +38 -0
  85. package/dist/server/db/migrations/0005_api_retention_and_pagination.sql +3 -0
  86. package/dist/server/db/migrations/0006_durable_media_deletion.sql +7 -0
  87. package/dist/server/db/migrations/meta/0001_snapshot.json +1197 -0
  88. package/dist/server/db/migrations/meta/0002_snapshot.json +1204 -0
  89. package/dist/server/db/migrations/meta/0003_snapshot.json +1281 -0
  90. package/dist/server/db/migrations/meta/0004_snapshot.json +1546 -0
  91. package/dist/server/db/migrations/meta/0005_snapshot.json +1572 -0
  92. package/dist/server/db/migrations/meta/0006_snapshot.json +1627 -0
  93. package/dist/server/db/migrations/meta/_journal.json +42 -0
  94. package/dist/server/db/schema.d.ts +742 -2
  95. package/dist/server/db/schema.js +77 -5
  96. package/dist/server/email/index.d.ts +11 -1
  97. package/dist/server/email/index.js +69 -6
  98. package/dist/server/forms.js +12 -2
  99. package/dist/server/hooks.d.ts +1 -1
  100. package/dist/server/hooks.js +37 -14
  101. package/dist/server/index.d.ts +1 -1
  102. package/dist/server/index.js +1 -1
  103. package/dist/server/links.d.ts +5 -0
  104. package/dist/server/links.js +44 -0
  105. package/dist/server/media/deletions.d.ts +2 -0
  106. package/dist/server/media/deletions.js +58 -0
  107. package/dist/server/media/presets.d.ts +10 -2
  108. package/dist/server/media/presets.js +14 -2
  109. package/dist/server/media/runner.d.ts +1 -1
  110. package/dist/server/media/runner.js +105 -8
  111. package/dist/server/media/service.d.ts +41 -3
  112. package/dist/server/media/service.js +146 -33
  113. package/dist/server/notifications.d.ts +1 -0
  114. package/dist/server/notifications.js +4 -2
  115. package/dist/server/request.d.ts +2 -0
  116. package/dist/server/request.js +5 -0
  117. package/dist/server/search.d.ts +13 -0
  118. package/dist/server/search.js +97 -0
  119. package/dist/worker/index.d.ts +3 -3
  120. package/dist/worker/index.js +205 -64
  121. package/dist/worker/local.d.ts +5 -0
  122. package/dist/worker/local.js +57 -0
  123. package/dist/worker/source.d.ts +1 -1
  124. package/dist/worker/source.js +2 -2
  125. package/dist/worker/uploads.d.ts +22 -0
  126. package/dist/worker/uploads.js +46 -0
  127. package/docs/acceptance.md +1 -1
  128. package/docs/api.md +73 -0
  129. package/docs/cloudflare.md +35 -8
  130. package/docs/content.md +181 -5
  131. package/docs/deployment.md +29 -4
  132. package/docs/email.md +14 -10
  133. package/docs/forms.md +3 -1
  134. package/docs/media.md +34 -5
  135. package/docs/package.md +7 -5
  136. package/docs/releases.md +56 -1
  137. package/docs/upgrades.md +59 -3
  138. package/package.json +19 -10
  139. package/templates/hooks.server.ts +3 -3
  140. package/templates/integration.ts +2 -2
  141. package/templates/routes/admin/+page.server.ts +2 -2
  142. package/templates/routes/admin/+page.svelte +1 -1
  143. package/templates/routes/api/+server.ts +2 -2
  144. package/templates/sandcms/blueprints/collections/projects.yaml +16 -8
  145. package/templates/sandcms/blueprints/fields/seo.yaml +5 -0
  146. package/templates/sandcms/blueprints/files/image.yaml +1 -0
  147. package/templates/sandcms/blueprints/pages/home.yaml +3 -0
  148. package/templates/sandcms/config.yaml +1 -0
  149. package/templates/sandcms/worker/index.ts +1 -1
  150. package/templates/sandcms/worker/local.ts +1 -0
  151. package/templates/sandcms/worker/wrangler.jsonc +1 -2
package/docs/media.md CHANGED
@@ -4,7 +4,7 @@ The website's Bun process owns SQLite and the durable media job runner. Image pr
4
4
 
5
5
  Input is capped at the configured limit (at most 100 MB), SVG at 1 MB, raster dimensions at 100 megapixels, and each encoded output at 20 MB. Encoded variants are bounded and buffered before writing to R2, which requires a known body length. These limits bound local resource use; verify the preset matrix and practical limits against staging before release.
6
6
 
7
- Raster encoding uses [Cloudflare remote transformations](https://developers.cloudflare.com/images/optimization/transformations/transform-via-workers/) with a 100 MB / 100 MP input ceiling. The Images binding remains configured for dimension inspection only; its 20 MB `.input()` encoding path is no longer used. Originals stream through private R2 staging objects for validation before promotion, so the Worker does not buffer a 100 MB upload. Failed validation removes staging objects. After an interrupted Worker invocation, abandoned `incoming/` objects can be removed with an R2 lifecycle rule restricted to that prefix.
7
+ Raster encoding uses [Cloudflare remote transformations](https://developers.cloudflare.com/images/optimization/transformations/transform-via-workers/) with a 100 MB / 100 MP input ceiling. Dimension inspection also uses remote transformations (`format=json`, `anim=false`), avoiding the Images binding’s input limit. Validated dimensions are saved as R2 custom metadata and reused for variants; older originals without this metadata are inspected remotely on rebuild. The `IMAGES` binding is no longer required. Originals stream through private R2 staging objects for validation before promotion, so the Worker does not buffer a 100 MB upload. Inspection reads staging objects through five-minute signed URLs scoped to the asset and upload attempt; these URLs are never returned to clients. Failed validation removes staging objects. After an interrupted Worker invocation, abandoned `incoming/` objects can be removed with an R2 lifecycle rule restricted to that prefix.
8
8
 
9
9
  ## Presets
10
10
 
@@ -22,7 +22,32 @@ media:
22
22
  formats: { webp: 85 }
23
23
  ```
24
24
 
25
- Sizes are longest-side pixels. Outputs preserve aspect ratio and do not upscale. Formats are WebP, AVIF, and JPEG, each with quality 1–100. The default upload cap and configured maximum are 100 MB (100,000,000 bytes). Raster input is additionally limited to 100 megapixels. SVG is limited to 1 MB and is sanitized using a strict XML parser and allowlists; scripts, foreign content, external references, event handlers, and styles are removed. Document types/entities are rejected. The sanitized derivative receives restrictive CSP and nosniff headers, and is not resized or encoded as WebP.
25
+ Sizes are longest-side pixels. Outputs preserve aspect ratio and do not upscale unless an optional `aspectRatio` (width divided by height, 0.01–100) requests a crop. Cropped outputs also never upscale; small originals produce smaller variants with the requested ratio, subject to pixel rounding. Formats are WebP, AVIF, and JPEG, each with quality 1–100. The default upload cap and configured maximum are 100 MB (100,000,000 bytes). Raster input is additionally limited to 100 megapixels. SVG is limited to 1 MB and is sanitized using a strict XML parser and allowlists; scripts, foreign content, external references, event handlers, and styles are removed. Document types/entities are rejected. The sanitized derivative receives restrictive CSP and nosniff headers, and is not resized or encoded as WebP.
26
+
27
+ ## Focal points
28
+
29
+ Add one optional top-level focus field to a file blueprint:
30
+
31
+ ```yaml
32
+ fields:
33
+ alt: { type: text, label: Alternative text }
34
+ focus: { type: focus, label: Focal point }
35
+ ```
36
+
37
+ In the media library, click or drag on the uncropped image preview to select the subject. Arrow keys move the point (Shift moves faster), and horizontal/vertical sliders provide another way to choose coordinates. Save details to persist `{x, y}` in the file's metadata. Coordinates range from 0 to 1, measured from the left/top edge. Reset clears the point and restores centered crops. Focus belongs to the shared file and cannot be overridden in galleries. SVG derivatives remain uncropped.
38
+
39
+ Enable cropping on the presets that need it:
40
+
41
+ ```yaml
42
+ card:
43
+ aspectRatio: 1.5
44
+ sizes: [400, 800, 1200]
45
+ formats: { webp: 80, avif: 65 }
46
+ ```
47
+
48
+ Crops use [Cloudflare gravity coordinates](https://developers.cloudflare.com/images/optimization/features/#gravity--g). Presets without `aspectRatio` preserve the full image. Focus changes automatically queue new immutable variant keys when cropping is configured; current variants stay available until the complete new set is ready. Unrelated metadata edits do not rebuild images. The reserved `sandcms-preview` preset supplies an uncropped WebP for the picker on raster files with a focus field.
49
+
50
+ Existing project-owned blueprints/configuration are preserved during upgrades: add the field and ratio explicitly, deploy the protocol-5 Worker first with `sandcms worker update`, then deploy the website and run `sandcms media rebuild` to prepare existing files and previews. Protocol 5 accepts older protocol-3/4 website requests; new website processes reject older Workers. No database migration is required.
26
51
 
27
52
  ## Privacy and publication
28
53
 
@@ -51,7 +76,7 @@ The component needs no URL configuration. `SANDCMS_WORKER_URL` (falling back to
51
76
 
52
77
  ```svelte
53
78
  <script lang="ts">
54
- import { Image } from '@sandquist-group/sandcms';
79
+ import { Image } from 'sandcms';
55
80
  let { data } = $props();
56
81
  </script>
57
82
 
@@ -88,7 +113,7 @@ and adds no styling or admin dependencies. Consumers control layout with their o
88
113
 
89
114
  ## Processing and rebuild
90
115
 
91
- Uploads enter a temporary SQLite blob spool, then a job sends the original to R2 and removes the spool. Jobs have durable attempts, bounded leases, retry delays, and failure state. Restarting the website resumes pending/expired jobs. The media library shows processing/ready/failed and permits retries. An asset's old active set remains available throughout a rebuild.
116
+ The authenticated CMS initializes a metadata-only upload session and returns a 15-minute S3 presigned PUT URL for a private `incoming/<asset>/<attempt>` object. The browser sends the file directly to R2, then calls the idempotent completion endpoint. A durable job verifies the actual object size and MIME type, validates a separate private snapshot (or sanitizes SVG), and conditionally creates the original before queuing variants. Reusing the PUT URL cannot overwrite an accepted original. New uploads never enter SQLite as BLOBs. Existing BLOB uploads from older releases continue through the legacy runner and are removed after successful transfer. Interrupted browser transfers require the file to be sent again. Unfinished sessions expire after 15 minutes; the runner deletes their staging objects and marks the asset failed. Finalization failures retain staging for retries. Configure a one-day `incoming/` lifecycle rule to remove abandoned objects, including objects recreated using an unexpired PUT URL. Completion retries do not transfer the file again. Jobs have durable attempts, bounded leases, retry delays, and failure state. Restarting the website resumes pending/expired jobs. The media library shows processing/ready/failed and permits retries. An asset's old active set remains available throughout a rebuild.
92
117
 
93
118
  ```sh
94
119
  bun x --no-install sandcms media rebuild
@@ -98,8 +123,12 @@ Rebuild compares the current preset hash, schedules missing sets, shows progress
98
123
 
99
124
  Editable asset fields come from file blueprints. If a blueprint declares a photographer relation, it references that field’s configured collection. Publish a photographer's rename to update public credits; deletion clears the credit. Deletion displays known draft/published usages and allows confirmation without additional permission escalation.
100
125
 
126
+ Deletion clears draft/published references and revokes active variants immediately, then records cleanup in the durable `media_deletions` queue. Assets remain `deleting` until storage cleanup succeeds. Cleanup waits for active uploads and transformations to finish or their leases to expire; processing cannot restore the asset or schedule more work. Storage failures retry automatically, including after a website restart. The library polls pending deletions and excludes them from image pickers.
127
+
128
+ The Worker keeps a small permanent `deleted/<asset>` marker to reject late requests and remove writes that raced with deletion. Keep this prefix private and do not expire its markers. An unexpired presigned PUT can still recreate an incoming staging object, so retain the one-day `incoming/` lifecycle rule; that object cannot be promoted to an original. Deploy the updated Worker before the website, as described in [upgrades](upgrades.md#durable-media-deletion).
129
+
101
130
  ## Bulk uploads and galleries
102
131
 
103
- The library and multi-image pickers accept multiple files in one selection. Files upload sequentially through the existing bounded per-file endpoint, in selection order. Progress counts completed attempts; errors name each failed file, and later files still upload. Successful uploads remain available when another file fails. Select failed files again to retry an upload; use the library's processing retry for files already accepted by the server.
132
+ The library and multi-image pickers accept multiple files in one selection. Files upload sequentially directly to private R2 staging, in selection order. The CMS receives only metadata and completion requests. Progress counts completed attempts; errors name each failed file, and later files still upload. Successful uploads remain available when another file fails. The browser retains failed files for transfer retries; use the library's processing retry for files already accepted by the server.
104
133
 
105
134
  Use a `gallery` field for ordered images. Its file blueprint defines available metadata; `overrides` explicitly enables per-placement editing of selected fields. A gallery without overrides displays images and ordering controls only. See [gallery configuration](content.md#galleries-and-project-specific-metadata). Both galleries and `media-list` fields support drag handles and arrow controls for ordering.
package/docs/package.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Installation and packaging
2
2
 
3
- `@sandquist-group/sandcms` is a private package in the paid `sandquist-group` npm organization. It includes the CMS runtime, admin UI, `sandcms` terminal command, required route templates, and a minimal SvelteKit starter. There is no separate starter package.
3
+ `sandcms` is the npm package. It includes the CMS runtime, admin UI, `sandcms` terminal command, required route templates, and a minimal SvelteKit starter. There is no separate starter package.
4
4
 
5
5
  ## Publish from macOS
6
6
 
@@ -17,13 +17,13 @@ npm pack --dry-run
17
17
  npm pack --pack-destination /tmp
18
18
  ```
19
19
 
20
- This release produces `/tmp/sandquist-group-sandcms-0.5.1.tgz`. `npm pack` builds the package through `prepack`; it packages only the allowlisted distribution, templates, documentation, and package metadata. The repository's example website, tests, databases, and environment files are excluded. `release:check` checks types, runs unit tests, inspects an npm archive, and installs/builds that archive in both a fresh starter and an existing SvelteKit site.
20
+ This release produces `/tmp/sandcms-0.6.0.tgz`. `npm pack` builds the package through `prepack`; it packages only the allowlisted distribution, templates, documentation, and package metadata. The repository's example website, tests, databases, and environment files are excluded. `release:check` checks types, runs unit tests, inspects an npm archive, and installs/builds that archive in both a fresh starter and an existing SvelteKit site.
21
21
 
22
22
  Upload the archive you just built:
23
23
 
24
24
  ```sh
25
- npm publish /tmp/sandquist-group-sandcms-0.5.1.tgz --access restricted --registry=https://registry.npmjs.org/
26
- npm view @sandquist-group/sandcms@0.5.1 version --registry=https://registry.npmjs.org/
25
+ npm publish /tmp/sandcms-0.6.0.tgz --access restricted --registry=https://registry.npmjs.org/
26
+ npm view sandcms@0.6.0 version --registry=https://registry.npmjs.org/
27
27
  ```
28
28
 
29
29
  Complete npm's authentication/2FA prompts. The logged-in account must have publishing permission in `sandquist-group`. The package also defaults to restricted access and the npmjs registry in `publishConfig`. Do not set `private: true` on this package: that prevents publication entirely. Generated websites do set it.
@@ -36,13 +36,15 @@ After publishing, authenticate as a user with read access to the package, then r
36
36
 
37
37
  ```sh
38
38
  npm login --registry=https://registry.npmjs.org/
39
- bunx --bun --package @sandquist-group/sandcms@0.5.1 sandcms setup --cwd ./my-site
39
+ bunx --bun --package sandcms@0.6.0 sandcms setup --cwd ./my-site
40
40
  cd my-site
41
41
  bun run dev
42
42
  ```
43
43
 
44
44
  Setup asks for the project name and initial local admin email. The generated site includes a minimal public home page, `/admin/[...path]`, `/api/cms/[...path]`, the server hook/integration, YAML blueprints, and a local database. [Cloudflare media setup](cloudflare.md) is optional. This is a Bun application; Node alone cannot run the CMS.
45
45
 
46
+ Setup also adds commented `SANDCMS_TRUSTED_PROXY_HEADER=cf-connecting-ip` and `ADDRESS_HEADER=cf-connecting-ip` examples to `.env.local`. They stay disabled for local development. For Dokploy behind Cloudflare, secure origin ingress, copy both settings into the application's Dokploy runtime variables, and redeploy; follow the [client IP setup and staging check](deployment.md#client-ip-behind-dokploy-and-cloudflare). Rerunning setup adds missing examples without duplicating existing ones or overwriting configured proxy settings.
47
+
46
48
  For an existing SvelteKit project, run the same setup command with `--cwd` pointing to that project and review `sandcms/setup-report.md`. Inside an installed project, use the local CLI:
47
49
 
48
50
  ```sh
package/docs/releases.md CHANGED
@@ -1,5 +1,60 @@
1
1
  # Release notes
2
2
 
3
+ ## 0.6.0
4
+
5
+ This minor release adds new content editing and media capabilities and changes framework requirements and API contracts. Before upgrading from 0.5.x, review the [0.6.0 upgrade checklist](upgrades.md#060-upgrade-checklist): migrate developer-owned SvelteKit configuration, deploy the protocol-5 Worker and configure direct R2 uploads, then apply retained migrations `0001` through `0006` before restarting the website. Supported accounts, content, and media are preserved; project-owned YAML and customized application files remain protected.
6
+
7
+ Adds shared admin search for pages, saved draft content, collections, and media. The header search supports Cmd/Ctrl+K and keyboard navigation; media search is also available in the selector and preserves its file blueprint/type restrictions. Search reads existing records without a schema migration or project YAML changes. See [admin search](content.md#admin-search).
8
+
9
+ Adds **Duplicate** to collection rows and **Duplicate entry** to saved collection editors. Copies the latest saved draft into a new unpublished entry, preserving nested and hidden content and reusing media and relations. Copies receive a text-title suffix and a slug unused by both draft and published snapshots. Pending editor changes must be saved first; stale source versions are rejected. The authenticated `content/duplicate` API supports write keys and transactional retry protection. No schema migration or project-owned YAML changes are required. See [duplicate entries](content.md#duplicate-entries).
10
+
11
+ Adds conditional blueprint fields with `when: { linkType: external }`. Admin controls update as sibling values change; hidden fields and their descendants skip required validation while retained values still receive normal validation. Supports nested rows, file metadata, and effective gallery overrides. Existing project YAML and stored values are preserved; no database migration is required. See [conditional fields](content.md#conditional-fields).
12
+
13
+ Adds reusable field definitions with `extends: fields/seo`. Shared files under `blueprints/fields` support chained and nested inheritance, local overrides, and validation for all blueprint kinds. Starter and demo project SEO groups now use a shared definition. Existing inline definitions and stored content remain compatible; project-owned YAML is preserved and no database migration is needed. See [reusable field definitions](content.md#reusable-field-definitions).
14
+
15
+ Adds optional blueprint editor layouts with `tabs`, columns, sections, and field `width`. Tabs show validation error counts and open the first tab with errors. Stored field keys, payloads, public forms, and database schemas are unchanged; existing blueprints keep their flat editor. See [editor layouts](content.md#editor-layouts).
16
+
17
+ Adds a `link` field with URL, internal entry, file, email, and phone destinations, optional link text and new-tab behavior. Entry/file links participate in reference validation and deletion cleanup. `cms.resolveLink` resolves published entry routes and public media renditions. Demo and starter home blueprints include an optional call to action; existing project-owned YAML is preserved. No database migration is required. See [Link fields](content.md#link-fields).
18
+
19
+ Adds image focal points as shared file-blueprint metadata (`type: focus`), with a mouse/touch/keyboard picker and reset. Optional preset `aspectRatio` enables crops that respect the point through Cloudflare gravity. Focus edits rebuild immutable variants while retaining the active set until completion. Deploy the protocol-5 Worker before the website; it accepts protocols 3 and 4. Add focus/ratios to existing project-owned YAML explicitly and run `sandcms media rebuild`. Existing metadata and migrations are preserved; no SQL migration is required. See [media focal points](media.md#focal-points).
20
+
21
+ - Validate empty field values against their declared types so malformed rich text cannot be saved or published. Failed publication preserves the live snapshot.
22
+ - Require the current document version when unpublishing from the editor or API, preventing a stale editor from silently overwriting another session's draft. Successful unpublish preserves local unsaved edits.
23
+ - Persist media deletion, wait for active processing, and retry storage cleanup after failures or restarts. Worker deletion markers prevent late writes from recreating originals or variants. Deploy the updated Worker and apply `0006_durable_media_deletion.sql` before restarting the website; see [upgrades](upgrades.md#durable-media-deletion).
24
+ - Add blueprint field helpers: `help`, `placeholder`, `before`/`after`, and live text `counter` with `minLength`/`maxLength` validation. Supports nested editors and file metadata. No database migration is required; project-owned YAML remains preserved. See [field helpers](content.md#field-helpers).
25
+ - Document the Dokploy/Cloudflare client-IP recipe and add optional CMS/adapter proxy header settings to `.env.example` and commented examples to the `.env.local` generated by setup. Existing sites must configure both runtime settings after securing ingress, then verify form addresses on staging.
26
+ - Use the adapter client address consistently when a configured CMS proxy header is missing or empty. `doctor` warns for HTTPS origins without a CMS proxy header.
27
+
28
+ Agent API replay receipts now expire after 48 hours and are pruned on content writes. Apply `0005_api_retention_and_pagination.sql` to add the cleanup and pagination indexes; it preserves existing receipts and content. Content/media list responses now use `{items, nextCursor}` with limits of 100 by default and 500 maximum. Administrators can review and revoke all owners' keys, with prefix and last-use details. Write keys default to 7 days, read keys to 30. Successful browser password changes revoke keys and audit the count, matching emailed reset recovery. Upload initialization explicitly rejects `Idempotency-Key` because it is not retry-safe. See the [agent API contract](api.md).
29
+
30
+ Adds Better Auth API keys for agent access to content and media, schema/draft discovery, and transactional `Idempotency-Key` protection for content writes. Administrators create expiring read/write keys under Account & security and revoke them there. Browser origin checks and session-only user/form management remain enforced. Recovery revokes keys. Apply `0004_agent_api_keys.sql` before restarting; existing rows and released migrations are preserved. See the [agent API](api.md).
31
+
32
+ Upgrades the application and generated starters to SvelteKit 3.0.0, `@sveltejs/package` 3.0.0, and the official Bun adapter 1.0.0. Configuration lives in Vite, library imports use `#lib`, and TypeScript extends `$app/tsconfig`. Existing sites must migrate developer-owned configuration before applying integrations; see [SvelteKit 3 upgrades](upgrades.md#sveltekit-3). Admin links disable speculative data loading so hovering singleton editors does not create drafts. No database migration is required.
33
+
34
+ Admin uploads now use metadata initialization, a 15-minute presigned PUT directly from the browser to private R2 staging, and idempotent completion. The website no longer buffers file bodies or stores new originals in SQLite. Durable finalization validates a private snapshot, preserves retry/restart recovery, and prevents a reused upload URL from replacing an accepted original.
35
+
36
+ Run the retained `0003_direct_r2_uploads.sql` migration; it preserves existing media and pending legacy BLOB transfers. Deploy the protocol-4 Worker first (it also accepts protocol 3), configure bucket-scoped R2 signing credentials, PUT CORS for the admin origin, and a one-day `incoming/` lifecycle rule before deploying the website. The local Worker now uses `sandcms/worker/local.ts`. See [Cloudflare configuration](cloudflare.md#direct-upload-configuration).
37
+
38
+ Fixes large raster uploads failing with “file too large” during dimension inspection. Upload validation and legacy-original rebuilds now use remote JSON metadata transforms instead of `IMAGES.info()`. New originals retain their dimensions in R2 metadata for variant generation. The 100 MB / 100 MP limits and private originals remain unchanged. Deploy with `sandcms worker update`; the `IMAGES` binding is no longer required.
39
+
40
+ Adds safe email failure reasons to invitations and form notifications, with actionable admin messages and “Accepted by mail server” labels. Password-reset responses retain their account privacy. SMTP deployment guidance recommends port 587 with STARTTLS on Hetzner Cloud. No automatic retries are added.
41
+
42
+ Apply the retained `0002_email_failure_reason.sql` migration following the [upgrade workflow](upgrades.md). It adds a nullable access-link failure reason and preserves existing records. Existing notification JSON remains readable; historical failures have no detailed reason. Project-owned configuration needs no changes.
43
+
44
+ Form submissions now return after storage without waiting for automatic email notifications. Notification errors cannot reject a saved submission. Email sends are limited to two at a time per email service across workflows and adapters. Notifications remain best effort: pending sends can be lost on shutdown or deployment, with manual resend available in the inbox. No schema change or migration is required.
45
+
46
+ Password reset requests now create independent links valid for 15 minutes, with at most three active links per email. New requests preserve existing links; a successful reset removes them all. Existing request limits remain in place. Apply the retained `0001_independent_password_resets.sql` migration before restarting the website. It preserves existing links and their original expiration times, and keeps invitation resend behavior unchanged.
47
+
48
+ ## 0.5.3
49
+
50
+ Adds collapsible blueprint navigation groups to the admin sidebar.
51
+
52
+ - Groups page blueprints under **Pages** by default. Other blueprint kinds remain at the top level.
53
+ - Supports custom groups through `navigation.group` and top-level links through `navigation: { group: false }`.
54
+ - Opens the active blueprint’s group automatically and supports mouse and keyboard toggling.
55
+
56
+ Existing project-owned YAML is preserved and needs no changes. Public URLs, blueprint IDs, and stored content are unchanged. There is no database schema change or new migration in 0.5.3. See [sidebar configuration](content.md#sidebar-groups) and the [upgrade workflow](upgrades.md).
57
+
3
58
  ## 0.5.1
4
59
 
5
60
  Raises raster upload support to 100 MB and image dimensions to 100 MP, with variant encoding through remote Cloudflare image transformations.
@@ -9,7 +64,7 @@ Raises raster upload support to 100 MB and image dimensions to 100 MP, with vari
9
64
  - Versions rebuilt media variants so existing published variants remain available until their replacements are ready.
10
65
  - Keeps SVG uploads limited to 1 MB and encoded variants to 20 MB.
11
66
 
12
- Upgrade the website and protocol-3 media Worker together; older protocol combinations are incompatible. Enable Cloudflare image transformations, retain the `MEDIA` and `IMAGES` bindings and the shared CMS/Worker token, and verify the deployed processing flow in staging. See [media deployment](cloudflare.md).
67
+ Upgrade the website and protocol-3 media Worker together; older protocol combinations are incompatible. Enable Cloudflare image transformations, retain the `MEDIA` binding and the shared CMS/Worker token, and verify the deployed processing flow in staging. See [media deployment](cloudflare.md).
13
68
 
14
69
  The default and maximum `media.uploadLimit` are now `100000000` bytes. Existing project-owned YAML limits are preserved; edit `sandcms/config.yaml` to opt into 100 MB. Set `BODY_SIZE_LIMIT=101M` for the Bun adapter and allow multipart overhead in upstream proxies. Run `sandcms media rebuild` to regenerate existing assets with the new processing version.
15
70
 
package/docs/upgrades.md CHANGED
@@ -1,10 +1,62 @@
1
1
  # Updates and generated files
2
2
 
3
+ ## 0.6.0 upgrade checklist
4
+
5
+ Version 0.6.0 requires SvelteKit 3 and includes retained database migrations `0001` through `0006`. Follow this order when upgrading from 0.5.x:
6
+
7
+ 1. Stop website and job processes and take a verified backup with the installed package.
8
+ 2. Install `sandcms@0.6.0` and migrate developer-owned configuration using the [SvelteKit 3 instructions](#sveltekit-3). Review `sandcms upgrade --check` and merge integration changes into customized files.
9
+ 3. Deploy the protocol-5 Worker with `sandcms worker update`. Configure R2 signing credentials, bucket PUT CORS, and the one-day `incoming/` lifecycle rule for [direct uploads](cloudflare.md#direct-upload-configuration). Preserve the private `deleted/` prefix indefinitely for [durable deletion](#durable-media-deletion).
10
+ 4. Review `sandcms migrate --check`, apply integration updates with `sandcms upgrade`, then run `sandcms migrate`. Only pending migrations are applied; supported existing data is preserved.
11
+ 5. Rebuild and restart the website. Verify sign-in, editing, uploads, deletion, and form submissions on staging. Update custom API clients for paginated `{items, nextCursor}` list responses and the required document `version` on unpublish.
12
+
13
+ Blueprint features and focal-point cropping are opt-in for existing project-owned YAML. Review the feature instructions below before changing it. Rollback requires the matching old package and its verified backup; no down migrations or automatic database reset are provided.
14
+
15
+ ## Durable media deletion
16
+
17
+ Deploy the updated media Worker first using `sandcms worker update`; it speaks protocol 5, still accepts protocol 3 and 4 website processes, and adds permanent deletion markers to prevent late writes from recreating removed assets. Preserve the private `deleted/` prefix indefinitely and retain the one-day `incoming/` lifecycle rule. Apply `0006_durable_media_deletion.sql` using the retained migration workflow below before restarting the updated website. It adds a deletion queue and preserves existing assets, pending jobs, accounts, content, and YAML. Deletion now revokes references and active variants immediately and may finish storage cleanup asynchronously.
18
+
19
+ Customized browser clients must include the current integer document `version` when calling `content/unpublish`, and server code calling `cms.content.unpublish(id, version)` must pass it too. Stale requests return 409; reload the document before continuing. Provided empty field values now undergo type validation, including rich text, numbers, booleans, and groups. Correct malformed stored drafts before publishing; existing published snapshots remain unchanged when validation fails.
20
+
21
+ ## Image focal points
22
+
23
+ The media Worker protocol is now **5**; it still accepts protocol 3 and 4 website processes. Deploy it with `sandcms worker update` before the website (one Worker update also covers durable media deletion above). No SQL migration is required. Focal points and cropping are opt-in: project-owned YAML is not changed by upgrades, so add `focus: { type: focus }` to file blueprints and `aspectRatio` to presets explicitly, then run `sandcms media rebuild`. Presets without `aspectRatio` keep full-image variants. See [focal points](media.md#focal-points).
24
+
25
+ ## SvelteKit 3
26
+
27
+ This package now requires SvelteKit 3.0.0 and Svelte 5.57.1 or later. Follow the [official migration guide](https://svelte.dev/docs/kit/migrating-to-sveltekit-3) before updating generated integrations. Pin `@sveltejs/kit` to `3.0.0` and replace the community Bun adapter with `@sveltejs/adapter-bun` `1.0.0`. TypeScript 6, Vite 8.0.12 or later, and vite-plugin-svelte 7 are required.
28
+
29
+ Move the adapter and preprocessing from `svelte.config.js` into `sveltekit({ adapter: adapter(), preprocess: vitePreprocess(), paths: { origin: process.env.SANDCMS_ORIGIN } })` in `vite.config.ts`, then remove the old Svelte configuration. Provide `SANDCMS_ORIGIN` during the production build. The official Bun adapter does not read `ORIGIN`; if the public origin must vary at runtime, omit `paths.origin` and configure trusted `PROTOCOL_HEADER` and `HOST_HEADER` values at your reverse proxy. For local HTTP production previews, use `PROTOCOL_HEADER=x-forwarded-proto` and send `x-forwarded-proto: http` on every request; absent headers default to HTTPS.
30
+
31
+ Add `"imports": { "#lib": "./src/lib/index.ts", "#lib/*": "./src/lib/*" }` to the application's package.json. Replace `$lib` imports with `#lib` and explicit file extensions, including `/index.js` for directories. Extend `$app/tsconfig` and include `src`, tests, and root configuration files in tsconfig.json. If overriding `compilerOptions.types`, include `$app/types`. Replace `$app/environment` with `$app/env`; navigation refreshes now use `refreshAll`. The generated Bun server integration reads runtime settings from `process.env` in place of `$env/dynamic/private`; merge that change into customized integrations.
32
+
33
+ Setup and upgrade preserve developer-owned configuration and customized integration files. Review their reports and merge these changes yourself. Rebuild and verify sign-in, navigation, uploads, and form submissions. This framework upgrade adds no SQL migration and preserves supported databases.
34
+
35
+ ## Agent API keys
36
+
37
+ Apply the retained `0004_agent_api_keys.sql` and `0005_api_retention_and_pagination.sql` migrations before restarting the updated website. They add Better Auth key storage, content retry receipts, and cleanup/pagination indexes without changing existing accounts, documents, media, or YAML. Existing retry responses become ineligible after 48 hours and are pruned on subsequent successful content writes. The 0.6.0 list API now returns `{items, nextCursor}` instead of arrays. No new configuration is required. Administrators provision keys under Account & security after normal sign-in; existing accounts receive no keys automatically. Customized integrations must use the package's current `cmsHandle` and `apiHandler` to enable key authentication while retaining browser origin protections. See the [agent API](api.md).
38
+
39
+ ## Independent password reset links
40
+
41
+ Apply `0001_independent_password_resets.sql` using the retained migration workflow below before restarting the updated website. The migration changes indexes only: existing accounts, invitations, and reset links retain their data. Existing reset links keep their original expiration times; newly issued links last 15 minutes. Up to three links may be active for an email, and newer requests never evict usable links. Invitation resend still replaces its previous link.
42
+
43
+ ## Blueprint editor layouts
44
+
45
+ Optional `tabs` and field `width` settings organize the admin editor without changing stored field keys, payloads, public forms, or database schemas. Existing blueprints retain their flat editor. Update developer-owned YAML explicitly; upgrades do not add layouts to customized blueprints. Top-level form `columns` still configure submission tables. See [editor layouts](content.md#editor-layouts).
46
+
47
+ ## 0.5.3: sidebar grouping
48
+
49
+ Page blueprints now default to a collapsible Pages sidebar group. Existing YAML needs no changes or database migration. Set `navigation: { group: false }` to retain a top-level link, or use a group label to organize content. Customized YAML remains developer-owned; see [sidebar groups](content.md#sidebar-groups).
50
+
51
+ ## Large-upload inspection fix
52
+
53
+ Run `sandcms worker update` to replace Images binding inspection with remote JSON metadata transforms. Protocol 3 and existing originals/variants remain compatible; no database migration is needed. Existing project-owned Wrangler files may retain the unused `IMAGES` binding. Verify a real 100 MB upload in staging, including metadata inspection and variant generation.
54
+
3
55
  ## 0.5.1: 100 MB / 100 MP media processing
4
56
 
5
- Deploy the protocol-3 media Worker and website together; older protocol combinations fail clearly. Raster encoding now uses remote transformations and private, five-minute signed source URLs. Keep the `MEDIA` and `IMAGES` bindings (Images is still used for dimension inspection) and the same CMS/Worker token. Enable Cloudflare image transformations for the Worker’s account and verify the deployed source and transformation flow in staging; local mocks do not prove production limits or caching behavior.
57
+ Deploy the protocol-3 media Worker and website together; older protocol combinations fail clearly. Raster encoding now uses remote transformations and private, five-minute signed source URLs. Keep the `MEDIA` binding (the current Worker no longer requires `IMAGES`) and the same CMS/Worker token. Enable Cloudflare image transformations for the Worker’s account and verify the deployed source and transformation flow in staging; local mocks do not prove production limits or caching behavior.
6
58
 
7
- The default and maximum `media.uploadLimit` are now `100000000`. Existing explicit YAML limits are preserved on installed sites; edit your project-owned `sandcms/config.yaml` to opt into 100 MB. Set the Bun adapter’s `BODY_SIZE_LIMIT=101M` and allow multipart overhead in upstream proxies. SVG remains limited to 1 MB and encoded variants to 20 MB.
59
+ The default and maximum `media.uploadLimit` are now `100000000`. Existing explicit YAML limits are preserved on installed sites; edit your project-owned `sandcms/config.yaml` to opt into 100 MB. Earlier releases required `BODY_SIZE_LIMIT=101M` and multipart overhead in upstream proxies. Direct uploads now bypass the website body limit; its normal JSON limit is sufficient. SVG remains limited to 1 MB and encoded variants to 20 MB.
8
60
 
9
61
  The new processing version gives rebuilt variants new keys; existing published variants remain available until each replacement set is ready. Run `sandcms media rebuild` to regenerate existing assets. No database migration or reset is required. See [media operations](cloudflare.md) for signed-source privacy and deployment checks.
10
62
 
@@ -59,4 +111,8 @@ bun x --no-install sandcms worker update
59
111
 
60
112
  These commands assume a compatible or fresh database. `upgrade --check` validates blueprints, checks recorded ownership and database compatibility, and prints a no-write report. `upgrade` compares generated files with hashes in `sandcms/install.json`. Unmodified generated files receive new templates. Edited files are preserved by default, with a unified diff and an explicit overwrite choice in an interactive terminal. Cancelling a prompt still produces the report without applying file changes. These ownership protections remain in place for upgrades.
61
113
 
62
- Use the matching protocol-3 Worker and website package; incompatible internal requests fail. See [media deployment](media.md). A media preset change requires `media rebuild`; old active variant sets remain live until each new set completes.
114
+ Use the protocol-5 Worker with the 0.6.0 website package; incompatible internal requests fail. See [media deployment](media.md). A media preset change requires `media rebuild`; old active variant sets remain live until each new set completes.
115
+
116
+ ## Direct R2 upload upgrade
117
+
118
+ Back up with the installed package before updating. Deploy the new Worker first; protocol 4 retains compatibility with protocol 3 website processes. Configure its R2 signing secrets, bucket PUT CORS for the admin origin and a one-day `incoming/` lifecycle rule as described in [Cloudflare configuration](cloudflare.md#direct-upload-configuration). Run `sandcms migrate` to append `0003_direct_r2_uploads.sql`, then rebuild and restart the website. The migration adds metadata-only sessions and preserves all media, jobs and pending legacy BLOB uploads. There is no reset or automatic replacement of developer-owned configuration. New browser uploads send bytes directly to R2; the website needs only its normal JSON body limit. Existing host limits can remain in place.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sandcms",
3
- "version": "0.5.2",
3
+ "version": "0.6.0",
4
4
  "scripts": {
5
5
  "dev": "bun run styles && bun --bun vite dev",
6
6
  "build": "bun run validate && bun run styles && bun --bun vite build && bun run package",
@@ -16,7 +16,7 @@
16
16
  "format": "prettier --write .",
17
17
  "dev:init": "bun scripts/dev-init.ts",
18
18
  "test:package": "bun run package && bun scripts/test-package.ts",
19
- "worker:dev": "bun x wrangler dev --config sandcms/worker/wrangler.jsonc --local --port 8787",
19
+ "worker:dev": "bun x wrangler dev sandcms/worker/local.ts --config sandcms/worker/wrangler.jsonc --local --port 8787",
20
20
  "validate": "bun src/lib/cli/index.ts validate",
21
21
  "test:container": "bun scripts/test-container.ts",
22
22
  "preview:network": "bun scripts/preview-network.ts",
@@ -52,17 +52,20 @@
52
52
  "svelte": "./dist/admin/index.js"
53
53
  },
54
54
  "./admin/styles.css": "./dist/admin/generated/admin.css",
55
- "./worker": "./dist/worker/index.js"
55
+ "./worker": "./dist/worker/index.js",
56
+ "./worker/local": {
57
+ "default": "./dist/worker/local.js"
58
+ }
56
59
  },
57
60
  "peerDependencies": {
58
- "svelte": "^5.0.0",
59
- "@sveltejs/kit": "^2.70.3"
61
+ "svelte": "^5.57.1",
62
+ "@sveltejs/kit": "^3.0.0"
60
63
  },
61
64
  "devDependencies": {
62
65
  "@fontsource-variable/geist": "5.3.0",
63
66
  "@playwright/test": "1.63.0",
64
- "@sveltejs/kit": "2.70.3",
65
- "@sveltejs/package": "2.5.8",
67
+ "@sveltejs/kit": "3.0.0",
68
+ "@sveltejs/package": "3.0.0",
66
69
  "@sveltejs/vite-plugin-svelte": "7.3.1",
67
70
  "@tailwindcss/cli": "4.3.3",
68
71
  "@types/nodemailer": "8.0.2",
@@ -75,18 +78,19 @@
75
78
  "shadcn-svelte": "1.7.0",
76
79
  "smtp-server": "3.19.13",
77
80
  "svelte": "5.57.1",
78
- "svelte-adapter-bun": "1.0.1",
79
81
  "svelte-check": "4.7.6",
80
82
  "tailwindcss": "4.3.3",
81
83
  "tw-animate-css": "1.4.0",
82
84
  "typescript": "6.0.3",
83
85
  "vite": "8.3.1",
84
- "wrangler": "4.140.0"
86
+ "wrangler": "4.140.0",
87
+ "@sveltejs/adapter-bun": "1.0.0"
85
88
  },
86
89
  "keywords": [
87
90
  "svelte"
88
91
  ],
89
92
  "dependencies": {
93
+ "@better-auth/api-key": "1.7.6",
90
94
  "@clack/prompts": "1.8.1",
91
95
  "@cloudflare/workers-types": "5.20260925.1",
92
96
  "@internationalized/date": "3.12.4",
@@ -94,6 +98,7 @@
94
98
  "@tiptap/core": "3.31.3",
95
99
  "@tiptap/starter-kit": "3.31.3",
96
100
  "@types/bun": "1.4.2",
101
+ "aws4fetch": "1.0.20",
97
102
  "better-auth": "1.7.6",
98
103
  "bits-ui": "2.19.3",
99
104
  "cn": "0.3.3",
@@ -120,5 +125,9 @@
120
125
  "access": "restricted",
121
126
  "registry": "https://registry.npmjs.org/"
122
127
  },
123
- "license": "PolyForm-Strict-1.0.0"
128
+ "license": "PolyForm-Strict-1.0.0",
129
+ "imports": {
130
+ "#lib": "./src/lib/index.ts",
131
+ "#lib/*": "./src/lib/*"
132
+ }
124
133
  }
@@ -1,4 +1,4 @@
1
- import { building } from '$app/environment';
2
- import { cmsHandle } from '@sandquist-group/sandcms/server';
3
- import { getCMS } from '$lib/server/sandcms';
1
+ import { building } from '$app/env';
2
+ import { cmsHandle } from 'sandcms/server';
3
+ import { getCMS } from '#lib/server/sandcms/index.js';
4
4
  export const handle = cmsHandle(getCMS, building);
@@ -1,5 +1,5 @@
1
- import { env } from '$env/dynamic/private';
2
- import { createCMS, emailOptionsFromEnv, type CMS } from '@sandquist-group/sandcms/server';
1
+ import { createCMS, emailOptionsFromEnv, type CMS } from 'sandcms/server';
2
+ const env = process.env;
3
3
  let instance: CMS;
4
4
  export function getCMS() {
5
5
  if (!instance) {
@@ -1,3 +1,3 @@
1
- import { adminLoad } from '@sandquist-group/sandcms/server';
2
- import { getCMS } from '$lib/server/sandcms';
1
+ import { adminLoad } from 'sandcms/server';
2
+ import { getCMS } from '#lib/server/sandcms/index.js';
3
3
  export const load = (event: import('./$types').PageServerLoadEvent) => adminLoad(getCMS(), event);
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { Admin } from '@sandquist-group/sandcms/admin';
2
+ import { Admin } from 'sandcms/admin';
3
3
  let { data } = $props();
4
4
  </script>
5
5
 
@@ -1,4 +1,4 @@
1
- import { apiHandler } from '@sandquist-group/sandcms/server';
2
- import { getCMS } from '$lib/server/sandcms';
1
+ import { apiHandler } from 'sandcms/server';
2
+ import { getCMS } from '#lib/server/sandcms/index.js';
3
3
  export const GET = (event: import('./$types').RequestEvent) => apiHandler(getCMS(), event);
4
4
  export const POST = GET;
@@ -4,10 +4,22 @@ icon: image
4
4
  kind: collection
5
5
  preview: /projects/{slug}
6
6
  fields:
7
- title: { type: text, required: true }
7
+ title: { type: text, width: 1/2, required: true }
8
8
  slug:
9
- { type: slug, from: title, required: true, description: Used by this website's project route. }
10
- summary: { type: textarea }
9
+ {
10
+ type: slug,
11
+ width: 1/2,
12
+ from: title,
13
+ required: true,
14
+ description: Used by this website's project route.
15
+ }
16
+ summary:
17
+ {
18
+ type: textarea,
19
+ placeholder: A short introduction,
20
+ help: Summarize the project for visitors.,
21
+ counter: true
22
+ }
11
23
  body: { type: richtext, label: Story }
12
24
  photographer: { type: relation, collection: photographers }
13
25
  gallery:
@@ -19,8 +31,4 @@ fields:
19
31
  featured: { type: boolean }
20
32
  date: { type: date }
21
33
  seo:
22
- type: group
23
- label: Search appearance
24
- fields:
25
- title: { type: text }
26
- description: { type: textarea }
34
+ extends: fields/seo
@@ -0,0 +1,5 @@
1
+ type: group
2
+ label: Search appearance
3
+ fields:
4
+ title: { type: text }
5
+ description: { type: textarea }
@@ -3,4 +3,5 @@ kind: file
3
3
  label: Image
4
4
  accept: [image/jpeg, image/png, image/webp, image/avif, image/gif, image/svg+xml]
5
5
  fields:
6
+ focus: { type: focus, label: Focal point }
6
7
  alt: { type: text, label: Alternative text }
@@ -1,9 +1,12 @@
1
1
  id: home
2
2
  label: Home
3
3
  kind: page
4
+ navigation:
5
+ group: Pages
4
6
  preview: /
5
7
  fields:
6
8
  title: { type: text, required: true }
7
9
  intro: { type: textarea, label: Introduction }
8
10
  body: { type: richtext }
9
11
  hero: { type: media, label: Hero image }
12
+ cta: { type: link, label: Call to action }
@@ -5,6 +5,7 @@ media:
5
5
  uploadLimit: 100000000 # At most 100 MB; originals always remain private.
6
6
  presets:
7
7
  card:
8
+ # aspectRatio: 1.5 # Optional width/height crop ratio; respects file focus metadata.
8
9
  sizes: [400, 800, 1200]
9
10
  formats: { webp: 80 }
10
11
  hero:
@@ -1 +1 @@
1
- export { default } from '@sandquist-group/sandcms/worker';
1
+ export { default } from 'sandcms/worker';
@@ -0,0 +1 @@
1
+ export { default } from 'sandcms/worker/local';
@@ -2,6 +2,5 @@
2
2
  "name": "sandcms-local-media",
3
3
  "main": "index.ts",
4
4
  "compatibility_date": "2026-09-25",
5
- "r2_buckets": [{ "binding": "MEDIA", "bucket_name": "sandcms-local-media" }],
6
- "images": { "binding": "IMAGES" }
5
+ "r2_buckets": [{ "binding": "MEDIA", "bucket_name": "sandcms-local-media" }]
7
6
  }