@sudajs/cli 0.10.1 → 0.10.3

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.10.1",
3
+ "version": "0.10.3",
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": "2.5.0"
37
+ "@sudajs/theme-engine": "2.6.1"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@tailwindcss/postcss": "^4.3.0",
@@ -9,6 +9,7 @@ Your job in a theme project is to create a complete, publishable theme with them
9
9
  - Keep `renderMode: "ssr"` in `src/manifest.ts`.
10
10
  - Keep source entries at `src/index.tsx`, `src/runtime.client.ts`, and `src/styles.css`.
11
11
  - Export a complete `ThemeModule` from `src/index.tsx`: `manifest`, `pageConfig`, `layoutConfig`, `defaultLayout`, and `starterPages`.
12
+ - Starter page slugs preview at site-like root routes in `suda theme dev`: `home` is `/home`, `contact-us` is `/contact-us`. Do not use `/pages/...` as a preview route prefix.
12
13
  - Keep `pageConfig` focused on page content sections. Keep `layoutConfig` focused on shared site chrome such as root, header, page outlet, and footer.
13
14
  - Do not edit generated files under `dist/`; run `pnpm build` to regenerate them.
14
15
  - React, React DOM, Puck, and `@sudajs/theme-engine` are host-provided peers. Do not bundle private copies into the theme runtime.
@@ -106,6 +107,37 @@ Use the most specific field type available. A generic `text` field may pass type
106
107
  - Use Puck `resolveFields` only for heavier dynamic field changes that cannot be expressed with `visibleIf`.
107
108
  - Add field-level `ai.instructions`, `ai.required`, `ai.exclude`, `ai.stream`, or `ai.bind` when a prop needs generation guidance beyond its label and type. Use `ai.stream: false` for atomic values such as URLs that should not stream partially.
108
109
 
110
+ ## Contact form contract
111
+
112
+ Themes must render the host-provided contact form from `metadata.contactForm`
113
+ when they offer a contact section. The platform owns field metadata,
114
+ validation, submissions, notifications, webhooks, permissions, and limits; the
115
+ theme owns the public UI only.
116
+
117
+ - Read the form through `getContactForm(puck?.metadata)` from
118
+ `@sudajs/theme-engine/runtime`.
119
+ - `suda theme dev` passes a default contact form through `metadata.contactForm`
120
+ so contact sections can be developed and previewed locally without a project.
121
+ - If there is no valid, enabled form configuration, render nothing for the form
122
+ area; do not show a public "contact form unavailable" fallback panel.
123
+ - Style all five supported field types: `text`, `textarea`, `checkbox`,
124
+ `radio`, and `select`.
125
+ - Style labels, inputs, submit button, success state, validation errors, and
126
+ responsive layout in the theme's visual language.
127
+ - Only render placeholders supplied by the form setting. Do not invent default
128
+ placeholder text for any field type, including the empty option in `select`.
129
+ - Submit to `contactForm.endpoint` with the field values; never hardcode
130
+ notification channels, webhook URLs, ICP records, or white-label branding in
131
+ the contact section.
132
+ - Include hidden platform fields, including the honeypot field
133
+ `name={contactForm.honeypotField}`, as bare `<input type="hidden" />`
134
+ elements. Do not wrap any hidden field in an element, label, layout row, grid
135
+ item, or visual field component; future hidden tokens must follow the same
136
+ rule so they cannot disturb the theme's form layout.
137
+ - Keep contact form layout accessible: every field has a label, keyboard focus
138
+ is visible, checkbox/radio options are grouped clearly, and error messages
139
+ are readable on mobile.
140
+
109
141
  ## AI metadata
110
142
 
111
143
  Every page component and layout component must declare useful `ai.instructions`. Missing component-level instructions fail `suda theme check` and block publish.