@sleekcms/sync 1.4.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/AGENT.md +20 -1
  2. package/package.json +1 -1
package/dist/AGENT.md CHANGED
@@ -57,6 +57,7 @@ Examples:
57
57
  /content/entries/<key+>.json Content for a collection entry (array of objects; <key>+ matches the model filename)
58
58
 
59
59
  /content/images.json Site-level reusable images (handle → shortcut)
60
+ /content/videos.json Site-level videos (handle → embed_url) — READ-ONLY, populated by UI uploads
60
61
  ```
61
62
 
62
63
  > **Tailwind**: Creating `/css/tailwind.css` enables Tailwind. It is compiled and injected automatically — do NOT add it via `link()`.
@@ -268,7 +269,7 @@ Model fields declare both the editor type and the shape expected in content JSON
268
269
  | `datetime` | ISO 8601 string |
269
270
  | `time` | `"HH:mm"` string |
270
271
  | `image` | Either a resolved `{ "url": "...", "alt": "..." }` object, **or** a shortcut string `"<source>:<search>"` (e.g., `"pexels:doctor"`, `"url:https://picsum.photos/200.jpg"`, `"cms:logo"`). Supported sources: `unsplash`, `pexels`, `pixabay`, `iconify`, `url`, `cms` (reuses an image declared in `/images.json` by handle). Append `\|<alt text>` to set the image's alt, e.g. `"pexels:doctor\|Smiling doctor with stethoscope"`. On save, the sync engine resolves the shortcut/link to a full image object automatically. |
271
- | `video` | Object of shape `{ "source": "BUNNY", "video_id": "...", "embed_url": "...", "title": "..." }`. **Do not write or invent this value.** Video uploads are user-driven in the CMS UI — the user uploads to Bunny.net and the sync engine stores the resolved object. In templates, always render videos with the `embed()` helper (e.g. `<%- embed(item.intro_video, { size: '1280x720' }) %>`), never by hand-rolling an iframe. |
272
+ | `video` | Object of shape `{ "source": "BUNNY", "video_id": "...", "embed_url": "...", "title": "..." }`. **Do not write or invent this value.** Video uploads are user-driven in the CMS UI — the user uploads to Bunny.net and the sync engine stores the resolved object. In templates, always render videos with the `embed()` helper (e.g. `<%- embed(item.intro_video, { size: '1280x720' }) %>`), never by hand-rolling an iframe. The site's available video handles are exposed read-only at `/content/videos.json` (`handle → embed_url`) — look them up in templates with `getVideo('<handle>')`. |
272
273
  | `file` | Object of shape `{ "name": "...", "url": "...", "size": 0, "type": "...", "ext": "..." }` describing a downloadable document (PDF, CSV, DOC/DOCX, XLS/XLSX, PPT/PPTX, TSV, TXT — max 10 MB). **Do not write or invent this value.** File uploads are user-driven in the CMS UI — the user attaches the file via the editor and the sync engine stores the resolved object. In templates, render a link with `item.file.url` (download URL on `files.sleekcms.com`) and `item.file.name` (display name), e.g. `<a href="<%= item.brochure.url %>" download><%= item.brochure.name %></a>`. |
273
274
  | `json` | Object or array |
274
275
  | `sheet` | Array of arrays |
@@ -404,6 +405,23 @@ For images used in more than one place (logos, recurring icons, hero art), decla
404
405
 
405
406
  Then reference any of them from any content `image` field with `"cms:<handle>"` (e.g., `"cms:logo"`). The sync engine resolves it to the full image object on save. Templates can also fetch the resolved object directly via `getImage('<handle>')`.
406
407
 
408
+ ### Site videos (`/videos.json`) — READ-ONLY
409
+
410
+ `/content/videos.json` is a flat map of `handle → embed_url` describing every video the user has uploaded to this site via the CMS UI (Bunny.net):
411
+
412
+ ```json
413
+ {
414
+ "intro": "https://iframe.mediadelivery.net/embed/<lib>/<guid>",
415
+ "testimonial-jane": "https://iframe.mediadelivery.net/embed/<lib>/<guid>"
416
+ }
417
+ ```
418
+
419
+ **Do not edit `/content/videos.json`.** It is regenerated from the user's uploads — local edits will not sync and will be overwritten on the next pull. Use it only to discover which video handles are available, then fetch the resolved video object inside templates with `getVideo('<handle>')` and render it via `embed()`:
420
+
421
+ ```ejs
422
+ <%- embed(getVideo('intro'), { size: '1280x720' }) %>
423
+ ```
424
+
407
425
  ---
408
426
 
409
427
  ## EJS Templates
@@ -444,6 +462,7 @@ Page records include: `item._path`, `item._slug` (collections), `item._meta.upda
444
462
  | `getEntry(handle)` | Object \| Array | Entry by handle. Single → object, collection → array |
445
463
  | `getSlugs(path)` | string[] | Slugs under a collection path |
446
464
  | `getImage(name)` | Object \| undefined | Site-level image by handle |
465
+ | `getVideo(name)` | Object \| undefined | Site-level video by handle (handles listed in `/content/videos.json`, read-only) |
447
466
  | `getOptions(name)` | Array \| undefined | Option set as `[{ label, value }]` |
448
467
  | `getContent(query?)` | Any | Full content payload, or filter with JMESPath |
449
468
  | `path(page)` | String | URL path of a page object |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleekcms/sync",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "Edit SleekCMS sites locally — models, content, templates, images — with live two-way sync and AI agent support.",
5
5
  "keywords": [
6
6
  "sleekcms",