@sudajs/cli 0.13.0 → 0.13.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sudajs/cli",
3
- "version": "0.13.0",
3
+ "version": "0.13.1",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "suda": "./bin/suda.js"
@@ -34,7 +34,7 @@
34
34
  "react": "^19.2.7",
35
35
  "react-dom": "^19.2.7",
36
36
  "zod": "^3.24.1",
37
- "@sudajs/theme-engine": "5.1.0"
37
+ "@sudajs/theme-engine": "5.1.1"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@tailwindcss/postcss": "^4.3.0",
@@ -288,6 +288,32 @@ or AI examples.
288
288
  - React, React DOM, Puck, and `@sudajs/theme-engine` are host-provided peers. Do not bundle private copies into the theme runtime.
289
289
  - Keep persisted props JSON-serializable. Do not store functions, React nodes, class instances, database ids for media, or environment-specific absolute filesystem paths.
290
290
 
291
+ ## Puck editor CSS isolation
292
+
293
+ Puck renders the editable preview in a same-origin iframe. The outer
294
+ `#puck-canvas-root` and `#preview-frame` may be only one viewport tall; the
295
+ full page must scroll inside the iframe. Theme CSS must not collapse or disable
296
+ that iframe document.
297
+
298
+ - In editor mode, make the theme root content-height driven. A root marker such
299
+ as `[data-suda-editor="true"]` should use `height: auto`,
300
+ `min-height: 100vh`, and `overflow: visible` unless the theme has a stronger
301
+ reason not to.
302
+ - If the theme root is rendered inside Puck's `#frame-root`, ensure
303
+ `#frame-root` can grow with content in editor mode. Do not leave it stuck at
304
+ a collapsed height when it contains the theme root.
305
+ - Root `[data-puck-dropzone]` wrappers must be able to grow with page content.
306
+ Avoid forcing `height: 100%` on the root DropZone when that turns the page
307
+ into a single viewport-height box.
308
+ - Keep public-site resets from leaking into Puck behavior. Be very careful with
309
+ global `html`, `body`, `iframe`, `.hidden`, `img`, `button`, `input`, and
310
+ Tailwind preflight rules; they can hide editor wrappers, change intrinsic
311
+ media sizing, or break iframe scrolling.
312
+ - When importing third-party CSS, add editor-scoped overrides under the theme
313
+ root marker instead of changing public runtime behavior globally.
314
+ - Verify the editor canvas by scrolling through every starter page. Components
315
+ must be visible and reachable without selecting them from the outline first.
316
+
291
317
  ## CMS and starter templates
292
318
 
293
319
  Suda CMS is a built-in fixed post system. Themes must provide exactly these
@@ -526,7 +552,8 @@ radius, shadows, or spacing.
526
552
 
527
553
  - Tailwind v4 starts in `src/styles.css` with `@import "tailwindcss";` and `@source "./**/*.{ts,tsx}";`.
528
554
  - Theme-local assets live in top-level `assets/`; the CLI copies them to `dist/assets/` during build.
529
- - Use `themeAsset("assets/...")` for theme-bundled assets in default props and starter pages. Do not import images from React code.
555
+ - Import `themeAsset` from `./theme-asset.js` and use `themeAsset("assets/...")` for every theme-bundled asset in default props, starter pages, CMS templates, and AI examples.
556
+ - Do not hand-write `themes/<themeKey>/<version>/...` paths and do not import theme-local images from React code. Full external URLs are allowed, for example CDN URLs such as jsDelivr.
530
557
  - Use `resolveAsset(puck?.metadata, value)` from `@sudajs/theme-engine/runtime` before rendering user-selected media fields.
531
558
  - Scope theme CSS with the generated theme key classes. Avoid global resets that could affect the host editor or other themes.
532
559
  - Preview screenshots are required at `assets/preview/desktop.png`, `assets/preview/tablet.png`, and `assets/preview/mobile.png`; run `suda theme capture` to generate them.
@@ -704,7 +731,7 @@ Starter page data should use the public host component type and a standard array
704
731
  - Do not put local block `id` values in starter pages. Only top-level page components need `props.id`.
705
732
  - Where practical, wrap authored data with `defineSudaPageData(pageConfig, data)` so TypeScript checks top-level component keys and block-slot nested `type` values.
706
733
  - Match starter page content to the theme's intended audience and category. The home page should show the theme's best composition, not just every component in order.
707
- - Use `themeAsset("assets/...")` for bundled starter media.
734
+ - Use `themeAsset("assets/...")` for bundled starter media; never hand-write generated theme asset paths.
708
735
 
709
736
  ## Commands
710
737
 
@@ -1,5 +1,8 @@
1
- import { createThemeAssetResolver } from "@sudajs/theme-engine/runtime";
1
+ import { createThemeAsset } from "@sudajs/theme-engine/runtime";
2
2
 
3
3
  import { sourceManifest } from "./manifest.js";
4
4
 
5
- export const themeAsset = createThemeAssetResolver(sourceManifest.key, __SUDA_THEME_VERSION__);
5
+ export const themeAsset = createThemeAsset({
6
+ ...sourceManifest,
7
+ version: __SUDA_THEME_VERSION__,
8
+ });