@elytracms/studio 0.0.95 → 0.0.96

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 (92) hide show
  1. package/convex/cms.ts +124 -8
  2. package/convex/strict-reference-race.test.ts +139 -0
  3. package/dist/components/ai/ai-chat-panel.js +15 -2
  4. package/dist/components/ai/ai-chat-panel.js.map +1 -1
  5. package/dist/components/ai/translate-document-action.d.ts +6 -0
  6. package/dist/components/ai/translate-document-action.js.map +1 -1
  7. package/dist/components/ai/translate-document-dialog.d.ts +1 -1
  8. package/dist/components/ai/translate-document-dialog.js +5 -5
  9. package/dist/components/ai/translate-document-dialog.js.map +1 -1
  10. package/dist/components/assets/asset-detail.js +5 -2
  11. package/dist/components/assets/asset-detail.js.map +1 -1
  12. package/dist/components/assets/asset-locale.d.ts +7 -0
  13. package/dist/components/assets/asset-locale.js +16 -2
  14. package/dist/components/assets/asset-locale.js.map +1 -1
  15. package/dist/components/assets/asset-meta-drift-notice.d.ts +13 -0
  16. package/dist/components/assets/asset-meta-drift-notice.js +22 -0
  17. package/dist/components/assets/asset-meta-drift-notice.js.map +1 -0
  18. package/dist/components/assets/asset-meta-label.d.ts +2 -1
  19. package/dist/components/assets/asset-meta-label.js +4 -2
  20. package/dist/components/assets/asset-meta-label.js.map +1 -1
  21. package/dist/components/assets/asset-metadata.d.ts +33 -13
  22. package/dist/components/assets/asset-metadata.js +46 -22
  23. package/dist/components/assets/asset-metadata.js.map +1 -1
  24. package/dist/components/assets/asset-search.d.ts +6 -2
  25. package/dist/components/assets/asset-search.js +15 -5
  26. package/dist/components/assets/asset-search.js.map +1 -1
  27. package/dist/components/assets/assets-collection-view-source.d.ts +5 -3
  28. package/dist/components/assets/assets-collection-view-source.js +7 -5
  29. package/dist/components/assets/assets-collection-view-source.js.map +1 -1
  30. package/dist/components/builder/canvas-rebase.d.ts +36 -12
  31. package/dist/components/builder/canvas-rebase.js +13 -3
  32. package/dist/components/builder/canvas-rebase.js.map +1 -1
  33. package/dist/components/builder/canvas-render-context.js +5 -4
  34. package/dist/components/builder/canvas-render-context.js.map +1 -1
  35. package/dist/components/builder/composition-field-editor.d.ts +12 -6
  36. package/dist/components/builder/composition-field-editor.js +6 -5
  37. package/dist/components/builder/composition-field-editor.js.map +1 -1
  38. package/dist/components/cms/asset-picker-core.d.ts +2 -2
  39. package/dist/components/cms/asset-picker-core.js +2 -2
  40. package/dist/components/cms/asset-picker-core.js.map +1 -1
  41. package/dist/components/cms/asset-picker.js +3 -1
  42. package/dist/components/cms/asset-picker.js.map +1 -1
  43. package/dist/components/cms/canvas-commit.d.ts +6 -0
  44. package/dist/components/cms/canvas-commit.js +5 -1
  45. package/dist/components/cms/canvas-commit.js.map +1 -1
  46. package/dist/components/cms/cms-store.d.ts +21 -8
  47. package/dist/components/cms/cms-store.js +19 -10
  48. package/dist/components/cms/cms-store.js.map +1 -1
  49. package/dist/components/cms/collection-table.js +4 -11
  50. package/dist/components/cms/collection-table.js.map +1 -1
  51. package/dist/components/cms/detail-editor.js +2 -2
  52. package/dist/components/cms/detail-editor.js.map +1 -1
  53. package/dist/components/cms/draft-commit.d.ts +16 -3
  54. package/dist/components/cms/draft-commit.js +3 -2
  55. package/dist/components/cms/draft-commit.js.map +1 -1
  56. package/dist/components/cms/use-document-draft.d.ts +67 -9
  57. package/dist/components/cms/use-document-draft.js +112 -39
  58. package/dist/components/cms/use-document-draft.js.map +1 -1
  59. package/dist/components/collection-view/cms-collection-view-source.js +6 -4
  60. package/dist/components/collection-view/cms-collection-view-source.js.map +1 -1
  61. package/dist/components/components/transfer-dialog.js +6 -4
  62. package/dist/components/components/transfer-dialog.js.map +1 -1
  63. package/dist/lib/ai/chat-state.d.ts +7 -0
  64. package/dist/lib/ai/chat-state.js.map +1 -1
  65. package/dist/lib/ai/tools.d.ts +8 -0
  66. package/dist/lib/ai/tools.js +4 -0
  67. package/dist/lib/ai/tools.js.map +1 -1
  68. package/dist/lib/cms-views/view-model.d.ts +15 -8
  69. package/dist/lib/cms-views/view-model.js +19 -5
  70. package/dist/lib/cms-views/view-model.js.map +1 -1
  71. package/dist/lib/collection-view/__fixtures__/document-writes.js +1 -0
  72. package/dist/lib/collection-view/__fixtures__/document-writes.js.map +1 -1
  73. package/dist/lib/collection-view/collection-view-source.d.ts +15 -7
  74. package/dist/lib/collection-view/collection-view-source.js.map +1 -1
  75. package/dist/lib/data/collection-content.js +5 -0
  76. package/dist/lib/data/collection-content.js.map +1 -1
  77. package/dist/lib/engine-version.d.ts +1 -1
  78. package/dist/lib/engine-version.js +1 -1
  79. package/dist/lib/engine-version.js.map +1 -1
  80. package/dist/lib/i18n/messages.de.js +13 -1
  81. package/dist/lib/i18n/messages.de.js.map +1 -1
  82. package/dist/lib/i18n/messages.en.d.ts +11 -0
  83. package/dist/lib/i18n/messages.en.js +14 -1
  84. package/dist/lib/i18n/messages.en.js.map +1 -1
  85. package/dist/lib/operations/cms-persistence.d.ts +80 -35
  86. package/dist/lib/operations/cms-persistence.js +348 -85
  87. package/dist/lib/operations/cms-persistence.js.map +1 -1
  88. package/dist/lib/persistence/convex-adapter.js +54 -8
  89. package/dist/lib/persistence/convex-adapter.js.map +1 -1
  90. package/dist/lib/persona/labels.js +1 -0
  91. package/dist/lib/persona/labels.js.map +1 -1
  92. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"collection-content.js","sourceRoot":"","sources":["../../../src/lib/data/collection-content.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,UAAU,EACV,aAAa,EACb,YAAY,EACZ,aAAa,GACd,MAAM,yBAAyB,CAAA;AAWhC,OAAO,EACL,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,oBAAoB,EACpB,cAAc,GACf,MAAM,0BAA0B,CAAA;AAYjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AAGnE,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MA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AAK,KAAK,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KACrE,CAAA;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,iBAAiB,CAC/B,GAAgB,EAChB,SAAiB,aAAa,EAAE,EAChC,cAA2B,WAAW;IAEtC,OAAO,SAAS,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAA;AACxD,CAAC;AAQD,8EAA8E;AAC9E,MAAM,UAAU,qBAAqB,CAAC,YAAoB;IACxD,MAAM,UAAU,GAAG,oBAAoB,CAAC,YAAY,CAAC,CAAA;IACrD,MAAM,MAAM,GAAG,sBAAsB,CAAC,YAAY,CAAC,CAAA;IACnD,IAAI,CAAC,MAAM,CAAC,EAAE;QAAE,OAAO,EAAE,CAAA;IACzB,2EAA2E;IAC3E,2EAA2E;IAC3E,OAAO,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QACpC,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,oBAAoB,CAAC,UAAU,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE;KAC3E,CAAC,CAAC,CAAA;AACL,CAAC","sourcesContent":["import {\n createContentClient,\n createContentContext,\n queryError,\n validateLimit,\n validateSort,\n validateWhere,\n} from '@elytracms/core/content'\nimport type {\n ContentClient,\n ContentDocumentSource,\n ContentLookup,\n ContentQueryError,\n GetDocumentResult,\n ListDocumentsQuery,\n ListDocumentsResult,\n ResolvedDocument,\n} from '@elytracms/core/content'\nimport {\n documentKey,\n localeSchema,\n parseLocaleConfig,\n perspectiveKey,\n resolveDocumentTitle,\n valuesInLocale,\n} from '@elytracms/core/cms-core'\nimport type {\n CmsDocument,\n CollectionDef,\n DocumentRef,\n Locale,\n LocaleConfig,\n OrphanedCollection,\n Perspective,\n RouteRecord,\n} from '@elytracms/core/cms-core'\nimport type { AssetRecord } from '@elytracms/core/persistence'\nimport { listingRequestOf } from '@elytracms/core/runtime-renderer'\nimport type { ListingQuery } from '@elytracms/core/runtime-renderer'\nimport type { Clock } from '@elytracms/core/determinism'\nimport { getStudioLocale, getStudioLocaleConfig } from '../locale/locale-store'\n\n/**\n * The studio's content delivery engine for canvas previews (EC-166).\n *\n * Repeating sections and template pages preview *delivery-shaped* documents —\n * the exact shape `@elytracms/core/content` serves in production — so the canvas\n * shows what publishing will show. This module wires the canonical content\n * client (closed AD-3 query vocabulary, published perspective, EC-018 locale\n * fallback, depth-1 population, resolved assets) over a **content session**:\n *\n * - Convex mode: the project-session gate (`components/studio/project-session`)\n * configures the session with the project's HYDRATED schema + documents, so\n * \"Preview with\" lists and section previews show the live content — never\n * fixture titles (EC-177 gap 1).\n * - Playground mode (EC-361): the SAME hydration loader runs over the seeded\n * in-memory adapter (through operations — AD-17), so canvas listing/relation\n * population resolves from the in-memory session documents with identical\n * semantics. With no session configured (tests, boot instants, no persisted\n * content) the engine serves nothing.\n *\n * Nothing here invents query semantics; both modes go through the same\n * canonical client.\n */\n\n/** The schema + documents the preview engine serves (one project session). */\nexport interface ContentSessionState {\n collections: readonly CollectionDef[]\n documents: readonly CmsDocument[]\n /**\n * Published document keys via the version POINTER (EC-224). When present, the\n * preview's published perspective resolves by the pin — never the flat\n * `state` enum — so it matches what delivery serves. Absent (playground\n * fixtures / tests) → the rows' own `state` gates the perspective, unchanged.\n */\n publishedKeys?: readonly string[]\n /**\n * Locale config of the session content — the project's own, composed by\n * `contentSessionOf` from `elytra.config.ts`. Absent (a kit session, tests) →\n * the ambient studio config, then the single locale being asked for; EC-479\n * retired the engine's `sampleLocaleConfig` fallback here.\n */\n localeConfig?: LocaleConfig\n /**\n * The project's config-sourced routes (EC-207). Wired into the content client so\n * the canvas preview's `resolveLink` (EC-291) derives a rich-text link's URL from\n * the SAME routes delivery serves — the studio-live half of the host link bake.\n * Absent (playground/tests) → no routes, so `resolveLink` returns null and a\n * reference link degrades to the visible `unresolved-ref` issue.\n */\n routes?: readonly RouteRecord[]\n /**\n * The project's asset records (assets table). Wired into the lookup so the\n * content client resolves `asset`-typed FIELDS on listing/relation results\n * (e.g. a ProductGrid product's `gallery`) to delivery shape — the same assets\n * the renderer's `resolveAsset` reads for static props (EC-262). Absent\n * (playground/tests) → assets come only from `asset`-collection fixture docs.\n */\n assets?: readonly AssetRecord[]\n /**\n * EC-606 — the stored rows the session does NOT serve: per undeclared collection,\n * how many rows and how many published (`HydratedCms.orphans`, carried here by\n * `contentSessionOf`'s spread). The preview engine never reads it. It rides this\n * session because this is the one hydrated-content channel that reaches the\n * section rail in both modes: the rail renders outside `ProjectSessionProvider`,\n * so it cannot read the project session context, and a second documents query\n * would be a parallel data flow (AD-17). Read via {@link contentSessionOrphans}.\n * Absent (a kit session, tests) → none.\n */\n orphans?: readonly OrphanedCollection[]\n}\n\n/**\n * Default (no-session) collection schema: EMPTY. The studio ships no demo content\n * (Oli, 2026-06-19) — with no backend/content session configured, there is nothing\n * to preview, and the studio says so rather than serving fixtures. A real project's\n * collections + documents arrive via {@link configureContentSession} in BOTH modes\n * (EC-361): Convex hydration, or the playground's seeded in-memory adapter through\n * the same loader.\n */\nexport const playgroundCollections: readonly CollectionDef[] = []\n\nlet contentSession: ContentSessionState | null = null\nlet lookup: ContentLookup = createLookup(playgroundCollections, [], [])\n// Keyed by locale + perspective (EC-300) + the resolved locale CONFIG (EC-479) —\n// one deterministic client per distinct resolution context. See `clientFor`.\nconst clients = new Map<string, ContentClient>()\n\n// EC-460: a monotonically increasing session epoch + listener set, so a REACT\n// surface (the canvas render context) can re-render when the session is\n// re-pointed at fresher content. The session itself stays a module global (the\n// EC-361 design); this only makes \"it changed\" observable — `configureContentSession`\n// remains the single setter.\nlet sessionEpoch = 0\nconst sessionListeners = new Set<() => void>()\n\n/** The current content-session epoch — bumps on every `configureContentSession`. */\nexport function contentSessionEpoch(): number {\n return sessionEpoch\n}\n\n/**\n * Subscribe to content-session swaps (EC-460). The listener fires after every\n * `configureContentSession`; returns the unsubscribe. Shaped for\n * `useSyncExternalStore(subscribeContentSession, contentSessionEpoch)`.\n */\nexport function subscribeContentSession(listener: () => void): () => void {\n sessionListeners.add(listener)\n return () => sessionListeners.delete(listener)\n}\n\n/**\n * Point the preview engine at a project's hydrated content — Convex hydration\n * or the playground's in-memory persisted state (EC-361), both through the same\n * `loadHydratedCms` loader — or back at the empty no-session default (`null`).\n */\nexport function configureContentSession(next: ContentSessionState | null): void {\n contentSession = next\n lookup = next\n ? createLookup(next.collections, next.documents, next.publishedKeys, next.assets, next.localeConfig)\n : createLookup(playgroundCollections, [], [])\n clients.clear()\n sessionEpoch += 1\n for (const listener of [...sessionListeners]) listener()\n}\n\n/** Whether a hydrated content session is configured (Convex mode). */\nexport function hasContentSession(): boolean {\n return contentSession !== null\n}\n\nconst NO_ORPHANS: readonly OrphanedCollection[] = []\n\n/**\n * The active session's orphaned collections (EC-606), or an empty list with no\n * session. Referentially stable between `configureContentSession` calls (the\n * session's own array, or one shared empty constant), so it is a valid\n * `useSyncExternalStore(subscribeContentSession, contentSessionOrphans, …)`\n * snapshot — the rail foot reads it exactly that way.\n */\nexport function contentSessionOrphans(): readonly OrphanedCollection[] {\n return contentSession?.orphans ?? NO_ORPHANS\n}\n\n/** The server snapshot for {@link contentSessionOrphans}: no session exists during SSR. */\nexport function serverContentSessionOrphans(): readonly OrphanedCollection[] {\n return NO_ORPHANS\n}\n\n/** The collections the preview engine currently serves (session or fixtures). */\nfunction activeCollections(): readonly CollectionDef[] {\n return contentSession?.collections ?? playgroundCollections\n}\n\n/**\n * The sentinel {@link previewLocale} yields when NOTHING has declared a locale —\n * no ambient studio config, no content session. It is not a locale code and\n * matches no stored key, which is the point: with no session the lookup is empty\n * (`playgroundCollections` is `[]`), so every query already resolves to nothing\n * and this only fills `CacheTags.locale`, which no studio surface reads. EC-479:\n * the engine used to answer this question with its `sampleLocaleConfig` fixture's\n * `en` — a locale nobody chose, standing in for the project's own.\n */\nconst NO_LOCALE = ''\n\n/**\n * The locale a canvas preview resolves in, when the caller names none: the\n * ambient studio locale (installed from the PROJECT's config by `CmsProvider`),\n * else the active content session's own declared default (surfaces that render\n * outside a CMS session — the Components view's previews — still resolve in the\n * project's locale), else {@link NO_LOCALE}. Never an engine fixture.\n */\nfunction previewLocale(): Locale {\n return getStudioLocale() ?? contentSession?.localeConfig?.default ?? NO_LOCALE\n}\n\n/**\n * The locale set a preview resolves fallbacks against (EC-018): the session's own\n * declaration, else the ambient studio config (the project's, via `elytra.config.ts`),\n * else the single locale actually being asked for.\n *\n * That last step is a DERIVATION, not an invention — it says \"the only locale we\n * know of is the one you named\", so the default-locale fallback is the requested\n * locale itself (a no-op) and a localized read falls through to `doc.values`.\n * Before EC-479 this line read `?? sampleLocaleConfig`, which silently declared\n * every locale-less studio bilingual `en/de` and resolved fallbacks through an `en`\n * no project had chosen. Only reached with no session AND no installed config, so\n * no stored key is ever written against it.\n */\nfunction activeLocaleConfig(locale: Locale): LocaleConfig {\n return contentSession?.localeConfig ?? getStudioLocaleConfig() ?? requestedLocaleOnly(locale)\n}\n\n/**\n * The single-locale derivation above, through the one constructor (EC-580:\n * `LocaleConfig` is parse-only). {@link NO_LOCALE} — or anything else that is not\n * a locale code — becomes `und`, BCP 47's own \"undetermined\", which likewise\n * matches no stored key.\n */\nfunction requestedLocaleOnly(locale: Locale): LocaleConfig {\n const code = localeSchema.safeParse(locale).success ? locale : 'und'\n return parseLocaleConfig({ default: code, locales: [code] })\n}\n\n/** Resolve a collection in the active content session (fixtures in playground). */\nexport function playgroundCollection(id: string): CollectionDef | undefined {\n return activeCollections().find((collection) => collection.id === id)\n}\n\n/**\n * Overlay the active session's canonical `filterable` declarations onto a\n * schema that doesn't carry any of its own. The inspector hands the Content\n * tab fixture collection defs; the filter/sort pickers must offer exactly the\n * EC-143 declaration set the delivery engine enforces, so both ends agree. A\n * collection that declares its own filterable fields is left untouched.\n */\nexport function withPlaygroundFilterable(\n collections: readonly CollectionDef[],\n): readonly CollectionDef[] {\n return collections.map((collection) => {\n if (collection.fields.some((field) => field.filterable === true)) return collection\n const counterpart = playgroundCollection(collection.id)\n if (counterpart === undefined) return collection\n const flagged = new Set(\n counterpart.fields.filter((field) => field.filterable === true).map((field) => field.name),\n )\n if (flagged.size === 0) return collection\n return {\n ...collection,\n fields: collection.fields.map((field) =>\n flagged.has(field.name) ? { ...field, filterable: true } : field,\n ),\n }\n })\n}\n\n/**\n * Synthesize the persistence-shaped asset record the asset resolver reads. EC-580:\n * the record's single alt (`meta.alt`, EC-587) is the DEFAULT locale's displayed value\n * (`valuesInLocale`, the project's config default) — it used to read\n * `localized.en.alt` whatever the project's locales were (MODE F5b, \"further\n * evidence\"), so a `de`-default project's previews had no alt and a shared `alt`\n * was never read. Without a locale model (no session config) only the shared bag\n * can be read.\n */\nfunction assetRecordOf(\n doc: CmsDocument,\n collection: CollectionDef | undefined,\n locales: LocaleConfig | undefined,\n): AssetRecord {\n const values = doc.values\n const alt =\n collection && locales\n ? valuesInLocale(collection, doc, locales.default, locales).alt\n : values.alt\n return {\n id: doc.id,\n projectId: 'playground',\n filename: typeof values.filename === 'string' ? values.filename : doc.id,\n contentType: 'image/png',\n byteSize: 0,\n // EC-587: an asset's alt lives in `meta` (its one home), never the legacy column.\n ...(typeof alt === 'string' ? { meta: { alt } } : {}),\n storageKey: typeof values.url === 'string' ? values.url : doc.id,\n createdAt: '2026-01-01T00:00:00.000Z',\n updatedAt: '2026-01-01T00:00:00.000Z',\n }\n}\n\nfunction createLookup(\n collectionDefs: readonly CollectionDef[],\n documents: readonly CmsDocument[],\n publishedKeys?: readonly string[],\n assetRecords?: readonly AssetRecord[],\n locales?: LocaleConfig,\n): ContentLookup {\n const collections = new Map(collectionDefs.map((c) => [c.id, c]))\n // EC-224: published-ness is the version POINTER, not the flat `state` enum.\n // A hydrated session hands `publishedKeys` (the pinned set) → wrap each row as\n // a `DocumentHistory` so the published perspective resolves by the pin (the\n // live row is always a draft now) with ZERO dependence on `state`. Without a\n // pointer set (playground fixtures / tests) we keep bare rows, whose own\n // `state` gates the published perspective — byte-identical to before.\n const published = publishedKeys ? new Set(publishedKeys) : null\n const toSource = (doc: CmsDocument): ContentDocumentSource => {\n if (!published) return doc\n return published.has(documentKey({ collection: doc.collection, id: doc.id }))\n ? { draft: doc, published: doc, versions: [] }\n : { draft: doc, published: undefined, versions: [] }\n }\n const byKey = new Map(\n documents.map((doc) => [`${doc.collection}:${doc.id}`, toSource(doc)] as const),\n )\n // Asset resolution source for `asset`-typed FIELDS on resolved documents\n // (listing/relation results, e.g. a product's `gallery`). Two sources, real\n // records last so they win: (1) `asset`-collection fixture documents — how\n // playground/tests model assets; (2) the project's real asset-table records\n // (EC-262) — a Convex session has its assets here, NOT as `asset` documents,\n // so without these the content client resolves no nested image.\n const assets = new Map<string, AssetRecord>()\n for (const doc of documents) {\n if (doc.collection === 'asset') {\n assets.set(doc.id, assetRecordOf(doc, collections.get(doc.collection), locales))\n }\n }\n for (const record of assetRecords ?? []) assets.set(record.id, record)\n return {\n collection: (id) => collections.get(id),\n document: (ref) => byKey.get(`${ref.collection}:${ref.id}`),\n documents: (collectionId) =>\n documents.filter((doc) => doc.collection === collectionId).map(toSource),\n asset: (id) => assets.get(id),\n // Prefer the record's resolved servable `url` — the one the renderer's\n // resolveAsset reads (EC-262). Real asset-table records carry a Convex blob\n // locator in `storageKey` and the servable URL in `url`; fixture/`asset`-document\n // records (assetRecordOf) leave `url` unset and store the servable url in\n // `storageKey`. Falling back keeps both correct.\n assetUrl: (asset) => asset.url ?? asset.storageKey,\n }\n}\n\n/**\n * One deterministic client per (locale, perspective): EC-018 locale fallback,\n * draft-or-published perspective (EC-300/AD-16, default `'published'`). The canvas is\n * draft-coherent: the editable Draft view resolves references against the draft\n * perspective (`DRAFT_PERSPECTIVE` — a just-made reusable shows immediately), the\n * read-only Published view against `'published'` (an honest preview of what delivery\n * serves; an unpublished hard ref shows the in-canvas placeholder). Delivery stays\n * published-only — this does not weaken `live-is-published-only`. The studio's\n * ambient active locale (EC-176, `lib/locale`) picks the locale at query time, so the\n * canvas previews follow the locale switcher exactly like delivery would; the canvas's\n * Draft/Published view picks the perspective. The cache resets whenever the content\n * session changes.\n */\nfunction clientFor(locale: Locale, perspective: Perspective = 'published'): ContentClient {\n const locales = activeLocaleConfig(locale)\n // EC-479: the locale CONFIG is part of the client's identity now — it may come\n // from the ambient studio store, which changes independently of the session the\n // cache is cleared on, so keying by locale alone could serve a client built\n // against a superseded locale set.\n const key = `${locale}:${perspectiveKey(perspective)}:${locales.default}|${locales.locales.join(',')}`\n const existing = clients.get(key)\n if (existing) return existing\n const client = createContentClient({\n lookup,\n context: createContentContext({\n locale,\n perspective,\n locales,\n }),\n // EC-291: the routes a rich-text link resolves against (config-sourced) — the\n // studio-live half of the host link bake.\n routes: contentSession?.routes ?? [],\n })\n clients.set(key, client)\n return client\n}\n\n/**\n * Run a closed-vocabulary list query (AD-3: eq/in/lt/lte/gt/gte, AND-only,\n * filterable fields only) and return the delivery-shaped result. Invalid\n * queries come back as structured errors — never thrown, never silently\n * widened. Resolves in the studio's active locale unless one is passed.\n */\nexport function runCollectionListQuery(\n collectionId: string,\n query: ListDocumentsQuery = {},\n locale: Locale = previewLocale(),\n): ListDocumentsResult {\n return clientFor(locale).listDocuments(collectionId, query)\n}\n\n/** Resolve one document (by id or slug) into delivery shape. */\nexport function getCollectionDocument(\n collectionId: string,\n idOrSlug: string,\n locale: Locale = previewLocale(),\n): GetDocumentResult {\n return clientFor(locale).getDocument(collectionId, idOrSlug)\n}\n\n/**\n * Populate a composition-node `relation` prop to delivery shape for the canvas\n * (EC-254) — the studio analog of the host's baked relations map. Resolves the\n * ref through the active session's client (published perspective, active locale),\n * so the canvas previews a block's picked documents (a ProductGrid's products, a\n * Reusable's element) exactly as delivery renders them. `null` when the target is\n * missing or not visible → the block degrades to its own empty state.\n */\nexport function resolveCanvasRelation(\n ref: DocumentRef,\n locale: Locale = previewLocale(),\n perspective: Perspective = 'published',\n): ResolvedDocument | null {\n return clientFor(locale, perspective).resolveRelation(ref)\n}\n\n/** The real clock — the canvas boundary's default; tests inject a fixed one (EC-581 6a). */\nconst systemClock: Clock = () => new Date().toISOString()\n\n/**\n * A listing query as `listDocuments` input (EC-581 6a): executed through\n * `listingRequestOf` — the phase the delivery host runs too, so canvas and site\n * build the identical request — with `{ now: true }` read from `clock`. The\n * operands are JSON bound from authored props; the cast hands them to the one\n * validator (`validateWhere`/`validateLimit`), which reports anything invalid.\n */\nfunction listDocumentsQueryOf(query: ListingQuery, clock: Clock): ListDocumentsQuery {\n const request = listingRequestOf(query, clock)\n return {\n where: request.where as ListDocumentsQuery['where'],\n ...(request.sort ? { sort: request.sort } : {}),\n ...(request.limit !== undefined ? { limit: request.limit as number } : {}),\n }\n}\n\n/**\n * Resolve a listing block's query to its documents for the canvas (EC-255) — the\n * studio analog of the host's baked listings map. Runs the query (collection +\n * AND-only `where`, optional sort/limit; EC-581 6a: `now` read from `clock`)\n * through the active session's client (published perspective, active locale), so\n * the canvas previews a dynamic grid (a ProductGrid keyed to a category) exactly as\n * delivery renders it. An invalid query (structured, never thrown) or a non-list\n * lookup yields `[]` → the block's empty state, and the canvas notice\n * ({@link validateCanvasListingQuery}) says why. Reuses the same `listDocuments`\n * path as `runCollectionListQuery`.\n */\nexport function resolveCanvasListing(\n query: ListingQuery,\n locale: Locale = previewLocale(),\n perspective: Perspective = 'published',\n clock: Clock = systemClock,\n): ResolvedDocument[] {\n const result = clientFor(locale, perspective).listDocuments(\n query.collection,\n listDocumentsQueryOf(query, clock),\n )\n return result.ok ? result.documents : []\n}\n\n/**\n * Statically validate a listing block's query against the ACTIVE session schema\n * (EC-460, the never-silent rule): the exact `validateWhere`/`validateSort`/\n * `validateLimit` checks `listDocuments` runs, WITHOUT executing the query — so\n * the canvas can surface a config-invalid listing (a filter/sort field the\n * collection doesn't declare `filterable`, an unknown collection) as a visible\n * notice instead of the block's indistinguishable empty state. With no content\n * session configured (boot instants, fixtures) there is no schema to judge\n * against, so it reports nothing rather than false-flagging every listing.\n */\nexport function validateCanvasListingQuery(\n query: ListingQuery,\n clock: Clock = systemClock,\n): ContentQueryError[] {\n if (contentSession === null) return []\n const collection = playgroundCollection(query.collection)\n if (!collection) {\n return [\n queryError(\n 'unknown-collection',\n `Collection \"${query.collection}\" is not defined.`,\n ['collection'],\n undefined,\n { key: 'content.queryError.unknownCollection', vars: { collection: query.collection } },\n ),\n ]\n }\n // EC-581 6a: judge the request the query EXECUTES as (`now` bound), with the\n // same three validators `listDocuments` runs — notice and execution agree.\n const request = listDocumentsQueryOf(query, clock)\n return [\n ...(request.where ? validateWhere(collection, request.where) : []),\n ...(request.sort ? validateSort(collection, request.sort) : []),\n ...(request.limit !== undefined ? validateLimit(request.limit) : []),\n ]\n}\n\n/**\n * Resolve a rich-text internal link's target document to its URL path for the canvas\n * (EC-291) — the studio analog of the host's baked links map. Derives the URL through\n * the active session's client (published perspective, active locale, config-sourced\n * routes), so the canvas previews a `{type:'reference'}` link's `href` exactly as\n * delivery serves it. `null` when the target is unpublished, missing, or addressed by\n * no route → the rich-text renderer shows the EC-290 `unresolved-ref` issue. Reuses\n * the same `resolveLink` path as the host bake, so both agree on the derived URL.\n */\nexport function resolveCanvasLink(\n ref: DocumentRef,\n locale: Locale = previewLocale(),\n perspective: Perspective = 'published',\n): string | null {\n return clientFor(locale, perspective).resolveLink(ref)\n}\n\n/** A pickable entry of a collection (the template-page preview switcher). */\nexport interface CollectionEntrySummary {\n id: string\n label: string\n}\n\n/** Published entries of a collection, labeled by the schema's title field. */\nexport function listCollectionEntries(collectionId: string): CollectionEntrySummary[] {\n const collection = playgroundCollection(collectionId)\n const result = runCollectionListQuery(collectionId)\n if (!result.ok) return []\n // EC-242: label via the shared identity resolver (string `titleField` or a\n // function pattern), over the delivery-shape values; falls back to the id.\n return result.documents.map((doc) => ({\n id: doc.id,\n label: collection ? resolveDocumentTitle(collection, doc, doc.id) : doc.id,\n }))\n}\n"]}
1
+ {"version":3,"file":"collection-content.js","sourceRoot":"","sources":["../../../src/lib/data/collection-content.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,UAAU,EACV,aAAa,EACb,YAAY,EACZ,aAAa,GACd,MAAM,yBAAyB,CAAA;AAWhC,OAAO,EACL,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,oBAAoB,EACpB,cAAc,GACf,MAAM,0BAA0B,CAAA;AAWjC,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAE3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AAGnE,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AAwE/E;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAA6B,EAAE,CAAA;AAEjE,IAAI,cAAc,GAA+B,IAAI,CAAA;AACrD,IAAI,MAAM,GAAkB,YAAY,CAAC,qBAAqB,EAAE,EAAE,EAAE,EAAE,CAAC,CAAA;AACvE,iFAAiF;AACjF,6EAA6E;AAC7E,MAAM,OAAO,GAAG,IAAI,GAAG,EAAyB,CAAA;AAEhD,8EAA8E;AAC9E,wEAAwE;AACxE,+EAA+E;AAC/E,sFAAsF;AACtF,6BAA6B;AAC7B,IAAI,YAAY,GAAG,CAAC,CAAA;AACpB,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAAc,CAAA;AAE9C,oFAAoF;AACpF,MAAM,UAAU,mBAAmB;IACjC,OAAO,YAAY,CAAA;AACrB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,QAAoB;IAC1D,gBAAgB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;IAC9B,OAAO,GAAG,EAAE,CAAC,gBAAgB,CAAC,MAAM,CAAC,QAAQ,C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AAS,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QACpC,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,oBAAoB,CAAC,UAAU,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE;KAC3E,CAAC,CAAC,CAAA;AACL,CAAC","sourcesContent":["import {\n createContentClient,\n createContentContext,\n queryError,\n validateLimit,\n validateSort,\n validateWhere,\n} from '@elytracms/core/content'\nimport type {\n ContentClient,\n ContentDocumentSource,\n ContentLookup,\n ContentQueryError,\n GetDocumentResult,\n ListDocumentsQuery,\n ListDocumentsResult,\n ResolvedDocument,\n} from '@elytracms/core/content'\nimport {\n documentKey,\n localeSchema,\n parseLocaleConfig,\n perspectiveKey,\n resolveDocumentTitle,\n valuesInLocale,\n} from '@elytracms/core/cms-core'\nimport type {\n CmsDocument,\n CollectionDef,\n DocumentRef,\n Locale,\n LocaleConfig,\n OrphanedCollection,\n Perspective,\n RouteRecord,\n} from '@elytracms/core/cms-core'\nimport { assetMetaLens } from '@elytracms/core/persistence'\nimport type { AssetRecord } from '@elytracms/core/persistence'\nimport { listingRequestOf } from '@elytracms/core/runtime-renderer'\nimport type { ListingQuery } from '@elytracms/core/runtime-renderer'\nimport type { Clock } from '@elytracms/core/determinism'\nimport { getStudioLocale, getStudioLocaleConfig } from '../locale/locale-store'\n\n/**\n * The studio's content delivery engine for canvas previews (EC-166).\n *\n * Repeating sections and template pages preview *delivery-shaped* documents —\n * the exact shape `@elytracms/core/content` serves in production — so the canvas\n * shows what publishing will show. This module wires the canonical content\n * client (closed AD-3 query vocabulary, published perspective, EC-018 locale\n * fallback, depth-1 population, resolved assets) over a **content session**:\n *\n * - Convex mode: the project-session gate (`components/studio/project-session`)\n * configures the session with the project's HYDRATED schema + documents, so\n * \"Preview with\" lists and section previews show the live content — never\n * fixture titles (EC-177 gap 1).\n * - Playground mode (EC-361): the SAME hydration loader runs over the seeded\n * in-memory adapter (through operations — AD-17), so canvas listing/relation\n * population resolves from the in-memory session documents with identical\n * semantics. With no session configured (tests, boot instants, no persisted\n * content) the engine serves nothing.\n *\n * Nothing here invents query semantics; both modes go through the same\n * canonical client.\n */\n\n/** The schema + documents the preview engine serves (one project session). */\nexport interface ContentSessionState {\n collections: readonly CollectionDef[]\n documents: readonly CmsDocument[]\n /**\n * Published document keys via the version POINTER (EC-224). When present, the\n * preview's published perspective resolves by the pin — never the flat\n * `state` enum — so it matches what delivery serves. Absent (playground\n * fixtures / tests) → the rows' own `state` gates the perspective, unchanged.\n */\n publishedKeys?: readonly string[]\n /**\n * Locale config of the session content — the project's own, composed by\n * `contentSessionOf` from `elytra.config.ts`. Absent (a kit session, tests) →\n * the ambient studio config, then the single locale being asked for; EC-479\n * retired the engine's `sampleLocaleConfig` fallback here.\n */\n localeConfig?: LocaleConfig\n /**\n * The project's config-sourced routes (EC-207). Wired into the content client so\n * the canvas preview's `resolveLink` (EC-291) derives a rich-text link's URL from\n * the SAME routes delivery serves — the studio-live half of the host link bake.\n * Absent (playground/tests) → no routes, so `resolveLink` returns null and a\n * reference link degrades to the visible `unresolved-ref` issue.\n */\n routes?: readonly RouteRecord[]\n /**\n * The project's asset records (assets table). Wired into the lookup so the\n * content client resolves `asset`-typed FIELDS on listing/relation results\n * (e.g. a ProductGrid product's `gallery`) to delivery shape — the same assets\n * the renderer's `resolveAsset` reads for static props (EC-262). Absent\n * (playground/tests) → assets come only from `asset`-collection fixture docs.\n */\n assets?: readonly AssetRecord[]\n /**\n * EC-606 — the stored rows the session does NOT serve: per undeclared collection,\n * how many rows and how many published (`HydratedCms.orphans`, carried here by\n * `contentSessionOf`'s spread). The preview engine never reads it. It rides this\n * session because this is the one hydrated-content channel that reaches the\n * section rail in both modes: the rail renders outside `ProjectSessionProvider`,\n * so it cannot read the project session context, and a second documents query\n * would be a parallel data flow (AD-17). Read via {@link contentSessionOrphans}.\n * Absent (a kit session, tests) → none.\n */\n orphans?: readonly OrphanedCollection[]\n}\n\n/**\n * Default (no-session) collection schema: EMPTY. The studio ships no demo content\n * (Oli, 2026-06-19) — with no backend/content session configured, there is nothing\n * to preview, and the studio says so rather than serving fixtures. A real project's\n * collections + documents arrive via {@link configureContentSession} in BOTH modes\n * (EC-361): Convex hydration, or the playground's seeded in-memory adapter through\n * the same loader.\n */\nexport const playgroundCollections: readonly CollectionDef[] = []\n\nlet contentSession: ContentSessionState | null = null\nlet lookup: ContentLookup = createLookup(playgroundCollections, [], [])\n// Keyed by locale + perspective (EC-300) + the resolved locale CONFIG (EC-479) —\n// one deterministic client per distinct resolution context. See `clientFor`.\nconst clients = new Map<string, ContentClient>()\n\n// EC-460: a monotonically increasing session epoch + listener set, so a REACT\n// surface (the canvas render context) can re-render when the session is\n// re-pointed at fresher content. The session itself stays a module global (the\n// EC-361 design); this only makes \"it changed\" observable — `configureContentSession`\n// remains the single setter.\nlet sessionEpoch = 0\nconst sessionListeners = new Set<() => void>()\n\n/** The current content-session epoch — bumps on every `configureContentSession`. */\nexport function contentSessionEpoch(): number {\n return sessionEpoch\n}\n\n/**\n * Subscribe to content-session swaps (EC-460). The listener fires after every\n * `configureContentSession`; returns the unsubscribe. Shaped for\n * `useSyncExternalStore(subscribeContentSession, contentSessionEpoch)`.\n */\nexport function subscribeContentSession(listener: () => void): () => void {\n sessionListeners.add(listener)\n return () => sessionListeners.delete(listener)\n}\n\n/**\n * Point the preview engine at a project's hydrated content — Convex hydration\n * or the playground's in-memory persisted state (EC-361), both through the same\n * `loadHydratedCms` loader — or back at the empty no-session default (`null`).\n */\nexport function configureContentSession(next: ContentSessionState | null): void {\n contentSession = next\n lookup = next\n ? createLookup(next.collections, next.documents, next.publishedKeys, next.assets, next.localeConfig)\n : createLookup(playgroundCollections, [], [])\n clients.clear()\n sessionEpoch += 1\n for (const listener of [...sessionListeners]) listener()\n}\n\n/** Whether a hydrated content session is configured (Convex mode). */\nexport function hasContentSession(): boolean {\n return contentSession !== null\n}\n\nconst NO_ORPHANS: readonly OrphanedCollection[] = []\n\n/**\n * The active session's orphaned collections (EC-606), or an empty list with no\n * session. Referentially stable between `configureContentSession` calls (the\n * session's own array, or one shared empty constant), so it is a valid\n * `useSyncExternalStore(subscribeContentSession, contentSessionOrphans, …)`\n * snapshot — the rail foot reads it exactly that way.\n */\nexport function contentSessionOrphans(): readonly OrphanedCollection[] {\n return contentSession?.orphans ?? NO_ORPHANS\n}\n\n/** The server snapshot for {@link contentSessionOrphans}: no session exists during SSR. */\nexport function serverContentSessionOrphans(): readonly OrphanedCollection[] {\n return NO_ORPHANS\n}\n\n/** The collections the preview engine currently serves (session or fixtures). */\nfunction activeCollections(): readonly CollectionDef[] {\n return contentSession?.collections ?? playgroundCollections\n}\n\n/**\n * The sentinel {@link previewLocale} yields when NOTHING has declared a locale —\n * no ambient studio config, no content session. It is not a locale code and\n * matches no stored key, which is the point: with no session the lookup is empty\n * (`playgroundCollections` is `[]`), so every query already resolves to nothing\n * and this only fills `CacheTags.locale`, which no studio surface reads. EC-479:\n * the engine used to answer this question with its `sampleLocaleConfig` fixture's\n * `en` — a locale nobody chose, standing in for the project's own.\n */\nconst NO_LOCALE = ''\n\n/**\n * The locale a canvas preview resolves in, when the caller names none: the\n * ambient studio locale (installed from the PROJECT's config by `CmsProvider`),\n * else the active content session's own declared default (surfaces that render\n * outside a CMS session — the Components view's previews — still resolve in the\n * project's locale), else {@link NO_LOCALE}. Never an engine fixture.\n */\nfunction previewLocale(): Locale {\n return getStudioLocale() ?? contentSession?.localeConfig?.default ?? NO_LOCALE\n}\n\n/**\n * The locale set a preview resolves fallbacks against (EC-018): the session's own\n * declaration, else the ambient studio config (the project's, via `elytra.config.ts`),\n * else the single locale actually being asked for.\n *\n * That last step is a DERIVATION, not an invention — it says \"the only locale we\n * know of is the one you named\", so the default-locale fallback is the requested\n * locale itself (a no-op) and a localized read falls through to `doc.values`.\n * Before EC-479 this line read `?? sampleLocaleConfig`, which silently declared\n * every locale-less studio bilingual `en/de` and resolved fallbacks through an `en`\n * no project had chosen. Only reached with no session AND no installed config, so\n * no stored key is ever written against it.\n */\nfunction activeLocaleConfig(locale: Locale): LocaleConfig {\n return contentSession?.localeConfig ?? getStudioLocaleConfig() ?? requestedLocaleOnly(locale)\n}\n\n/**\n * The single-locale derivation above, through the one constructor (EC-580:\n * `LocaleConfig` is parse-only). {@link NO_LOCALE} — or anything else that is not\n * a locale code — becomes `und`, BCP 47's own \"undetermined\", which likewise\n * matches no stored key.\n */\nfunction requestedLocaleOnly(locale: Locale): LocaleConfig {\n const code = localeSchema.safeParse(locale).success ? locale : 'und'\n return parseLocaleConfig({ default: code, locales: [code] })\n}\n\n/** Resolve a collection in the active content session (fixtures in playground). */\nexport function playgroundCollection(id: string): CollectionDef | undefined {\n return activeCollections().find((collection) => collection.id === id)\n}\n\n/**\n * Overlay the active session's canonical `filterable` declarations onto a\n * schema that doesn't carry any of its own. The inspector hands the Content\n * tab fixture collection defs; the filter/sort pickers must offer exactly the\n * EC-143 declaration set the delivery engine enforces, so both ends agree. A\n * collection that declares its own filterable fields is left untouched.\n */\nexport function withPlaygroundFilterable(\n collections: readonly CollectionDef[],\n): readonly CollectionDef[] {\n return collections.map((collection) => {\n if (collection.fields.some((field) => field.filterable === true)) return collection\n const counterpart = playgroundCollection(collection.id)\n if (counterpart === undefined) return collection\n const flagged = new Set(\n counterpart.fields.filter((field) => field.filterable === true).map((field) => field.name),\n )\n if (flagged.size === 0) return collection\n return {\n ...collection,\n fields: collection.fields.map((field) =>\n flagged.has(field.name) ? { ...field, filterable: true } : field,\n ),\n }\n })\n}\n\n/**\n * Synthesize the persistence-shaped asset record the asset resolver reads. EC-580:\n * the record's single alt (`meta.alt`, EC-587) is the DEFAULT locale's displayed value\n * (`valuesInLocale`, the project's config default) — it used to read\n * `localized.en.alt` whatever the project's locales were (MODE F5b, \"further\n * evidence\"), so a `de`-default project's previews had no alt and a shared `alt`\n * was never read. Without a locale model (no session config) only the shared bag\n * can be read.\n */\nfunction assetRecordOf(\n doc: CmsDocument,\n collection: CollectionDef | undefined,\n locales: LocaleConfig | undefined,\n): AssetRecord {\n const values = doc.values\n const alt =\n collection && locales\n ? valuesInLocale(collection, doc, locales.default, locales).alt\n : values.alt\n return {\n id: doc.id,\n projectId: 'playground',\n filename: typeof values.filename === 'string' ? values.filename : doc.id,\n contentType: 'image/png',\n byteSize: 0,\n // EC-587: an asset's alt lives in `meta` (its one home), never the legacy column.\n ...(typeof alt === 'string' ? { meta: { alt } } : {}),\n storageKey: typeof values.url === 'string' ? values.url : doc.id,\n createdAt: '2026-01-01T00:00:00.000Z',\n updatedAt: '2026-01-01T00:00:00.000Z',\n }\n}\n\nfunction createLookup(\n collectionDefs: readonly CollectionDef[],\n documents: readonly CmsDocument[],\n publishedKeys?: readonly string[],\n assetRecords?: readonly AssetRecord[],\n locales?: LocaleConfig,\n): ContentLookup {\n const collections = new Map(collectionDefs.map((c) => [c.id, c]))\n // EC-224: published-ness is the version POINTER, not the flat `state` enum.\n // A hydrated session hands `publishedKeys` (the pinned set) → wrap each row as\n // a `DocumentHistory` so the published perspective resolves by the pin (the\n // live row is always a draft now) with ZERO dependence on `state`. Without a\n // pointer set (playground fixtures / tests) we keep bare rows, whose own\n // `state` gates the published perspective — byte-identical to before.\n const published = publishedKeys ? new Set(publishedKeys) : null\n const toSource = (doc: CmsDocument): ContentDocumentSource => {\n if (!published) return doc\n return published.has(documentKey({ collection: doc.collection, id: doc.id }))\n ? { draft: doc, published: doc, versions: [] }\n : { draft: doc, published: undefined, versions: [] }\n }\n const byKey = new Map(\n documents.map((doc) => [`${doc.collection}:${doc.id}`, toSource(doc)] as const),\n )\n // Asset resolution source for `asset`-typed FIELDS on resolved documents\n // (listing/relation results, e.g. a product's `gallery`). Two sources, real\n // records last so they win: (1) `asset`-collection fixture documents — how\n // playground/tests model assets; (2) the project's real asset-table records\n // (EC-262) — a Convex session has its assets here, NOT as `asset` documents,\n // so without these the content client resolves no nested image.\n const assets = new Map<string, AssetRecord>()\n for (const doc of documents) {\n if (doc.collection === 'asset') {\n assets.set(doc.id, assetRecordOf(doc, collections.get(doc.collection), locales))\n }\n }\n for (const record of assetRecords ?? []) assets.set(record.id, record)\n return {\n collection: (id) => collections.get(id),\n document: (ref) => byKey.get(`${ref.collection}:${ref.id}`),\n documents: (collectionId) =>\n documents.filter((doc) => doc.collection === collectionId).map(toSource),\n asset: (id) => assets.get(id),\n // Prefer the record's resolved servable `url` — the one the renderer's\n // resolveAsset reads (EC-262). Real asset-table records carry a Convex blob\n // locator in `storageKey` and the servable URL in `url`; fixture/`asset`-document\n // records (assetRecordOf) leave `url` unset and store the servable url in\n // `storageKey`. Falling back keeps both correct.\n assetUrl: (asset) => asset.url ?? asset.storageKey,\n }\n}\n\n/**\n * One deterministic client per (locale, perspective): EC-018 locale fallback,\n * draft-or-published perspective (EC-300/AD-16, default `'published'`). The canvas is\n * draft-coherent: the editable Draft view resolves references against the draft\n * perspective (`DRAFT_PERSPECTIVE` — a just-made reusable shows immediately), the\n * read-only Published view against `'published'` (an honest preview of what delivery\n * serves; an unpublished hard ref shows the in-canvas placeholder). Delivery stays\n * published-only — this does not weaken `live-is-published-only`. The studio's\n * ambient active locale (EC-176, `lib/locale`) picks the locale at query time, so the\n * canvas previews follow the locale switcher exactly like delivery would; the canvas's\n * Draft/Published view picks the perspective. The cache resets whenever the content\n * session changes.\n */\nfunction clientFor(locale: Locale, perspective: Perspective = 'published'): ContentClient {\n const locales = activeLocaleConfig(locale)\n // EC-479: the locale CONFIG is part of the client's identity now — it may come\n // from the ambient studio store, which changes independently of the session the\n // cache is cleared on, so keying by locale alone could serve a client built\n // against a superseded locale set.\n const key = `${locale}:${perspectiveKey(perspective)}:${locales.default}|${locales.locales.join(',')}`\n const existing = clients.get(key)\n if (existing) return existing\n const client = createContentClient({\n lookup,\n context: createContentContext({\n locale,\n perspective,\n locales,\n // EC-659: the session's asset collection is the lens over stored asset metadata — the\n // preview applies a translation exactly where delivery does. The session's collections\n // change only with the session, which clears this cache.\n assetMetaLens: assetMetaLens(activeCollections()),\n }),\n // EC-291: the routes a rich-text link resolves against (config-sourced) — the\n // studio-live half of the host link bake.\n routes: contentSession?.routes ?? [],\n })\n clients.set(key, client)\n return client\n}\n\n/**\n * Run a closed-vocabulary list query (AD-3: eq/in/lt/lte/gt/gte, AND-only,\n * filterable fields only) and return the delivery-shaped result. Invalid\n * queries come back as structured errors — never thrown, never silently\n * widened. Resolves in the studio's active locale unless one is passed.\n */\nexport function runCollectionListQuery(\n collectionId: string,\n query: ListDocumentsQuery = {},\n locale: Locale = previewLocale(),\n): ListDocumentsResult {\n return clientFor(locale).listDocuments(collectionId, query)\n}\n\n/** Resolve one document (by id or slug) into delivery shape. */\nexport function getCollectionDocument(\n collectionId: string,\n idOrSlug: string,\n locale: Locale = previewLocale(),\n): GetDocumentResult {\n return clientFor(locale).getDocument(collectionId, idOrSlug)\n}\n\n/**\n * Populate a composition-node `relation` prop to delivery shape for the canvas\n * (EC-254) — the studio analog of the host's baked relations map. Resolves the\n * ref through the active session's client (published perspective, active locale),\n * so the canvas previews a block's picked documents (a ProductGrid's products, a\n * Reusable's element) exactly as delivery renders them. `null` when the target is\n * missing or not visible → the block degrades to its own empty state.\n */\nexport function resolveCanvasRelation(\n ref: DocumentRef,\n locale: Locale = previewLocale(),\n perspective: Perspective = 'published',\n): ResolvedDocument | null {\n return clientFor(locale, perspective).resolveRelation(ref)\n}\n\n/** The real clock — the canvas boundary's default; tests inject a fixed one (EC-581 6a). */\nconst systemClock: Clock = () => new Date().toISOString()\n\n/**\n * A listing query as `listDocuments` input (EC-581 6a): executed through\n * `listingRequestOf` — the phase the delivery host runs too, so canvas and site\n * build the identical request — with `{ now: true }` read from `clock`. The\n * operands are JSON bound from authored props; the cast hands them to the one\n * validator (`validateWhere`/`validateLimit`), which reports anything invalid.\n */\nfunction listDocumentsQueryOf(query: ListingQuery, clock: Clock): ListDocumentsQuery {\n const request = listingRequestOf(query, clock)\n return {\n where: request.where as ListDocumentsQuery['where'],\n ...(request.sort ? { sort: request.sort } : {}),\n ...(request.limit !== undefined ? { limit: request.limit as number } : {}),\n }\n}\n\n/**\n * Resolve a listing block's query to its documents for the canvas (EC-255) — the\n * studio analog of the host's baked listings map. Runs the query (collection +\n * AND-only `where`, optional sort/limit; EC-581 6a: `now` read from `clock`)\n * through the active session's client (published perspective, active locale), so\n * the canvas previews a dynamic grid (a ProductGrid keyed to a category) exactly as\n * delivery renders it. An invalid query (structured, never thrown) or a non-list\n * lookup yields `[]` → the block's empty state, and the canvas notice\n * ({@link validateCanvasListingQuery}) says why. Reuses the same `listDocuments`\n * path as `runCollectionListQuery`.\n */\nexport function resolveCanvasListing(\n query: ListingQuery,\n locale: Locale = previewLocale(),\n perspective: Perspective = 'published',\n clock: Clock = systemClock,\n): ResolvedDocument[] {\n const result = clientFor(locale, perspective).listDocuments(\n query.collection,\n listDocumentsQueryOf(query, clock),\n )\n return result.ok ? result.documents : []\n}\n\n/**\n * Statically validate a listing block's query against the ACTIVE session schema\n * (EC-460, the never-silent rule): the exact `validateWhere`/`validateSort`/\n * `validateLimit` checks `listDocuments` runs, WITHOUT executing the query — so\n * the canvas can surface a config-invalid listing (a filter/sort field the\n * collection doesn't declare `filterable`, an unknown collection) as a visible\n * notice instead of the block's indistinguishable empty state. With no content\n * session configured (boot instants, fixtures) there is no schema to judge\n * against, so it reports nothing rather than false-flagging every listing.\n */\nexport function validateCanvasListingQuery(\n query: ListingQuery,\n clock: Clock = systemClock,\n): ContentQueryError[] {\n if (contentSession === null) return []\n const collection = playgroundCollection(query.collection)\n if (!collection) {\n return [\n queryError(\n 'unknown-collection',\n `Collection \"${query.collection}\" is not defined.`,\n ['collection'],\n undefined,\n { key: 'content.queryError.unknownCollection', vars: { collection: query.collection } },\n ),\n ]\n }\n // EC-581 6a: judge the request the query EXECUTES as (`now` bound), with the\n // same three validators `listDocuments` runs — notice and execution agree.\n const request = listDocumentsQueryOf(query, clock)\n return [\n ...(request.where ? validateWhere(collection, request.where) : []),\n ...(request.sort ? validateSort(collection, request.sort) : []),\n ...(request.limit !== undefined ? validateLimit(request.limit) : []),\n ]\n}\n\n/**\n * Resolve a rich-text internal link's target document to its URL path for the canvas\n * (EC-291) — the studio analog of the host's baked links map. Derives the URL through\n * the active session's client (published perspective, active locale, config-sourced\n * routes), so the canvas previews a `{type:'reference'}` link's `href` exactly as\n * delivery serves it. `null` when the target is unpublished, missing, or addressed by\n * no route → the rich-text renderer shows the EC-290 `unresolved-ref` issue. Reuses\n * the same `resolveLink` path as the host bake, so both agree on the derived URL.\n */\nexport function resolveCanvasLink(\n ref: DocumentRef,\n locale: Locale = previewLocale(),\n perspective: Perspective = 'published',\n): string | null {\n return clientFor(locale, perspective).resolveLink(ref)\n}\n\n/** A pickable entry of a collection (the template-page preview switcher). */\nexport interface CollectionEntrySummary {\n id: string\n label: string\n}\n\n/** Published entries of a collection, labeled by the schema's title field. */\nexport function listCollectionEntries(collectionId: string): CollectionEntrySummary[] {\n const collection = playgroundCollection(collectionId)\n const result = runCollectionListQuery(collectionId)\n if (!result.ok) return []\n // EC-242: label via the shared identity resolver (string `titleField` or a\n // function pattern), over the delivery-shape values; falls back to the id.\n return result.documents.map((doc) => ({\n id: doc.id,\n label: collection ? resolveDocumentTitle(collection, doc, doc.id) : doc.id,\n }))\n}\n"]}
@@ -13,4 +13,4 @@
13
13
  * (The convex-side stamp does NOT read this mirror — `convex/delivery.ts` imports the
14
14
  * package.json declaration directly; its bundler allows what tsc's rootDir forbids.)
15
15
  */
16
- export declare const ENGINE_VERSION = "0.0.95";
16
+ export declare const ENGINE_VERSION = "0.0.96";
@@ -13,5 +13,5 @@
13
13
  * (The convex-side stamp does NOT read this mirror — `convex/delivery.ts` imports the
14
14
  * package.json declaration directly; its bundler allows what tsc's rootDir forbids.)
15
15
  */
16
- export const ENGINE_VERSION = '0.0.95';
16
+ export const ENGINE_VERSION = '0.0.96';
17
17
  //# sourceMappingURL=engine-version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"engine-version.js","sourceRoot":"","sources":["../../src/lib/engine-version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,QAAQ,CAAA","sourcesContent":["/**\n * The engine version this studio build was compiled from (EC-552) — the client-side\n * half of the deployed-functions version handshake: the boot gate compares it against\n * what `delivery:engineVersion` answers from the deployment.\n *\n * A MIRROR of `package.json`'s `version`, not the declaration itself: client source\n * cannot import `../../package.json` (outside the tsc build's `rootDir`; moving the\n * root would reshape `dist` and every export path). The parity test beside this file\n * fs-reads the real declaration and fails `pnpm verify` the moment the two diverge,\n * so a release cannot ship with a stale mirror. `pnpm release:bump` writes this\n * alongside the five `package.json` versions (EC-608).\n *\n * (The convex-side stamp does NOT read this mirror — `convex/delivery.ts` imports the\n * package.json declaration directly; its bundler allows what tsc's rootDir forbids.)\n */\nexport const ENGINE_VERSION = '0.0.95'\n"]}
1
+ {"version":3,"file":"engine-version.js","sourceRoot":"","sources":["../../src/lib/engine-version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,QAAQ,CAAA","sourcesContent":["/**\n * The engine version this studio build was compiled from (EC-552) — the client-side\n * half of the deployed-functions version handshake: the boot gate compares it against\n * what `delivery:engineVersion` answers from the deployment.\n *\n * A MIRROR of `package.json`'s `version`, not the declaration itself: client source\n * cannot import `../../package.json` (outside the tsc build's `rootDir`; moving the\n * root would reshape `dist` and every export path). The parity test beside this file\n * fs-reads the real declaration and fails `pnpm verify` the moment the two diverge,\n * so a release cannot ship with a stale mirror. `pnpm release:bump` writes this\n * alongside the five `package.json` versions (EC-608).\n *\n * (The convex-side stamp does NOT read this mirror — `convex/delivery.ts` imports the\n * package.json declaration directly; its bundler allows what tsc's rootDir forbids.)\n */\nexport const ENGINE_VERSION = '0.0.96'\n"]}
@@ -250,6 +250,9 @@ export const deMessages = {
250
250
  'operations.error.strictTargetsUnpublished': 'Das Dokument „{target}“ kann nicht veröffentlicht werden: Ziele strikter Beziehungen fehlen oder sind unveröffentlicht — veröffentlichen Sie sie zuerst.',
251
251
  'operations.error.publishNeedsLocales': '„{target}“ kann nicht veröffentlicht werden: Seine Sammlung deklariert lokalisierte Felder ({fields}), und es wurde keine Sprachkonfiguration übergeben, um deren ausgeblendete Werte zu beurteilen.',
252
252
  'operations.error.versionNotPinnable': 'Version {version} von „{target}“ wurde nicht durch eine Veröffentlichung erfasst und kann daher nicht live geschaltet werden — stellen Sie sie im Entwurf wieder her und veröffentlichen Sie diesen.',
253
+ // EC-648 — Änderungssätze: Anwenden durch ein Problem blockiert, und der Schritt, den ein Änderungssatz ablehnt, weil ihn kein Rückgängigmachen umkehren kann.
254
+ 'operations.error.changesetBlocked': 'Der Änderungssatz „{changeset}“ hat blockierende Prüfprobleme und kann nicht angewendet werden.',
255
+ 'operations.error.changesetDeleteNotReversible': 'Schritt {step}: „{target}“ kann nicht innerhalb eines Änderungssatzes gelöscht werden — das Löschen entfernt seinen Versionsverlauf und seine Veröffentlichung, die kein Rückgängigmachen wiederherstellen kann. Löschen Sie es einzeln.',
253
256
  'operations.errorDetail.andMore': ' und {count} weitere',
254
257
  // EC-494 — Fehler von Inhaltsabfragen (Filterleiste + Listing-Hinweis im Canvas).
255
258
  // „filterable“, „asc“, „desc“, „in“, „empty“ sind Schlüsselwörter aus der Konfiguration
@@ -267,6 +270,10 @@ export const deMessages = {
267
270
  'content.queryError.sortNotFilterable': 'Das Sortierfeld "{field}" in "{collection}" ist nicht als filterable deklariert.',
268
271
  'content.queryError.sortUnknownField': 'Das Sortierfeld "{field}" existiert in "{collection}" nicht.',
269
272
  'content.queryError.sortDirection': 'Die Sortierrichtung muss "asc" oder "desc" sein.',
273
+ 'content.queryError.sortShape': 'Eine Sortierung muss ein Objekt { field, direction? } sein.',
274
+ 'content.queryError.sortFieldName': 'Das Sortierfeld muss ein nicht-leerer Feldname sein.',
275
+ 'content.queryError.sortKeyRenamed': 'Der Sortierschlüssel "{key}" heißt "{replacement}".',
276
+ 'content.queryError.sortUnknownKey': 'Der Sortierschlüssel "{key}" wird nicht gelesen — eine Sortierung ist { field, direction? }.',
270
277
  'content.queryError.limitPositiveInteger': 'Das Limit muss eine positive ganze Zahl sein.',
271
278
  // ─────────────────────────────────────────────────────────────────────────
272
279
  // CMS — collection list / view bar / filters / cells
@@ -480,6 +487,7 @@ export const deMessages = {
480
487
  'cms.issue.cardinality-violation': 'Falsche Anzahl von Werten',
481
488
  'cms.issue.unknown-asset': 'Fehlende Mediendatei',
482
489
  'cms.issue.asset-without-url': 'Mediendatei ohne Datei',
490
+ 'cms.issue.asset-meta-drift': 'Ungenutzte Übersetzung einer Mediendatei',
483
491
  'cms.issue.duplicate-document': 'Doppelter Eintrag',
484
492
  'cms.issue.unknown-locale': 'Unbekannte Sprache',
485
493
  'cms.issue.missing-localized-value': 'Fehlende Übersetzung',
@@ -561,6 +569,7 @@ export const deMessages = {
561
569
  'cms.conflict.empty': '(leer)',
562
570
  'cms.conflict.structured': 'ein strukturierter Wert',
563
571
  'cms.conflict.cellRefused': 'Dieses Feld wurde seit dem Laden von jemand anderem geändert — dessen Wert wird angezeigt.',
572
+ 'cms.conflict.unauthored': 'Eine Änderung wurde nicht gespeichert: Sie gibt nicht an, auf welcher Fassung des Dokuments sie beruht, und könnte eine neuere Änderung überschreiben. Laden Sie das Dokument neu und nehmen Sie die Änderung erneut vor.',
564
573
  'cms.presence.inField': '{name} ist in diesem Feld',
565
574
  'cms.presence.inFieldMany': '{names} sind in diesem Feld',
566
575
  'cms.presence.someone': 'Jemand',
@@ -581,7 +590,8 @@ export const deMessages = {
581
590
  'cms.issueMessage.unknownAlias.other': '{count} Dokumente sind dem Alias „{alias}“ zugewiesen, der kein deklarierter Slot von „{collection}“ ist ({declared}). Weisen Sie einen gültigen Slot zu.',
582
591
  'cms.issueMessage.duplicateAlias': '{count} Dokumente teilen sich den Alias „{alias}“ in „{collection}“. Jeder Slot darf nur einem Dokument zugewiesen sein — weisen Sie neu zu oder entfernen Sie die Duplikate.',
583
592
  'cms.issueMessage.unfilledSlot': 'Der Slot „{slot}“ von „{collection}“ hat noch kein Dokument. Weisen Sie eines zu, damit Code, der „{slot}“ auflöst, es findet.',
584
- 'cms.issueMessage.reservedFieldName': 'Der Feldname „{field}“ ist reserviert (der Diskriminator selbstbeschreibender Knoten).',
593
+ 'cms.issueMessage.reservedFieldName': 'Der Feldname „{field}“ ist reserviert (der Diskriminator selbstbeschreibender Knoten): Ein Feld namens „{field}“ darf nur ein Auswahlfeld sein, dessen Optionen keinen Knotentyp der Engine enthalten (reference, asset, block, elytra/*) — dieses ist ein Feld vom Typ „{kind}“.',
594
+ 'cms.issueMessage.reservedFieldTypeOption': 'Das Auswahlfeld „{field}“ führt die Option „{option}“, einen Knotentyp der Engine — ein „{field}“ mit dem Wert „{option}“ würde als Engine-Knoten gelesen (reference, asset, block, elytra/*). Benennen Sie die Option um.',
585
595
  'cms.issueMessage.duplicateSelectOption': 'Doppelte Auswahloption „{option}“ im Feld „{field}“.',
586
596
  'cms.issueMessage.duplicateObjectField': 'Doppeltes Feld „{field}“ im Objektfeld „{parent}“.',
587
597
  'cms.issueMessage.assetCollectionSingleton': 'Die Mediensammlung „{collection}“ kann kein Einzelstück sein.',
@@ -832,6 +842,8 @@ export const deMessages = {
832
842
  'assets.viewToggle.grid': 'Rasteransicht',
833
843
  'assets.detail.metadataHeading': 'Metadaten',
834
844
  'assets.detail.noFileUrl': 'Zu dieser Mediendatei gibt es keine ausgelieferte Datei — überall, wo sie verwendet wird, erscheint ein leeres Bild. Ersetzen Sie die Datei.',
845
+ 'assets.detail.metaDriftNotLocalized': 'Für {fields} sind alte Übersetzungen gespeichert, das Feld ist aber nicht mehr übersetzbar — jede Seite zeigt den gemeinsamen Wert. Speichern des Felds entfernt sie.',
846
+ 'assets.detail.metaDriftUndeclared': 'Für {fields} sind übersetzte Werte gespeichert, die diese Mediensammlung nicht deklariert — sie werden nirgends verwendet.',
835
847
  'assets.references.buttonLabel': 'Verweise',
836
848
  'assets.references.title': 'Verwendet von — {name}',
837
849
  'assets.references.description': 'Alles, was dieses Medienelement referenziert, mit Direktlinks zum genauen Feld oder Knoten.',