@phtngyn/cms 0.2.0-beta.1 → 0.2.0-beta.2

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 (80) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +38 -45
  3. package/package.json +3 -1
  4. package/src/ApplicationTypes.d.ts +7 -5
  5. package/src/{Configuration-CjVUBBwa.js → Configuration-BU-UyGoH.js} +4 -4
  6. package/src/{Configuration-CjVUBBwa.js.map → Configuration-BU-UyGoH.js.map} +1 -1
  7. package/src/Configuration.d.ts +41 -24
  8. package/src/Configuration.js.map +1 -1
  9. package/src/Content.js +1 -1
  10. package/src/{ContentTransfer-CTzGGKFV.js → ContentTransfer-BhF9G56s.js} +2 -2
  11. package/src/{ContentTransfer-CTzGGKFV.js.map → ContentTransfer-BhF9G56s.js.map} +1 -1
  12. package/src/{DocumentEngine-BbhfnTAc.js → DocumentEngine-ClhFXW9M.js} +4 -4
  13. package/src/{DocumentEngine-BbhfnTAc.js.map → DocumentEngine-ClhFXW9M.js.map} +1 -1
  14. package/src/DocumentModel.d.ts +6 -1
  15. package/src/DocumentModel.js +4 -3
  16. package/src/DocumentModel.js.map +1 -1
  17. package/src/{Forms-CfcI3tPU.js → Forms-BbkE7QfC.js} +47 -16
  18. package/src/Forms-BbkE7QfC.js.map +1 -0
  19. package/src/{Forms-02-p8qEw.js → Forms-DoB56hfe.js} +24 -7
  20. package/src/Forms-DoB56hfe.js.map +1 -0
  21. package/src/{Forms-BorTcIlp.d.ts → Forms-R0HoTR-o.d.ts} +30 -9
  22. package/src/Forms.d.ts +16 -15
  23. package/src/Forms.js.map +1 -1
  24. package/src/{I18n-BXlVunfa.d.ts → I18n-zbqpWxki.d.ts} +3 -1
  25. package/src/I18n.d.ts +1 -1
  26. package/src/Module.js +4 -2
  27. package/src/Module.js.map +1 -1
  28. package/src/{S3MediaObjects-DC0c8sYC.js → S3MediaObjects-D5Ns4FM6.js} +14 -12
  29. package/src/S3MediaObjects-D5Ns4FM6.js.map +1 -0
  30. package/src/cli.js +60 -34
  31. package/src/cli.js.map +1 -1
  32. package/src/{connection-BPf4BQUZ.js → connection-D5S9Iph-.js} +2 -2
  33. package/src/{connection-BPf4BQUZ.js.map → connection-D5S9Iph-.js.map} +1 -1
  34. package/src/{dev-lifecycle-vQLxwCFq.js → dev-lifecycle-CZ7iCzG9.js} +129 -42
  35. package/src/dev-lifecycle-CZ7iCzG9.js.map +1 -0
  36. package/src/{installation-DsGst1BH.js → installation-BNuoRDOz.js} +43 -31
  37. package/src/installation-BNuoRDOz.js.map +1 -0
  38. package/src/internal/authoring-catalog.js +2 -2
  39. package/src/internal/authoring-metadata.js +1 -1
  40. package/src/internal/configuration.js +149 -50
  41. package/src/internal/configuration.js.map +1 -1
  42. package/src/internal/dev-lifecycle.js +2 -2
  43. package/src/internal/diagnostics.js +47 -0
  44. package/src/internal/diagnostics.js.map +1 -0
  45. package/src/internal/document-model.js +2 -2
  46. package/src/internal/form-capabilities.js +1 -1
  47. package/src/internal/i18n.js +6 -1
  48. package/src/internal/i18n.js.map +1 -1
  49. package/src/{location-BgYhXEZp.js → location-CPX7oj0o.js} +2 -2
  50. package/src/{location-BgYhXEZp.js.map → location-CPX7oj0o.js.map} +1 -1
  51. package/src/{models-k2nXyD6q.js → models-C9kF9JlQ.js} +2 -2
  52. package/src/{models-k2nXyD6q.js.map → models-C9kF9JlQ.js.map} +1 -1
  53. package/src/{models-DgkGTFus.js → models-ChRxBChy.js} +4 -2
  54. package/src/{models-DgkGTFus.js.map → models-ChRxBChy.js.map} +1 -1
  55. package/src/runtime/delivery/context.js +1 -1
  56. package/src/runtime/delivery/plugin.js +3 -2
  57. package/src/runtime/delivery/plugin.js.map +1 -1
  58. package/src/runtime/forms/document.js +1 -1
  59. package/src/runtime/forms/useCmsForm.js +28 -24
  60. package/src/runtime/forms/useCmsForm.js.map +1 -1
  61. package/src/runtime/i18n/useCmsI18n.d.ts +1 -1
  62. package/src/runtime/installation.js +1 -1
  63. package/src/runtime/plugin.js +12 -4
  64. package/src/runtime/plugin.js.map +1 -1
  65. package/src/runtime/preview/connection.js +1 -1
  66. package/src/runtime/preview/controller.js +2 -2
  67. package/src/runtime/preview/plugin.client.js +3 -3
  68. package/src/runtime/preview/store.js +1 -1
  69. package/src/runtime/sitemap.js +1 -1
  70. package/src/{store-BYgSt7E3.js → store-B49J21NA.js} +3 -3
  71. package/src/{store-BYgSt7E3.js.map → store-B49J21NA.js.map} +1 -1
  72. package/studio/{CreateDocumentDialog-BdiM77bb.js → CreateDocumentDialog-DJ8c0WZb.js} +3 -3
  73. package/studio/{documentPlanning-B7fyUj9r.js → documentPlanning-CDb31mnl.js} +6417 -6358
  74. package/studio/host.css +1 -1
  75. package/studio/host.js +7608 -7250
  76. package/src/Forms-02-p8qEw.js.map +0 -1
  77. package/src/Forms-CfcI3tPU.js.map +0 -1
  78. package/src/S3MediaObjects-DC0c8sYC.js.map +0 -1
  79. package/src/dev-lifecycle-vQLxwCFq.js.map +0 -1
  80. package/src/installation-DsGst1BH.js.map +0 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,13 @@
1
+ # Changelog
2
+
3
+ ## 0.2.0-beta.2
4
+
5
+ This beta replaces the earlier installation and form interfaces directly.
6
+
7
+ - Runtime installation: move database URLs, origins, authentication secrets, initialization tokens, and S3 connection values out of `cms.config.ts` and into Nuxt `runtimeConfig.cms` / `NUXT_CMS_*`. Keep only the PostgreSQL schema and S3 prefix under `installation`. Rebuild once; no database migration, content import, or reset is required.
8
+ - CLI: `cms dev` now loads `<root>/.env`, supports `--root`, `--env-file`, `--verbose`, and `--json`, and reports stable phase diagnostics. No data operation is required.
9
+ - Forms: handlers must return `accepted`, `invalid`, or `unavailable`; `void` is no longer accepted. The handler receives request metadata. Replace `field()` and nested controller refs with `control()` / `visibleControls` and plain reactive properties. Rebuild the application; no stored form migration is required.
10
+ - Generated types: Nuxt renderers should import named `CmsFormDefinition<'form-name'>` from `#cms/types` and use the auto-imported `useCmsForm`. Regenerate Nuxt types with `nuxt prepare` or a normal build.
11
+ - Collection fields: `field(schema, { default })` replaces routine `Schema.withDecodingDefaultKey(Effect.succeed(...))` plumbing. Existing advanced Effect schemas remain valid. No data operation is required.
12
+ - Locale metadata: `i18n.siteConfig` chooses `documents` (default) or `localized-routes`. Studio groups locale variants and can create blank or copied independent translations. No database migration or content rewrite is required.
13
+ - Studio density: Overview previews are visibility-gated and serialized; the form builder edits one selected step at a time. Rebuild to update the embedded Studio.
package/README.md CHANGED
@@ -24,7 +24,7 @@ export default defineNuxtConfig({
24
24
 
25
25
  ## Configure
26
26
 
27
- Create a PostgreSQL database and an S3-compatible bucket. The database user must be able to create and migrate CMS tables. Storage credentials need bucket access and object read, write, copy, list, and delete permissions. Configure public reads through your bucket or CDN and use that URL as `publicBaseUrl`; the module does not configure public access policies.
27
+ Create a PostgreSQL database and an S3-compatible bucket. The database user must be able to create and migrate CMS tables. Storage credentials need bucket access and object read, write, copy, list, and delete permissions. Configure public reads through your bucket or CDN; the module does not configure public access policies.
28
28
 
29
29
  Create `cms.config.ts` beside `nuxt.config.ts`:
30
30
 
@@ -32,20 +32,7 @@ Create `cms.config.ts` beside `nuxt.config.ts`:
32
32
  import { defineCmsConfig } from '@phtngyn/cms/Configuration'
33
33
  import { pageSchema } from './page.schema'
34
34
 
35
- function env(name: string): string {
36
- const value = process.env[name]
37
- if (!value) throw new Error(`Missing ${name}`)
38
- return value
39
- }
40
-
41
35
  export default defineCmsConfig({
42
- baseUrl: env('CMS_BASE_URL'), // Website origin, e.g. http://localhost:3000
43
- database: {
44
- url: env('DATABASE_URL'),
45
- schema: 'cms',
46
- },
47
- secret: env('CMS_SECRET'),
48
- initializationToken: env('CMS_INITIALIZATION_TOKEN'),
49
36
  documents: {
50
37
  collections: {
51
38
  pages: {
@@ -56,27 +43,34 @@ export default defineCmsConfig({
56
43
  },
57
44
  },
58
45
  },
59
- media: {
60
- publicBaseUrl: env('S3_PUBLIC_URL'),
61
- storage: {
62
- bucket: env('S3_BUCKET'),
46
+ installation: {
47
+ database: { schema: 'cms' },
48
+ media: {
63
49
  prefix: 'cms/',
64
- region: env('S3_REGION'),
65
- credentials: {
66
- accessKeyId: env('S3_ACCESS_KEY_ID'),
67
- secretAccessKey: env('S3_SECRET_ACCESS_KEY'),
68
- },
69
- // For an S3-compatible provider, add its endpoint and, if required:
70
- // endpoint: env('S3_ENDPOINT'),
71
- // forcePathStyle: true,
72
50
  },
73
51
  },
74
52
  })
75
53
  ```
76
54
 
77
- These environment variable names are examples; configuration is executable TypeScript, so you can use your own configuration source. Supply values during Nuxt development/build and to the deployed server. Generate distinct random values of at least 32 characters for `secret` and `initializationToken`, and keep them server-side. For example, run `node -e "console.log(require('node:crypto').randomBytes(32).toString('hex'))"` separately for each.
55
+ Keep environment-specific values in Nuxt runtime configuration. The module supplies empty `runtimeConfig.cms` defaults, so a production build needs no credentials. Nitro reads these values only when the built server starts:
56
+
57
+ ```dotenv
58
+ NUXT_CMS_BASE_URL=http://localhost:3000
59
+ NUXT_CMS_DATABASE_URL=postgres://cms:cms@localhost:5432/cms
60
+ NUXT_CMS_INITIALIZATION_TOKEN=replace-with-a-distinct-32-character-random-token
61
+ NUXT_CMS_SECRET=replace-with-at-least-32-random-characters
62
+ NUXT_CMS_MEDIA_BUCKET=cms-media
63
+ NUXT_CMS_MEDIA_PUBLIC_BASE_URL=http://localhost:8333/cms-media
64
+ NUXT_CMS_MEDIA_REGION=us-east-1
65
+ NUXT_CMS_MEDIA_ENDPOINT=http://localhost:8333
66
+ NUXT_CMS_MEDIA_FORCE_PATH_STYLE=true
67
+ NUXT_CMS_MEDIA_ACCESS_KEY_ID=cms-media
68
+ NUXT_CMS_MEDIA_SECRET_ACCESS_KEY=cms-media-secret
69
+ ```
70
+
71
+ Generate distinct random values of at least 32 characters for the secret and initialization token, and keep them server-side. The same built artifact can be started against another environment by changing only these runtime values.
78
72
 
79
- For storage using the AWS credential chain, omit `credentials`. To create a missing bucket automatically, set `provisionBucket: true` and grant bucket-creation permission. Set `media: false` to start without uploads.
73
+ For storage using the AWS credential chain, omit both credential variables. Set `NUXT_CMS_MEDIA_PROVISION_BUCKET=true` to create a missing bucket automatically and grant bucket-creation permission. Set authored `installation.media: false` to build without uploads.
80
74
 
81
75
  The PostgreSQL schema and S3 prefix are the installation's ownership boundary. CMS creates and migrates only the configured schema, and every media object stays under the configured prefix.
82
76
 
@@ -91,6 +85,8 @@ cms dev reset --database --media
91
85
  cms dev reset --database --media --yes --bootstrap --content ./content --publish
92
86
  ```
93
87
 
88
+ All lifecycle commands accept `--root <directory>`, `--env-file <path>`, `--verbose`, and `--json`. Values already present in the process override the explicit environment file, which overrides `<root>/.env`, which overrides Nuxt runtime-config defaults.
89
+
94
90
  `doctor` is read-only and reports pass, fail, or not-verified for configuration, PostgreSQL, migrations, S3, public media, packaged assets, readiness, and WebSockets. Add `--full` to validate pending migrations in a rolled-back transaction and probe database writes plus an actual publicly readable S3 object, or `--json` for editor and CI integrations. `bootstrap` prepares the Nuxt authoring catalog, provisions infrastructure, runs migrations, creates or updates the requested local administrator, and optionally plans and applies content without requiring a running server. Passwords come from `CMS_PASSWORD` or a private prompt.
95
91
 
96
92
  `reset` is a dry run unless `--yes` is present. It refuses to run while the configured CMS is live and can remove only the configured PostgreSQL schema and S3 prefix. Choose `--database`, `--media`, or both.
@@ -212,19 +208,17 @@ Supply actual draft 2020-12 schemas from the chosen library, using its input and
212
208
  Effect schemas are also accepted directly. The CMS derives Studio inputs from their encoded structure and runs the original decoder, preserving defaults, transformations, and asynchronous validation. Decoders must not require external Effect services, and their output must be a JSON-compatible object.
213
209
 
214
210
  ```ts
215
- import { Effect, Schema } from 'effect'
211
+ import { Schema } from 'effect'
216
212
  import { CalendarDate, field } from '@phtngyn/cms/DocumentModel'
217
213
 
218
214
  const pageSchema = Schema.Struct({
219
- description: field(Schema.String.annotate({ default: '' }), { input: 'textarea' }).pipe(
220
- Schema.withDecodingDefaultKey(Effect.succeed('')),
221
- ),
215
+ description: field(Schema.String, { default: '', input: 'textarea' }),
222
216
  publishedAt: Schema.optionalKey(field(CalendarDate, { label: 'Published on' })),
223
217
  title: Schema.NonEmptyString,
224
218
  })
225
219
  ```
226
220
 
227
- Use `Schema.optionalKey` for optional fields and `Schema.Finite` for numeric fields. An encoded `default` annotation supplies Studio's initial value; `Schema.withDecodingDefaultKey` applies that default during validation. `CalendarDate` validates calendar dates stored as `YYYY-MM-DD` strings. `field` adds presentation annotations to the encoded side of an Effect schema.
221
+ Use `Schema.optionalKey` for optional fields and `Schema.Finite` for numeric fields. A `field` default supplies Studio's initial value and applies only when the containing key is absent; invalid explicit values still fail. `CalendarDate` validates calendar dates stored as `YYYY-MM-DD` strings. Advanced Effect schemas, transformations, and defaults remain supported directly. `effect` is an intentional runtime dependency and is installed explicitly because authored schemas expose its public types.
228
222
 
229
223
  Studio supports strings, calendar dates, finite numbers, booleans, string arrays, choices, and nested objects. Non-recursive local references are resolved. Ambiguous unions, structural intersections, recursive schemas, and unsupported field shapes fail configuration rather than producing incomplete forms.
230
224
 
@@ -261,7 +255,7 @@ const form = {} as CmsFormDefinition<'contact-form'>
261
255
 
262
256
  `useCmsI18n().t()` autocompletes configured keys and requires the exact placeholders in each message. Nuxt preparation rejects extra locale keys and inconsistent placeholders. Missing translations are allowed only when the configured fallback locale supplies the canonical message.
263
257
 
264
- CMS also synchronizes owned document routes with Nuxt Site Config. The delivered document locale wins, the route prefix applies while delivery resolves, and non-CMS routes retain the application's Site Config. The locale drives `<html lang>`, Open Graph locale, structured-data language, canonical and alternate links, sitemap alternatives, and `useCmsI18n()`.
258
+ CMS also synchronizes owned document routes with Nuxt Site Config. The delivered document locale wins, the route prefix applies while delivery resolves, and non-CMS routes retain the application's Site Config. Set `i18n.siteConfig: 'localized-routes'` to give CMS-derived language metadata to custom localized routes too; document canonical URLs, alternates, and SEO remain document-only. The default `documents` scope avoids conflicts with another application i18n module.
265
259
 
266
260
  ## Studio and authoring during development
267
261
 
@@ -344,9 +338,10 @@ forms: {
344
338
  fieldTypes: ['text', 'email', 'textarea', 'number', 'checkbox', 'select'],
345
339
  rules: ['required', 'minLength', 'maxLength', 'min', 'max'],
346
340
  }),
347
- onSubmit: async ({ form, values }) => {
341
+ onSubmit: async ({ form, request, values }) => {
348
342
  // Server only: deliver or persist validated answers here.
349
343
  // values are keyed by stable question IDs; form.steps contains their labels.
344
+ return { status: 'accepted', reference: request.id }
350
345
  },
351
346
  },
352
347
  },
@@ -357,14 +352,11 @@ Create `ContactForm.vue` with an optional `cmsForm?: CmsFormDefinition` prop. Th
357
352
  A valid authored form receives `cmsForm` from `DocumentRenderer`. Incomplete drafts do not; show a helpful placeholder until the form is valid. Mount your custom form contents only when that definition exists:
358
353
 
359
354
  ```ts
360
- import type { CmsFormDefinition } from '@phtngyn/cms/Forms'
361
- import { useCmsForm } from '@phtngyn/cms/Forms'
355
+ import type { CmsFormDefinition } from '#cms/types'
362
356
 
363
- const props = defineProps<{ definition: CmsFormDefinition }>()
357
+ const props = defineProps<{ definition: CmsFormDefinition<'contact-form'> }>()
364
358
  const {
365
- fields,
366
359
  steps,
367
- values,
368
360
  errors,
369
361
  currentStep,
370
362
  stepIndex,
@@ -375,9 +367,10 @@ const {
375
367
  isPreview,
376
368
  submitError,
377
369
  canSubmit,
378
- invalidFields,
379
- firstInvalidFieldId,
380
- field,
370
+ visibleControls,
371
+ invalidControls,
372
+ firstInvalidControlId,
373
+ control,
381
374
  next,
382
375
  previous,
383
376
  validate,
@@ -386,13 +379,13 @@ const {
386
379
  } = useCmsForm(() => props.definition)
387
380
  ```
388
381
 
389
- The composable accepts a value, ref, or getter and returns destructurable refs and functions. Use `field(id)` for each visible question. The cached controller exposes a writable `value`, `dirty`, `touched`, `valid`, one-item `errors`, `controlAttrs`, `helpAttrs`, `errorAttrs`, and `touch()`. Bind `controlAttrs` to the native control, `helpAttrs` to help text, and `errorAttrs` to the rendered error; CMS keeps their stable IDs and ARIA relationships aligned. Valid number answers become numbers, empty answers become null, and invalid number text remains visible to validation. Empty optional answers reach the server handler as null. `canSubmit`, `invalidFields`, and `firstInvalidFieldId` centralize form-level behavior, while `submitError` and `errors._form` cover transport and server failures.
382
+ The composable accepts a value, ref, or getter and returns destructurable refs and functions. Iterate `visibleControls`; each reactive control exposes plain template properties: `field`, writable `value`, `dirty`, `touched`, `valid`, `error`, `attrs`, `helpAttrs`, `errorAttrs`, and `touch()`. Bind `attrs` to the native control. CMS keeps stable IDs and ARIA relationships aligned without nested `.value` access inside a `v-for`. Valid number answers become numbers, empty answers become null, and invalid number text remains visible to validation. `canSubmit`, `invalidControls`, and `firstInvalidControlId` centralize form-level behavior, while `submitError` and `errors._form` cover transport and server failures.
390
383
 
391
384
  `next()` validates the current step, `previous()` preserves answers, and `submit()` validates every step and returns whether submission succeeded. A required checkbox must be checked.
392
385
 
393
386
  Definition replacements preserve answers for matching IDs and field types within the same form, clear validation state, and cancel pending client requests. `reset()` clears answers and submission state. The composable prevents overlapping submissions and repeat submission after success until reset. Scope disposal cancels client work. Cancellation cannot undo a server handler that has already started. An optional `submit(payload, signal)` transport override supports advanced integrations; it must return `CmsFormResult` and preserve server-side validation.
394
387
 
395
- The endpoint resolves the current published form and checks its exact serialized revision, including capabilities and question settings. Stale pages must reload. Draft preview validates locally without invoking the handler. Invalid structure prevents publication; invalid answers and unknown answer keys never reach the handler. Dynamic editor-created questions have runtime-validated answer types, not compile-time-known answer keys.
388
+ The endpoint resolves the current published form and checks its exact serialized revision, including capabilities and question settings. Stale pages must reload. Draft preview validates locally without invoking the handler. Invalid structure prevents publication; invalid answers and unknown answer keys never reach the handler. The application handler explicitly returns `accepted`, `invalid`, or `unavailable`; trusted validation errors may target current field IDs or `_form`. Unexpected failures are correlated by request ID in server logs without recording answers and return only a generic public failure.
396
389
 
397
390
  Requests are limited to 128 KiB and 60 submissions per minute per server process, shared across forms. Browser requests with a foreign Origin are rejected. For deployments with multiple replicas or stronger spam protection, enforce a shared limit or challenge at your edge. There is no automatic retry, durable deduplication, inbox, email delivery, upload, branching, or save-and-resume in this release. Application handlers should account for retries after an uncertain network outcome. Configuration changes use Nuxt's restart lifecycle.
398
391
 
package/package.json CHANGED
@@ -17,13 +17,14 @@
17
17
  "directory": "packages/nuxt"
18
18
  },
19
19
  "name": "@phtngyn/cms",
20
- "version": "0.2.0-beta.1",
20
+ "version": "0.2.0-beta.2",
21
21
  "type": "module",
22
22
  "files": [
23
23
  "bin",
24
24
  "studio",
25
25
  "src",
26
26
  "README.md",
27
+ "CHANGELOG.md",
27
28
  "LICENSE"
28
29
  ],
29
30
  "exports": {
@@ -77,6 +78,7 @@
77
78
  "@tiptap/y-tiptap": "^3.0.9",
78
79
  "@vue/compiler-sfc": "^3.6.0-rc.8",
79
80
  "better-auth": "^1.7.4",
81
+ "c12": "^3.3.4",
80
82
  "comark": "^0.7.0",
81
83
  "diff": "^9.0.0",
82
84
  "drizzle-orm": "^1.0.0-rc.5-169397b",
@@ -1,5 +1,5 @@
1
- import { a as FormStep, n as FormDefinition, r as FormField } from "./Forms-BorTcIlp.js";
2
- import { a as CmsMessageParameters, i as CmsMessageKey, r as CmsLocale } from "./I18n-BXlVunfa.js";
1
+ import { a as FormStep, n as FormDefinition, r as FormField } from "./Forms-R0HoTR-o.js";
2
+ import { a as CmsMessageParameters, i as CmsMessageKey, r as CmsLocale } from "./I18n-zbqpWxki.js";
3
3
  import { n as DeliveryDocumentPage, t as DeliveryDocument } from "./types-DutFRtaG.js";
4
4
  import { Schema } from "effect";
5
5
  import { StandardSchemaV1 } from "@standard-schema/spec";
@@ -42,11 +42,13 @@ type FormFieldType<Name extends CmsFormName> = FormCapabilities<Name> extends {
42
42
  fieldTypes: ReadonlyArray<infer FieldType>;
43
43
  } ? Extract<FieldType, FormField['type']> : never;
44
44
  type FormRuleProperty<Rule> = Rule extends 'required' ? 'required' : Rule extends 'minLength' ? 'minLength' : Rule extends 'maxLength' ? 'maxLength' : Rule extends 'min' ? 'min' : Rule extends 'max' ? 'max' : never;
45
- type CmsFormField<Name extends CmsFormName> = Omit<FormField, 'max' | 'maxLength' | 'min' | 'minLength' | 'required' | 'type'> & Pick<FormField, FormRuleProperty<FormCapabilities<Name> extends {
45
+ type AllowedFormRuleProperty<Name extends CmsFormName> = FormRuleProperty<FormCapabilities<Name> extends {
46
46
  rules: ReadonlyArray<infer Rule>;
47
- } ? Rule : never>> & {
47
+ } ? Rule : never>;
48
+ type RestrictFormRules<Field, Name extends CmsFormName> = Field extends FormField ? Omit<Field, Exclude<'max' | 'maxLength' | 'min' | 'minLength' | 'required', AllowedFormRuleProperty<Name>>> : never;
49
+ type CmsFormField<Name extends CmsFormName> = RestrictFormRules<Extract<FormField, {
48
50
  readonly type: FormFieldType<Name>;
49
- };
51
+ }>, Name>;
50
52
  type CmsFormStep<Name extends CmsFormName> = Omit<FormStep, 'fields'> & {
51
53
  readonly fields: ReadonlyArray<CmsFormField<Name>>;
52
54
  };
@@ -1,6 +1,6 @@
1
- import { Ct as CollectionName, St as AddressPattern, Tt as SourceDirectory, b as MarkdownNode, n as CmsMarkdownDocument, wt as Locale } from "./models-DgkGTFus.js";
2
- import { r as FormCapabilities } from "./Forms-CfcI3tPU.js";
3
- import { c as resolveCmsComarkAttributes, d as createCmsComarkRenderData, l as withCmsComarkProps, r as formStructureIssues, s as projectCmsEditorComponentAttributes } from "./Forms-02-p8qEw.js";
1
+ import { Ct as CollectionName, St as AddressPattern, Tt as SourceDirectory, b as MarkdownNode, n as CmsMarkdownDocument, wt as Locale } from "./models-ChRxBChy.js";
2
+ import { r as FormCapabilities } from "./Forms-BbkE7QfC.js";
3
+ import { c as resolveCmsComarkAttributes, d as createCmsComarkRenderData, l as withCmsComarkProps, r as formStructureIssues, s as projectCmsEditorComponentAttributes } from "./Forms-DoB56hfe.js";
4
4
  import { a as createEditorNodeId, n as editorMetadata, o as editorNodeId } from "./metadata-BEZPWh-3.js";
5
5
  import { Effect, Option, Predicate, Schema } from "effect";
6
6
  import { Extension } from "@tiptap/core";
@@ -1030,4 +1030,4 @@ const MediaConfiguration = Schema.Struct({
1030
1030
 
1031
1031
  //#endregion
1032
1032
  export { finiteNumberAttribute as C, compactJsonAttributes as S, comarkTagForEditorMark as _, BlockAuthoring as a, encodeEditorImageAttributes as b, parseAuthoringContent as c, EditorRenderFailed as d, DOCUMENT_ENGINE_FINGERPRINT as f, EDITOR_MARK_TYPES as g, comarkToEditor as h, MediaConfiguration as i, validateCollectionBody as l, SOURCE_MAPPINGS_META_KEY as m, ComponentDefinition as n, createAuthoringDocumentValidator as o, createDocumentParser as p, DocumentConfiguration as r, createAuthoringSchema as s, AuthoringCatalog as t, EditorDocumentInvalid as u, isEditorMark as v, nonEmptyStringAttribute as w, normalizeEditorImageLayout as x, EDITOR_IMAGE_LAYOUT_ATTRIBUTE as y };
1033
- //# sourceMappingURL=Configuration-CjVUBBwa.js.map
1033
+ //# sourceMappingURL=Configuration-BU-UyGoH.js.map