@phtngyn/cms 0.2.0-beta.1 → 0.2.0-beta.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/CHANGELOG.md +13 -0
- package/README.md +40 -45
- package/package.json +7 -5
- package/src/ApplicationTypes.d.ts +7 -5
- package/src/{Configuration-CjVUBBwa.js → Configuration-BU-UyGoH.js} +4 -4
- package/src/{Configuration-CjVUBBwa.js.map → Configuration-BU-UyGoH.js.map} +1 -1
- package/src/Configuration.d.ts +41 -24
- package/src/Configuration.js.map +1 -1
- package/src/Content.js +42 -19
- package/src/Content.js.map +1 -1
- package/src/{ContentTransfer-CTzGGKFV.js → ContentTransfer-BhF9G56s.js} +2 -2
- package/src/{ContentTransfer-CTzGGKFV.js.map → ContentTransfer-BhF9G56s.js.map} +1 -1
- package/src/{DocumentEngine-BbhfnTAc.js → DocumentEngine-ClhFXW9M.js} +4 -4
- package/src/{DocumentEngine-BbhfnTAc.js.map → DocumentEngine-ClhFXW9M.js.map} +1 -1
- package/src/DocumentModel.d.ts +6 -1
- package/src/DocumentModel.js +4 -3
- package/src/DocumentModel.js.map +1 -1
- package/src/{Forms-CfcI3tPU.js → Forms-BbkE7QfC.js} +47 -16
- package/src/Forms-BbkE7QfC.js.map +1 -0
- package/src/{Forms-02-p8qEw.js → Forms-DoB56hfe.js} +24 -7
- package/src/Forms-DoB56hfe.js.map +1 -0
- package/src/{Forms-BorTcIlp.d.ts → Forms-R0HoTR-o.d.ts} +30 -9
- package/src/Forms.d.ts +16 -15
- package/src/Forms.js.map +1 -1
- package/src/{I18n-BXlVunfa.d.ts → I18n-zbqpWxki.d.ts} +3 -1
- package/src/I18n.d.ts +1 -1
- package/src/Module.js +4 -2
- package/src/Module.js.map +1 -1
- package/src/{S3MediaObjects-DC0c8sYC.js → S3MediaObjects-CR3p1WTg.js} +21 -13
- package/src/S3MediaObjects-CR3p1WTg.js.map +1 -0
- package/src/cli.js +60 -34
- package/src/cli.js.map +1 -1
- package/src/{connection-BPf4BQUZ.js → connection-D5S9Iph-.js} +2 -2
- package/src/{connection-BPf4BQUZ.js.map → connection-D5S9Iph-.js.map} +1 -1
- package/src/{dev-lifecycle-vQLxwCFq.js → dev-lifecycle-D3f9-upa.js} +129 -42
- package/src/dev-lifecycle-D3f9-upa.js.map +1 -0
- package/src/{installation-DsGst1BH.js → installation-fZtNxtoW.js} +68 -41
- package/src/installation-fZtNxtoW.js.map +1 -0
- package/src/internal/authoring-catalog.js +2 -2
- package/src/internal/authoring-metadata.js +1 -1
- package/src/internal/configuration.js +149 -50
- package/src/internal/configuration.js.map +1 -1
- package/src/internal/dev-lifecycle.js +2 -2
- package/src/internal/diagnostics.js +47 -0
- package/src/internal/diagnostics.js.map +1 -0
- package/src/internal/document-model.js +2 -2
- package/src/internal/form-capabilities.js +1 -1
- package/src/internal/i18n.js +6 -1
- package/src/internal/i18n.js.map +1 -1
- package/src/internal/studio-app.js +8 -6
- package/src/internal/studio-app.js.map +1 -1
- package/src/{location-BgYhXEZp.js → location-CPX7oj0o.js} +2 -2
- package/src/{location-BgYhXEZp.js.map → location-CPX7oj0o.js.map} +1 -1
- package/src/{models-k2nXyD6q.js → models-C9kF9JlQ.js} +2 -2
- package/src/{models-k2nXyD6q.js.map → models-C9kF9JlQ.js.map} +1 -1
- package/src/{models-DgkGTFus.js → models-ChRxBChy.js} +4 -2
- package/src/{models-DgkGTFus.js.map → models-ChRxBChy.js.map} +1 -1
- package/src/runtime/delivery/context.js +1 -1
- package/src/runtime/delivery/plugin.js +3 -2
- package/src/runtime/delivery/plugin.js.map +1 -1
- package/src/runtime/forms/document.js +1 -1
- package/src/runtime/forms/useCmsForm.js +73 -46
- package/src/runtime/forms/useCmsForm.js.map +1 -1
- package/src/runtime/i18n/useCmsI18n.d.ts +1 -1
- package/src/runtime/i18n/useCmsI18n.js.map +1 -1
- package/src/runtime/installation.js +1 -1
- package/src/runtime/plugin.js +12 -4
- package/src/runtime/plugin.js.map +1 -1
- package/src/runtime/preview/connection.js +1 -1
- package/src/runtime/preview/controller.js +2 -2
- package/src/runtime/preview/plugin.client.js +3 -3
- package/src/runtime/preview/plugin.client.js.map +1 -1
- package/src/runtime/preview/store.js +1 -1
- package/src/runtime/sitemap.js +1 -1
- package/src/{store-BYgSt7E3.js → store-CCsjHaZm.js} +8 -8
- package/src/store-CCsjHaZm.js.map +1 -0
- package/studio/{CreateDocumentDialog-BdiM77bb.js → CreateDocumentDialog-DJ8c0WZb.js} +3 -3
- package/studio/{documentPlanning-B7fyUj9r.js → documentPlanning-CDb31mnl.js} +6417 -6358
- package/studio/host.css +1 -1
- package/studio/host.js +7612 -7249
- package/src/Forms-02-p8qEw.js.map +0 -1
- package/src/Forms-CfcI3tPU.js.map +0 -1
- package/src/S3MediaObjects-DC0c8sYC.js.map +0 -1
- package/src/dev-lifecycle-vQLxwCFq.js.map +0 -1
- package/src/installation-DsGst1BH.js.map +0 -1
- package/src/store-BYgSt7E3.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
|
|
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
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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
|
-
|
|
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 `
|
|
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.
|
|
@@ -110,6 +106,8 @@ CMS_URL=https://target.example.com CMS_EMAIL=admin@example.com cms content apply
|
|
|
110
106
|
|
|
111
107
|
Export writes each authored source at its CMS path and a `.cms-content.json` index with content hashes and the exact-revision publication state. Commit both to Git to review changes. Export refuses to replace locally edited Markdown or index entries. It does not delete files that disappeared from the CMS; remove stale files and index entries yourself after review. `diff` compares local Markdown and publication state with the current target and reports target-only documents. `plan` validates the whole incoming set and lists creates, updates, publications, and conflicts without writing. `apply` plans again, then commits the batch atomically against the generation it just inspected. Run `plan` and `diff` before applying, especially when targeting another environment.
|
|
112
108
|
|
|
109
|
+
The export index and every indexed Markdown path must stay inside the selected content directory without symlinked path components. Import and export reject symlinks at those boundaries.
|
|
110
|
+
|
|
113
111
|
For a folder without `.cms-content.json`, the CLI reads nested `.md` and `.mdc` files and uses folder-relative document paths. These sources are eligible for publication with `--publish`. Imports create drafts by default. Existing content with different Markdown is a conflict until you pass `--overwrite` to `plan` and `apply`. For an exported folder, `--publish` publishes only index entries marked `published: true`; without it, they remain drafts on the target. A newly imported draft does not unpublish an older target revision. The CLI does not delete target documents or move a target-only document. A concurrent change after planning causes `apply` to fail; review and retry.
|
|
114
112
|
|
|
115
113
|
The command tree is intentionally shared: future CMS operations can be added beside `content` without separate executables.
|
|
@@ -212,19 +210,17 @@ Supply actual draft 2020-12 schemas from the chosen library, using its input and
|
|
|
212
210
|
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
211
|
|
|
214
212
|
```ts
|
|
215
|
-
import {
|
|
213
|
+
import { Schema } from 'effect'
|
|
216
214
|
import { CalendarDate, field } from '@phtngyn/cms/DocumentModel'
|
|
217
215
|
|
|
218
216
|
const pageSchema = Schema.Struct({
|
|
219
|
-
description: field(Schema.String
|
|
220
|
-
Schema.withDecodingDefaultKey(Effect.succeed('')),
|
|
221
|
-
),
|
|
217
|
+
description: field(Schema.String, { default: '', input: 'textarea' }),
|
|
222
218
|
publishedAt: Schema.optionalKey(field(CalendarDate, { label: 'Published on' })),
|
|
223
219
|
title: Schema.NonEmptyString,
|
|
224
220
|
})
|
|
225
221
|
```
|
|
226
222
|
|
|
227
|
-
Use `Schema.optionalKey` for optional fields and `Schema.Finite` for numeric fields.
|
|
223
|
+
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
224
|
|
|
229
225
|
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
226
|
|
|
@@ -261,7 +257,7 @@ const form = {} as CmsFormDefinition<'contact-form'>
|
|
|
261
257
|
|
|
262
258
|
`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
259
|
|
|
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.
|
|
260
|
+
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
261
|
|
|
266
262
|
## Studio and authoring during development
|
|
267
263
|
|
|
@@ -344,9 +340,10 @@ forms: {
|
|
|
344
340
|
fieldTypes: ['text', 'email', 'textarea', 'number', 'checkbox', 'select'],
|
|
345
341
|
rules: ['required', 'minLength', 'maxLength', 'min', 'max'],
|
|
346
342
|
}),
|
|
347
|
-
onSubmit: async ({ form, values }) => {
|
|
343
|
+
onSubmit: async ({ form, request, values }) => {
|
|
348
344
|
// Server only: deliver or persist validated answers here.
|
|
349
345
|
// values are keyed by stable question IDs; form.steps contains their labels.
|
|
346
|
+
return { status: 'accepted', reference: request.id }
|
|
350
347
|
},
|
|
351
348
|
},
|
|
352
349
|
},
|
|
@@ -357,14 +354,11 @@ Create `ContactForm.vue` with an optional `cmsForm?: CmsFormDefinition` prop. Th
|
|
|
357
354
|
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
355
|
|
|
359
356
|
```ts
|
|
360
|
-
import type { CmsFormDefinition } from '
|
|
361
|
-
import { useCmsForm } from '@phtngyn/cms/Forms'
|
|
357
|
+
import type { CmsFormDefinition } from '#cms/types'
|
|
362
358
|
|
|
363
|
-
const props = defineProps<{ definition: CmsFormDefinition }>()
|
|
359
|
+
const props = defineProps<{ definition: CmsFormDefinition<'contact-form'> }>()
|
|
364
360
|
const {
|
|
365
|
-
fields,
|
|
366
361
|
steps,
|
|
367
|
-
values,
|
|
368
362
|
errors,
|
|
369
363
|
currentStep,
|
|
370
364
|
stepIndex,
|
|
@@ -375,9 +369,10 @@ const {
|
|
|
375
369
|
isPreview,
|
|
376
370
|
submitError,
|
|
377
371
|
canSubmit,
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
372
|
+
visibleControls,
|
|
373
|
+
invalidControls,
|
|
374
|
+
firstInvalidControlId,
|
|
375
|
+
control,
|
|
381
376
|
next,
|
|
382
377
|
previous,
|
|
383
378
|
validate,
|
|
@@ -386,13 +381,13 @@ const {
|
|
|
386
381
|
} = useCmsForm(() => props.definition)
|
|
387
382
|
```
|
|
388
383
|
|
|
389
|
-
The composable accepts a value, ref, or getter and returns destructurable refs and functions.
|
|
384
|
+
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
385
|
|
|
391
386
|
`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
387
|
|
|
393
388
|
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
389
|
|
|
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.
|
|
390
|
+
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
391
|
|
|
397
392
|
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
393
|
|
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.
|
|
20
|
+
"version": "0.2.0-beta.3",
|
|
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": {
|
|
@@ -69,7 +70,7 @@
|
|
|
69
70
|
"@hocuspocus/server": "^4.7.0",
|
|
70
71
|
"@nuxt/kit": "^4.5.2",
|
|
71
72
|
"@nuxt/schema": "^4.5.2",
|
|
72
|
-
"@nuxtjs/robots": "^6.2.
|
|
73
|
+
"@nuxtjs/robots": "^6.2.3",
|
|
73
74
|
"@nuxtjs/sitemap": "^8.5.1",
|
|
74
75
|
"@standard-schema/spec": "^1.1.0",
|
|
75
76
|
"@tiptap/core": "^3.31.3",
|
|
@@ -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": "^4.0.0-rc.1",
|
|
80
82
|
"comark": "^0.7.0",
|
|
81
83
|
"diff": "^9.0.0",
|
|
82
84
|
"drizzle-orm": "^1.0.0-rc.5-169397b",
|
|
@@ -84,8 +86,8 @@
|
|
|
84
86
|
"h3": "^1.15.11",
|
|
85
87
|
"jiti": "^2.7.0",
|
|
86
88
|
"nitropack": "^2.13.4",
|
|
87
|
-
"nuxt-schema-org": "^6.3.
|
|
88
|
-
"nuxt-seo-utils": "^8.5.
|
|
89
|
+
"nuxt-schema-org": "^6.3.2",
|
|
90
|
+
"nuxt-seo-utils": "^8.5.1",
|
|
89
91
|
"nuxt-site-config": "^4.2.3",
|
|
90
92
|
"pg": "^8.23.0",
|
|
91
93
|
"typescript": "npm:typescript-native-bridge@6.0.3-bridge.16.tsgo.7.0.2",
|
|
@@ -98,4 +100,4 @@
|
|
|
98
100
|
"nuxt": ">=4.5.0 <5.0.0",
|
|
99
101
|
"vue": ">=3.6.0-rc.6 <4.0.0"
|
|
100
102
|
}
|
|
101
|
-
}
|
|
103
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as FormStep, n as FormDefinition, r as FormField } from "./Forms-
|
|
2
|
-
import { a as CmsMessageParameters, i as CmsMessageKey, r as CmsLocale } from "./I18n-
|
|
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
|
|
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-
|
|
2
|
-
import { r as FormCapabilities } from "./Forms-
|
|
3
|
-
import { c as resolveCmsComarkAttributes, d as createCmsComarkRenderData, l as withCmsComarkProps, r as formStructureIssues, s as projectCmsEditorComponentAttributes } from "./Forms-
|
|
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-
|
|
1033
|
+
//# sourceMappingURL=Configuration-BU-UyGoH.js.map
|