@nuasite/cms 0.5.1 → 0.6.0
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/README.md +11 -11
- package/dist/editor.js +4593 -4449
- package/package.json +1 -1
- package/src/build-processor.ts +38 -1
- package/src/dev-middleware.ts +47 -2
- package/src/editor/components/collections-browser.tsx +10 -6
- package/src/editor/components/fields.tsx +7 -7
- package/src/editor/components/frontmatter-fields.tsx +163 -2
- package/src/editor/components/seo-editor.tsx +2 -1
- package/src/editor/components/toast/toast.tsx +19 -2
- package/src/editor/editor.ts +16 -17
- package/src/editor/index.tsx +4 -2
- package/src/editor/types.ts +2 -0
- package/src/handlers/array-ops.ts +102 -0
- package/src/index.ts +1 -1
- package/src/source-finder/cross-file-tracker.ts +42 -0
- package/src/source-finder/element-finder.ts +18 -4
- package/src/source-finder/types.ts +3 -0
- package/src/source-finder/variable-extraction.ts +2 -2
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ Astro integration that adds inline visual editing to any Astro site. Scans your
|
|
|
10
10
|
|
|
11
11
|
```typescript
|
|
12
12
|
// astro.config.mjs
|
|
13
|
-
import nuaCms from '@nuasite/
|
|
13
|
+
import nuaCms from '@nuasite/cms'
|
|
14
14
|
|
|
15
15
|
export default defineConfig({
|
|
16
16
|
integrations: [nuaCms()],
|
|
@@ -113,7 +113,7 @@ Media uploads use a pluggable adapter pattern. Three adapters are included:
|
|
|
113
113
|
Files are stored in Cloudflare R2 with metadata tracked in the Contember database. This is the only adapter that gives you proper asset IDs, metadata, and AI-powered image annotation. Use this for production sites.
|
|
114
114
|
|
|
115
115
|
```typescript
|
|
116
|
-
import nuaCms, { contemberMedia } from '@nuasite/
|
|
116
|
+
import nuaCms, { contemberMedia } from '@nuasite/cms'
|
|
117
117
|
|
|
118
118
|
nuaCms({
|
|
119
119
|
media: contemberMedia({
|
|
@@ -131,7 +131,7 @@ This adapter calls the worker's `/cms/:projectSlug/media/*` endpoints, which han
|
|
|
131
131
|
Stores files in `public/uploads/`. Served directly by Vite's static file server. Zero configuration needed. Files are committed to your repo alongside your source code.
|
|
132
132
|
|
|
133
133
|
```typescript
|
|
134
|
-
import nuaCms, { localMedia } from '@nuasite/
|
|
134
|
+
import nuaCms, { localMedia } from '@nuasite/cms'
|
|
135
135
|
|
|
136
136
|
nuaCms({
|
|
137
137
|
media: localMedia({
|
|
@@ -148,7 +148,7 @@ Files are named with UUIDs to avoid collisions. Listed by modification time (new
|
|
|
148
148
|
Direct S3-compatible object storage. Works with AWS S3, Cloudflare R2, MinIO, or any S3-compatible provider. Listing, uploading, and deleting all work, but there is no database layer — content types are not preserved on list, and there are no image dimensions or annotations. Requires `@aws-sdk/client-s3` as a peer dependency.
|
|
149
149
|
|
|
150
150
|
```typescript
|
|
151
|
-
import nuaCms, { s3Media } from '@nuasite/
|
|
151
|
+
import nuaCms, { s3Media } from '@nuasite/cms'
|
|
152
152
|
|
|
153
153
|
nuaCms({
|
|
154
154
|
media: s3Media({
|
|
@@ -175,7 +175,7 @@ npm install @aws-sdk/client-s3
|
|
|
175
175
|
Implement the `MediaStorageAdapter` interface to use any storage backend:
|
|
176
176
|
|
|
177
177
|
```typescript
|
|
178
|
-
import type { MediaStorageAdapter } from '@nuasite/
|
|
178
|
+
import type { MediaStorageAdapter } from '@nuasite/cms'
|
|
179
179
|
|
|
180
180
|
const myAdapter: MediaStorageAdapter = {
|
|
181
181
|
async list(options) {
|
|
@@ -226,24 +226,24 @@ Both operations find the invocation site (the page file, not the component file
|
|
|
226
226
|
|
|
227
227
|
```typescript
|
|
228
228
|
// Default export
|
|
229
|
-
import nuaCms from '@nuasite/
|
|
229
|
+
import nuaCms from '@nuasite/cms'
|
|
230
230
|
|
|
231
231
|
// Media adapters
|
|
232
|
-
import { contemberMedia, localMedia, s3Media } from '@nuasite/
|
|
232
|
+
import { contemberMedia, localMedia, s3Media } from '@nuasite/cms'
|
|
233
233
|
|
|
234
234
|
// Types
|
|
235
|
-
import type { MediaItem, MediaStorageAdapter } from '@nuasite/
|
|
235
|
+
import type { MediaItem, MediaStorageAdapter } from '@nuasite/cms'
|
|
236
236
|
import type {
|
|
237
237
|
CmsManifest,
|
|
238
238
|
ComponentDefinition,
|
|
239
239
|
ManifestEntry,
|
|
240
|
-
} from '@nuasite/
|
|
240
|
+
} from '@nuasite/cms'
|
|
241
241
|
|
|
242
242
|
// Utilities
|
|
243
243
|
import {
|
|
244
244
|
getProjectRoot,
|
|
245
245
|
scanCollections,
|
|
246
246
|
setProjectRoot,
|
|
247
|
-
} from '@nuasite/
|
|
248
|
-
import { findCollectionSource, parseMarkdownContent } from '@nuasite/
|
|
247
|
+
} from '@nuasite/cms'
|
|
248
|
+
import { findCollectionSource, parseMarkdownContent } from '@nuasite/cms'
|
|
249
249
|
```
|