@elytracms/studio 0.0.95 → 0.0.97
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/convex/cms.ts +272 -16
- package/convex/delivery-folded-drift.test.ts +104 -0
- package/convex/delivery.ts +24 -8
- package/convex/depth-codec-lookalike.test.ts +192 -0
- package/convex/fixture-accounts.test.ts +305 -0
- package/convex/fixtureAccounts.ts +298 -0
- package/convex/incarnation.test.ts +149 -0
- package/convex/ingest.test.ts +145 -3
- package/convex/ingest.ts +123 -17
- package/convex/receipt-races.test.ts +184 -0
- package/convex/records-zod-copy.test.ts +76 -0
- package/convex/schema.ts +20 -1
- package/convex/strict-delete.test.ts +129 -0
- package/convex/strict-reference-race.test.ts +139 -0
- package/dist/components/ai/ai-chat-panel.js +15 -2
- package/dist/components/ai/ai-chat-panel.js.map +1 -1
- package/dist/components/ai/translate-document-action.d.ts +6 -0
- package/dist/components/ai/translate-document-action.js.map +1 -1
- package/dist/components/ai/translate-document-dialog.d.ts +1 -1
- package/dist/components/ai/translate-document-dialog.js +5 -5
- package/dist/components/ai/translate-document-dialog.js.map +1 -1
- package/dist/components/assets/asset-detail.js +5 -2
- package/dist/components/assets/asset-detail.js.map +1 -1
- package/dist/components/assets/asset-locale.d.ts +7 -0
- package/dist/components/assets/asset-locale.js +16 -2
- package/dist/components/assets/asset-locale.js.map +1 -1
- package/dist/components/assets/asset-meta-drift-notice.d.ts +13 -0
- package/dist/components/assets/asset-meta-drift-notice.js +22 -0
- package/dist/components/assets/asset-meta-drift-notice.js.map +1 -0
- package/dist/components/assets/asset-meta-label.d.ts +2 -1
- package/dist/components/assets/asset-meta-label.js +4 -2
- package/dist/components/assets/asset-meta-label.js.map +1 -1
- package/dist/components/assets/asset-metadata.d.ts +33 -13
- package/dist/components/assets/asset-metadata.js +46 -22
- package/dist/components/assets/asset-metadata.js.map +1 -1
- package/dist/components/assets/asset-search.d.ts +6 -2
- package/dist/components/assets/asset-search.js +15 -5
- package/dist/components/assets/asset-search.js.map +1 -1
- package/dist/components/assets/assets-collection-view-source.d.ts +5 -3
- package/dist/components/assets/assets-collection-view-source.js +7 -5
- package/dist/components/assets/assets-collection-view-source.js.map +1 -1
- package/dist/components/builder/canvas-rebase.d.ts +36 -12
- package/dist/components/builder/canvas-rebase.js +13 -3
- package/dist/components/builder/canvas-rebase.js.map +1 -1
- package/dist/components/builder/canvas-render-context.js +5 -4
- package/dist/components/builder/canvas-render-context.js.map +1 -1
- package/dist/components/builder/composition-field-editor.d.ts +12 -6
- package/dist/components/builder/composition-field-editor.js +6 -5
- package/dist/components/builder/composition-field-editor.js.map +1 -1
- package/dist/components/cms/asset-picker-core.d.ts +2 -2
- package/dist/components/cms/asset-picker-core.js +2 -2
- package/dist/components/cms/asset-picker-core.js.map +1 -1
- package/dist/components/cms/asset-picker.js +3 -1
- package/dist/components/cms/asset-picker.js.map +1 -1
- package/dist/components/cms/canvas-commit.d.ts +6 -0
- package/dist/components/cms/canvas-commit.js +5 -1
- package/dist/components/cms/canvas-commit.js.map +1 -1
- package/dist/components/cms/cms-store.d.ts +24 -8
- package/dist/components/cms/cms-store.js +21 -14
- package/dist/components/cms/cms-store.js.map +1 -1
- package/dist/components/cms/collection-table.js +4 -11
- package/dist/components/cms/collection-table.js.map +1 -1
- package/dist/components/cms/detail-editor.js +2 -2
- package/dist/components/cms/detail-editor.js.map +1 -1
- package/dist/components/cms/draft-commit.d.ts +16 -3
- package/dist/components/cms/draft-commit.js +3 -2
- package/dist/components/cms/draft-commit.js.map +1 -1
- package/dist/components/cms/use-document-draft.d.ts +107 -10
- package/dist/components/cms/use-document-draft.js +157 -42
- package/dist/components/cms/use-document-draft.js.map +1 -1
- package/dist/components/collection-view/cms-collection-view-source.js +6 -4
- package/dist/components/collection-view/cms-collection-view-source.js.map +1 -1
- package/dist/components/components/transfer-dialog.js +6 -4
- package/dist/components/components/transfer-dialog.js.map +1 -1
- package/dist/lib/ai/chat-state.d.ts +7 -0
- package/dist/lib/ai/chat-state.js.map +1 -1
- package/dist/lib/ai/tools.d.ts +8 -0
- package/dist/lib/ai/tools.js +4 -0
- package/dist/lib/ai/tools.js.map +1 -1
- package/dist/lib/cms-views/view-model.d.ts +15 -8
- package/dist/lib/cms-views/view-model.js +19 -5
- package/dist/lib/cms-views/view-model.js.map +1 -1
- package/dist/lib/collection-view/__fixtures__/document-writes.js +1 -0
- package/dist/lib/collection-view/__fixtures__/document-writes.js.map +1 -1
- package/dist/lib/collection-view/collection-view-source.d.ts +18 -7
- package/dist/lib/collection-view/collection-view-source.js.map +1 -1
- package/dist/lib/data/collection-content.js +5 -0
- package/dist/lib/data/collection-content.js.map +1 -1
- package/dist/lib/engine-version.d.ts +1 -1
- package/dist/lib/engine-version.js +1 -1
- package/dist/lib/engine-version.js.map +1 -1
- package/dist/lib/i18n/messages.de.js +15 -1
- package/dist/lib/i18n/messages.de.js.map +1 -1
- package/dist/lib/i18n/messages.en.d.ts +13 -0
- package/dist/lib/i18n/messages.en.js +16 -1
- package/dist/lib/i18n/messages.en.js.map +1 -1
- package/dist/lib/operations/cms-persistence.d.ts +119 -35
- package/dist/lib/operations/cms-persistence.js +441 -91
- package/dist/lib/operations/cms-persistence.js.map +1 -1
- package/dist/lib/persistence/convex-adapter.js +80 -8
- package/dist/lib/persistence/convex-adapter.js.map +1 -1
- package/dist/lib/persona/labels.js +2 -0
- package/dist/lib/persona/labels.js.map +1 -1
- package/package.json +4 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detail-editor.js","sourceRoot":"","sources":["../../../src/components/cms/detail-editor.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,oBAAoB,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAC9F,OAAO,EACL,KAAK,EACL,WAAW,EACX,WAAW,EACX,WAAW,EACX,IAAI,EACJ,GAAG,EACH,MAAM,EACN,gBAAgB,EAChB,OAAO,EACP,OAAO,EACP,IAAI,E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AAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;KACzF,CAAC,CAAC,CAAA;AACL,CAAC;AAED,8EAA8E;AAC9E,8EAA8E;AAC9E,0EAA0E;AAC1E,MAAM,cAAc,GAA2B;IAC7C,CAAC,EAAE,eAAe;IAClB,CAAC,EAAE,eAAe;IAClB,CAAC,EAAE,eAAe;IAClB,CAAC,EAAE,eAAe;IAClB,CAAC,EAAE,eAAe;IAClB,EAAE,EAAE,gBAAgB;CACrB,CAAA;AAED,SAAS,iBAAiB,CAAC,KAA6B;IACtD,OAAO,cAAc,CAAC,iBAAiB,CAAC,KAAK,IAAI,MAAM,CAAC,CAAC,IAAI,gBAAgB,CAAA;AAC/E,CAAC;AAED,SAAS,YAAY,CACnB,GAAgB,EAChB,UAAyB,EACzB,MAAc,EACd,MAAoB;IAEpB,+EAA+E;IAC/E,iFAAiF;IACjF,2EAA2E;IAC3E,OAAO,oBAAoB,CAAC,UAAU,EAAE,cAAc,CAAC,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAA;AAC9F,CAAC","sourcesContent":["import { Link, STUDIO_PROJECT_ROUTE, studioPath, useNavigate } from '@elytracms/studio/router'\nimport {\n Check,\n ChevronDown,\n CircleAlert,\n CircleCheck,\n Copy,\n Eye,\n EyeOff,\n GitCompareArrows,\n History,\n Loader2,\n Lock,\n MoreHorizontal,\n RotateCcw,\n Save,\n Tag,\n Trash2,\n X,\n} from 'lucide-react'\nimport { useCallback, useMemo, useState } from 'react'\nimport type { ReactNode } from 'react'\nimport {\n DRAFT_PERSPECTIVE,\n DRAFT_VARIANT,\n FIELD_WIDTH_SPANS,\n SIDEBAR_FIELD_GROUP,\n documentKey,\n groupOrder,\n groupSectionOf,\n hasAliases,\n isBlocksField,\n isFieldHiddenIn,\n isFieldLocalized,\n isSingleton,\n localeViews,\n resolveDocumentTitle,\n resolveField,\n sidebarFields,\n tabDescriptorOf,\n tabOrder,\n titleFieldOf,\n staticFieldHidden,\n valuesInLocale,\n perspectiveKey,\n variantOf,\n} from '@elytracms/core/cms-core'\nimport type {\n CmsDocument,\n CollectionDef,\n FieldDef,\n FieldGroupSection,\n FieldWidth,\n Locale,\n LocaleConfig,\n} from '@elytracms/core/cms-core'\nimport {\n Badge,\n Button,\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n CollapsibleSection,\n Field,\n Heading,\n Row,\n Spacer,\n Stack,\n Text,\n toast,\n} from '@elytracms/studio/ui'\nimport { studioManifestLookup } from '../../lib/registry'\nimport { cn } from '../../lib/utils'\nimport { localizedLabel, translate } from '../../lib/i18n'\nimport {\n LocaleSwitcher,\n displayedFieldFallback,\n fieldConnection,\n fillFieldFromBase,\n resetFieldToBase,\n} from '../../lib/locale'\nimport type { ReferenceAction } from '../../lib/references'\nimport { FallbackChip } from './cell'\nimport { FieldConnectionControl } from './field-connection'\nimport { FieldControl } from './field-control'\nimport { duplicateFromSource } from './duplicate-document'\n// EC-322: the lazy-wrapped page builder — the heavy canvas subtree code-splits out\n// of the detail-view critical path and downloads only when a `blocks` field opens.\nimport { CompositionFieldEditor } from '../builder/composition-field-editor-lazy'\nimport type { CanvasCommitChannel } from '../builder/canvas-commit-boundary'\nimport { fieldLabel } from './cms-labels'\nimport { useCmsCollectionViewSource } from '../collection-view/cms-collection-view-source'\nimport { CollectionViewProvider, useCollectionView } from '../collection-view/collection-view-context'\nimport { resolveFieldAccess } from '../../lib/collection-view/collection-view-source'\nimport type { CollectionViewSource } from '../../lib/collection-view/collection-view-source'\nimport { DocStateBadge } from './doc-state'\nimport { UnsavedChangesGuard } from '../guards'\nimport { ReferenceConfirmDialog } from './reference-confirm'\nimport { ReferencesPanel } from '../references/references-panel'\nimport { InspectorSidebar } from '../inspector/inspector-sidebar'\nimport type { InspectorPane } from '../inspector/inspector-sidebar'\nimport { useContributedDocumentPanes } from '../inspector/document-panes'\nimport { DocumentEditorProvider } from './document-editor-context'\nimport { TranslateDocumentAction } from '../ai/translate-document-action'\nimport { VersionsPane } from './versions-pane'\n// EC-322: the lazy-wrapped compare view — its diff UI code-splits off the detail-view\n// critical path and loads only when the Compare tab opens.\nimport { VersionCompare } from './version-compare-lazy'\nimport { IssuesPane } from './issues-pane'\nimport { DetailsPane } from './details-pane'\nimport { DocumentUrlPath } from './document-url-path'\nimport { useSetBreadcrumb } from '../breadcrumb-context'\nimport type { BreadcrumbItem } from '../breadcrumb-context'\nimport { useAiCurrentDocumentTap } from '../../lib/ai-current-document'\nimport { resolveDeploymentRoutes } from '../../lib/workspace'\n// EC-325 — the controller hooks EditorBody orchestrates (each independently\n// unit-tested at its pure core); the shell threads shared draft/ref/replaceDraft\n// state across their boundaries.\nimport { usePublishedPerspective } from './use-published-perspective'\nimport { useDocumentDraft } from './use-document-draft'\nimport {\n FieldCommitBoundary,\n FieldConflictNotice,\n FieldPresenceNote,\n conflictActorName,\n pathInField,\n presentInField,\n} from './field-collaboration'\nimport { fieldPositionPath } from '../../lib/cms/field-patch'\nimport { getStudioActor } from '../../lib/operations'\nimport { useDiscardController } from './use-discard-controller'\nimport { usePublishController, publishGate } from './use-publish-controller'\nimport { FieldFocusRequestContext, FieldPathContext } from './field-anchors'\nimport { useFieldFocus } from './use-field-focus'\nimport { useCompareSelection } from './use-compare-selection'\nimport { useLiveUrl } from './use-live-url'\nimport { cmsValidationIssueMessage } from '../../lib/persona/labels'\nimport { inlineFieldErrors } from './inline-field-errors'\n\nexport function DetailEditor({\n projectId,\n collectionId,\n documentId,\n focusPath,\n}: {\n projectId: string\n collectionId: string\n documentId: string\n /** Reference-index field path (`?field=`, EC-172): highlight + scroll to the exact field. */\n focusPath?: string\n}) {\n // AD-19: the edit shell is a portable surface over a CollectionViewSource, just\n // like the list. `DetailEditor` is the CMS entry point — it builds the CMS source\n // and hands it to the portable {@link PortableDetailEditor} so `EditorBody` (and\n // the shared field controls / pickers) render over the source, never `useCms()`.\n const source = useCmsCollectionViewSource(collectionId)\n // EC-618: the project's contributed inspector panes (`defineStudio({ documentPanes })`) —\n // CMS documents only, so this entry point resolves them and the rails' do not.\n const contributedPanes = useContributedDocumentPanes(projectId, collectionId, documentId)\n if (!source) {\n return (\n <DocumentNotFound\n projectId={projectId}\n listPath={studioPath.cmsCollection(collectionId)}\n label={collectionId}\n />\n )\n }\n return (\n <PortableDetailEditor\n source={source}\n projectId={projectId}\n documentId={documentId}\n focusPath={focusPath}\n contributedPanes={contributedPanes}\n />\n )\n}\n\n/**\n * The portable edit shell (EC-240 / AD-19): resolve the record by id from ANY\n * {@link CollectionViewSource}, then render the shared {@link EditorBody} over it.\n * The CMS entry point ({@link DetailEditor}) and the users rail both mount this —\n * routing (the \"back to list\" target, the not-found link) is rail-owned via\n * `source.listPath`, so the shell never hard-codes the CMS route.\n */\nexport function PortableDetailEditor({\n source,\n projectId,\n documentId,\n focusPath,\n formAppendix,\n contributedPanes,\n}: {\n source: CollectionViewSource\n projectId: string\n documentId: string\n focusPath?: string\n /** EC-618: panes contributed to the inspector (appended after the frame's Details / Versions, before Issues). */\n contributedPanes?: readonly InspectorPane[]\n /**\n * EC-396 — a form-column appendix seam (a direct-value node, per the customization\n * principle — no registry): rendered INSIDE the editor's form column, below the\n * fieldset cards, at the same `max-w-2xl` width and gap-6 rhythm. The account\n * surface mounts its `CredentialPanel` through it so the account page is ONE editor\n * surface (the editor owns the scroll + fills the height, so the Issues sidebar\n * spans the full surface), never a second parallel card wrapper. Absent for the CMS\n * and users entry points, which pass nothing.\n */\n formAppendix?: ReactNode\n}) {\n const doc = source.get({ collection: source.collectionId, id: documentId })\n // EC-274: singleton opening is owned by `SingletonGate` (it resolves the lone\n // document and materializes it). The detail editor just renders the document it\n // is given by id — singletons need no special case here.\n if (!doc) {\n return (\n <DocumentNotFound\n projectId={projectId}\n listPath={source.listPath}\n label={localizedLabel(source.schema.form?.label, source.collectionId)}\n />\n )\n }\n return (\n <CollectionViewProvider source={source}>\n <EditorBody\n key={`${source.collectionId}/${documentId}`}\n projectId={projectId}\n collection={source.schema}\n doc={doc}\n focusPath={focusPath}\n formAppendix={formAppendix}\n contributedPanes={contributedPanes}\n />\n </CollectionViewProvider>\n )\n}\n\n/** The record-not-found state — a heading + a rail-owned \"back to list\" link. */\nfunction DocumentNotFound({\n projectId,\n listPath,\n label,\n}: {\n projectId: string\n listPath?: string\n label: string\n}) {\n return (\n <div className=\"grid h-full place-items-center p-8\">\n <Stack gap=\"3\" align=\"center\" className=\"text-center\">\n <Heading level={2} size=\"h2\">\n {translate('cms.editor.notFoundTitle')}\n </Heading>\n {listPath !== undefined ? (\n <Link\n to={STUDIO_PROJECT_ROUTE}\n params={{ projectId, _splat: listPath }}\n className=\"text-sm text-primary hover:underline\"\n >\n {translate('cms.editor.backToList', { label })}\n </Link>\n ) : null}\n </Stack>\n </div>\n )\n}\n\nfunction EditorBody({\n projectId,\n collection,\n doc,\n focusPath,\n formAppendix,\n contributedPanes,\n}: {\n projectId: string\n collection: CollectionDef\n doc: CmsDocument\n focusPath?: string\n /** EC-396: rendered below the fieldset cards, inside the form column (see {@link PortableDetailEditor}). */\n formAppendix?: ReactNode\n /** EC-618: contributed inspector panes (see {@link PortableDetailEditor}). */\n contributedPanes?: readonly InspectorPane[]\n}) {\n const source = useCollectionView()\n const navigate = useNavigate()\n // AD-19: capability flags gate whole shell regions AND their method groups, so\n // the SAME edit shell serves a non-publishing / non-versioned / single-locale\n // rail (the users rail, EC-240) without a bespoke editor. A false flag hides its\n // region entirely — no dead controls, no reads fired on that region's behalf.\n const canPublish = source.capabilities.publish\n const canVersions = source.capabilities.versions\n const canLocales = source.capabilities.locales\n // References is the CMS content-graph surface (the reference index tracks the\n // publishable document rail). A non-publishing rail (users, future redirects) is\n // not part of that graph, so its References tab would be structurally empty —\n // gate it off. A dedicated `references` capability can split this later if a\n // non-publishing-but-referenceable rail appears (YAGNI today).\n const showReferences = canPublish\n // Principal-based field access (EC-240, AD-18): `edit|read|hidden`, resolved\n // per field for the current principal. Default-open — a source with no policy\n // derives it from `isFieldReadOnly`. Access depends on the record's identity, not\n // its edited values (content-conditional hiding is the separate `isHidden` axis),\n // so it keys off the stable `doc`, never the live draft.\n const accessOf = useCallback(\n (field: FieldDef) => resolveFieldAccess(source, field, doc),\n [source, doc],\n )\n // EC-217: a singleton collection has no list — there is nowhere to go \"back\"\n // to, and its one document is fixed (never deleted). The header drops the\n // back-crumb/id line and the Delete action accordingly.\n const singleton = isSingleton(collection)\n // The studio's ambient active locale (EC-176): the form displays and edits\n // exactly this locale — switched via the shared LocaleSwitcher, never per field.\n const locale = source.activeLocale\n // EC-173: unpublish/delete go through the reference-aware confirmation.\n const [confirmAction, setConfirmAction] = useState<ReferenceAction | null>(null)\n // Stable so the document-editor context value (EC-224) doesn't churn each render.\n const ref = useMemo(() => ({ collection: collection.id, id: doc.id }), [collection.id, doc.id])\n const confirmTargets = useMemo(\n () => [{ collection: collection.id, id: doc.id }],\n [collection.id, doc.id],\n )\n\n // EC-595 A2 — the draft over the revisioned document (`useDocumentDraft`): per-keystroke\n // edits, committed per control kind (commit on quiescence) as the patches of the\n // positions they wrote; rebased on the session's document whenever it changes (a write\n // result, a colleague's change by subscription); forced flushes on unmount and tab\n // hide; the thin presence heartbeat. The explicit-save rails keep their Save button.\n // EC-188: the canvas field is found from the schema (its tab), so the draft knows it.\n const lookupManifest = useMemo(() => studioManifestLookup(), [])\n const draftCanvasField = collection.fields.find(isBlocksField)\n const documentDraft = useDocumentDraft({\n source,\n collection,\n doc,\n locale,\n lookupManifest,\n ...(draftCanvasField ? { canvasField: draftCanvasField } : {}),\n })\n const { draft, dirty, explicitSave } = documentDraft\n // `save` — the forced commit (document model) / the Save button (record model);\n // `replaceDraft` adopts a restored snapshot (the canvas remounts when its value moved).\n const save = documentDraft.save\n const replaceDraft = documentDraft.replaceDraft\n\n // EC-378 — the current-document seam: publish WHICH document is open so the AI\n // assistant resolves \"this document\" without asking, and the FORCED FLUSH it runs\n // before reading or patching it (EC-595 A2 — the assistant's applied changes reach\n // this editor through the session, which the draft rebases on).\n useAiCurrentDocumentTap({\n collection: collection.id,\n id: doc.id,\n title: primaryTitle(draft, collection, locale, source.localeConfig) || doc.id,\n flush: documentDraft.flush,\n })\n\n // EC-226 / EC-316 / EC-325 — the Draft/Published VIEW perspective AND the pinned\n // published snapshot, both derived from the ONE shared version-history query\n // (AD-17: the single operations-backed cache — no raw `source.versioning.load`\n // in this component). `canDiscard`/`versionKey`/`publishedVersionNumber`/\n // `publishedSnapshotDoc` feed the Discard controller below off that same query.\n const {\n perspective,\n setPerspective,\n published,\n canDiscard,\n versionKey,\n publishedVersionNumber,\n publishedSnapshotDoc,\n publishedSnapshot,\n viewReadOnly,\n viewDoc,\n publishedPending,\n } = usePublishedPerspective({ ref, source, canPublish, canVersions, draft })\n\n // EC-586: THE equality verdict (`semanticValueEqual` over canonical forms) is the\n // draft's `dirty` (`useDocumentDraft`): uncommitted positions exist.\n // EC-589: ONE validation path. A strict relation (the reuse embed declares\n // `strict: true` on its relation prop) to an unpublished target is a blocking error\n // from the validator's relation-target pass — at every position the reference walk\n // reaches, localized buckets and rich-text embeds included — so it gates the Publish\n // button like any other error, and `documents.publish` refuses it for every client.\n // (The EC-300 special case that walked top-level `blocks` in `values` only, and let\n // the editor publish through, is gone.)\n const issues = useMemo(() => source.validate(draft), [source, draft])\n const errorCount = issues.filter((i) => i.severity === 'error').length\n const hasErrors = errorCount > 0\n\n // EC-595 A2 · EC-240 — the write model decides the discipline (`source.writes`): a\n // document commits on quiescence and flushes on unmount / tab hide; a record saves\n // explicitly and relies on the `UnsavedChangesGuard` below for navigation.\n\n // EC-316 / EC-325 — the \"Discard changes\" controller: the pure enablement\n // decision plus the shared restore sequence (flush → restore the pinned published\n // version whole → replaceDraft → invalidate). Destructured to the names the header\n // menu + confirm dialog already use.\n const {\n status: discardStatus,\n disabledReason: discardDisabledReason,\n confirmOpen: discardConfirm,\n setConfirmOpen: setDiscardConfirm,\n busy: discardBusy,\n discard: handleDiscardDraft,\n } = useDiscardController({\n canDiscard,\n published,\n viewReadOnly,\n publishedSnapshotDoc,\n publishedVersionNumber,\n versionKey,\n draft,\n source,\n docRef: ref,\n replaceDraft,\n dirty,\n save,\n })\n // EC-498: inline errors anchor on the issue's PATH resolved to its owning\n // top-level row, never on `meta.field` — that carries the LEAF subfield name,\n // so a nested repeater issue used to vanish from the form or land on an\n // unrelated top-level field that happened to share the leaf's name.\n const errorsByField = useMemo(\n () => inlineFieldErrors(collection, issues, cmsValidationIssueMessage),\n [collection, issues],\n )\n\n // EC-241: `form.tabs` may declare tabs as bare ids OR `{ id, label }` objects with a\n // localizable title — resolve to the ordered id list for all tab logic; labels are\n // resolved for display in `renderContentTab`.\n const declaredTabs = tabOrder(collection.form)\n const tabs = declaredTabs.length > 0 ? declaredTabs : ['main']\n // EC-269: References gets its own dedicated, visibility-gated tab — it mounts\n // (and loads) only when selected, and unmounts on leave, so normal editing\n // never triggers reference fetching. Appended after the collection's content tabs.\n const REFERENCES_TAB = 'references'\n // EC-298: the version-compare view is a sticky framework tab (kept open while\n // you tab to the real fields; closed only by its ✕).\n const COMPARE_TAB = 'compare'\n const [activeTab, setActiveTab] = useState(tabs[0]!)\n // EC-285: the reserved `sidebar` group is document-level metadata (slug, author…)\n // — it renders in the Details inspector pane, not as a content tab, so it is\n // excluded from the tab fields here and collected once below.\n const sidebarFieldDefs = useMemo(() => sidebarFields(collection), [collection])\n // EC-273: only STATICALLY hidden fields (`hidden: true`) are structurally\n // excluded here; a conditionally (predicate) hidden field stays in the tab and\n // is evaluated per-render against the current values (it may show or hide as the\n // editor types).\n const tabFields = collection.fields.filter(\n (f) =>\n (f.form?.tab ?? tabs[0]) === activeTab &&\n !staticFieldHidden(f) &&\n f.form?.group !== SIDEBAR_FIELD_GROUP,\n )\n const groups = groupFields(tabFields, collection)\n // EC-188 (AD-12): a composition (`blocks`) field is a special content feature,\n // not a field-row — it takes over its tab with the full page-builder canvas.\n // Convention: such a field lives on its own dedicated fieldset tab.\n const canvasField = tabFields.find(isBlocksField)\n // EC-630 — the canvas inspector's commit boundaries reach this draft's committer: a burst\n // of typing in a prop or a typography run commits on its control kind's policy.\n const { canvasFocused, canvasBlurred, canvasEntered } = documentDraft\n const canvasCommits = useMemo<CanvasCommitChannel | undefined>(\n () =>\n canvasField\n ? {\n focused: (position, policy) => canvasFocused(canvasField, position, policy),\n blurred: (position) => canvasBlurred(canvasField, position),\n entered: (position) => canvasEntered(canvasField, position),\n }\n : undefined,\n [canvasField, canvasFocused, canvasBlurred, canvasEntered],\n )\n\n // EC-172 / EC-283 / EC-443 — the field-focus/highlight controller (jump-to-field\n // from the reference deep-link `focusPath` and the Issues pane), now path-aware:\n // `focusRequest` is provided below via `FieldFocusRequestContext` so nested\n // array/object controls can auto-expand and ring the exact target. Owns the\n // highlight + the controlled inspector-pane state and the scroll/clear timers.\n const { highlightedField, focusRequest, inspectorPaneId, setInspectorPaneId, focusField } =\n useFieldFocus({\n collection,\n source,\n focusPath,\n setActiveTab,\n })\n // EC-298 — the sticky version-compare selection. Opening it focuses the Compare tab\n // + the Versions pane; tabbing to the real fields keeps it open (only its ✕ closes\n // it). `activeTab === COMPARE_TAB` is when the diff is visible.\n const { compare, startCompare, setCompareBase, setCompareTarget, exitCompare } = useCompareSelection({\n tabs,\n compareTab: COMPARE_TAB,\n setActiveTab,\n setInspectorPaneId,\n })\n // A content tab (schema tab or References). Selecting one leaves the Compare\n // view VISIBLE-wise but keeps the comparison open (sticky) — the diff is one\n // click away on its still-present tab chip.\n const renderContentTab = (tab: string) => {\n const active = tab === activeTab\n // EC-241 labels: the References framework tab is engine chrome (catalog); a schema\n // tab with a declared `{ id, label }` shows its localized label as authored; a bare\n // id keeps the title-cased-id behaviour (`capitalize`).\n const declaredLabel = tab === REFERENCES_TAB ? undefined : tabDescriptorOf(collection.form, tab)?.label\n const display =\n tab === REFERENCES_TAB\n ? translate('references.title')\n : declaredLabel !== undefined\n ? localizedLabel(declaredLabel, tab)\n : tab\n const titleCase = tab !== REFERENCES_TAB && declaredLabel === undefined\n return (\n <button\n key={tab}\n type=\"button\"\n aria-pressed={active}\n onClick={() => setActiveTab(tab)}\n className={cn(\n 'rounded-md px-2.5 py-1 text-xs font-medium transition-colors',\n titleCase && 'capitalize',\n active ? 'bg-accent text-accent-foreground' : 'text-muted-foreground hover:bg-muted',\n )}\n >\n {display}\n </button>\n )\n }\n function getValue(field: FieldDef): unknown {\n // EC-226: read from the active VIEW (the draft, or the pinned published\n // snapshot when viewing Published) — never directly from `draft`.\n // EC-390: ONE reader. The form reads through the SAME `resolveField` the\n // canvas/delivery path uses, so the two surfaces can never disagree on which\n // stored value a field shows. This subsumes the old explicit-variant short\n // circuit (resolveField's first branch IS the explicit per-locale read) and\n // the non-localized `values` read (its non-localized branch) — pinned by the\n // reader-agreement matrix in core's `value-shape.test.ts`. A fallback value\n // is still labeled by the field's fallback marker (EC-176), so a German view\n // shows the English text visibly, never an unexplained blank.\n return resolveField(collection, viewDoc, field.name, locale, source.localeConfig).value\n }\n\n // EC-176/EC-318/EC-580: the present/absent-key write is core's single `writeField`\n // — a localized field writes `localized[locale]`, clearing (value === undefined)\n // DELETES the key (reconnecting to base). `fill from base` / `reset to base` below\n // reuse the same foundation, so typing, filling, and resetting can never diverge.\n // EC-586: the write canonicalises (`writeField`), and the manifest lookup covers a\n // composition's static props — a canvas or embed edit lands canonical in the draft.\n // EC-595 A2: each write is also the patch of the position it wrote, committed per the\n // field's control kind (`useDocumentDraft` → `commit-policy.ts`).\n function setValue(field: FieldDef, value: unknown) {\n documentDraft.setFieldValue(field, value)\n }\n\n // EC-595 A2 — the per-field conflicts and the thin presence on this document.\n const documentWrites = source.writes.kind === 'document' ? source.writes : undefined\n const conflicts = documentWrites?.conflicts(ref) ?? []\n const selfActor = getStudioActor()?.id\n function conflictNotices(field: FieldDef) {\n if (!documentWrites) return null\n const own = conflicts.filter((conflict) =>\n pathInField(conflict.path, field.name, isFieldLocalized(collection, field.name) ? locale : undefined),\n )\n if (own.length === 0) return null\n return (\n <Stack gap=\"1\">\n {own.map((conflict) => (\n <FieldConflictNotice\n key={conflict.id}\n conflict={conflict}\n actorName={conflictActorName(conflict, documentDraft.presence, selfActor)}\n onTakeTheirs={() => documentWrites.resolveConflict(ref, conflict.id, 'theirs')}\n onKeepMine={() => documentWrites.resolveConflict(ref, conflict.id, 'mine')}\n />\n ))}\n </Stack>\n )\n }\n\n // EC-273/EC-580: conditional visibility, judged in the DISPLAYED view of the\n // draft (`valuesInLocale`, with the default-locale fallback) — a localized field\n // in the active locale's view, a shared field in the default locale's view in\n // every tab. These are the views the validator skips by and the publish strip\n // clears by, so a row is shown exactly when its value is validated and survives\n // publish (M4/M8). A field whose own predicate OR whose group section's predicate\n // hides it is omitted; recomputed as the draft changes, so rows show/hide live.\n const conditionViews = localeViews(collection, draft, source.localeConfig)\n const isHidden = (field: FieldDef) => isFieldHiddenIn(collection, field, conditionViews, locale)\n // Visible = not content-hidden AND not principal-hidden (EC-240 access === 'hidden').\n const isFieldShown = (field: FieldDef) => !isHidden(field) && accessOf(field) !== 'hidden'\n const visibleSidebarFields = sidebarFieldDefs.filter(isFieldShown)\n // EC-306: a hidden group section (static or predicate) needs no separate check —\n // each member's `isHidden` already judged its group, in that member's view, so a\n // hidden section has no shown member and renders nothing (below).\n\n // One document field row (label + fallback/translation/read-only badges + the\n // control), shared by the content groups and the EC-285 Details pane so a\n // sidebar field renders identically — same control, validation, localization,\n // and EC-283 highlight/jump target — wherever it surfaces. Returns null when the\n // field is conditionally hidden (EC-273).\n function renderFieldRow(field: FieldDef) {\n if (isHidden(field)) return null\n // EC-240: principal-based access. `hidden` drops the row entirely (this\n // principal can't see the field); `read` renders it read-only. Distinct from\n // the content-conditional `isHidden` above and the view-level read-only\n // (Published perspective) — the control honors all three.\n const access = accessOf(field)\n if (access === 'hidden') return null\n const fieldLevelReadOnly = access === 'read'\n const fieldReadOnly = viewReadOnly || fieldLevelReadOnly\n const localized = isFieldLocalized(collection, field.name)\n // EC-318 — connected fields: the per-locale connection state of a localized\n // field (connected/diverged + fill-from-base), DERIVED from the draft, never\n // stored. Null for a non-localized field or the base-locale view. Suppressed\n // while the row is read-only (Published view or a field-level `read` grant) —\n // there is nothing to connect or diverge there.\n const connection = localized\n ? fieldConnection(collection, draft, field.name, locale, source.localeConfig)\n : null\n return (\n <Field\n key={field.name}\n className={cn(\n 'rounded-md transition-shadow',\n highlightedField === field.name && 'bg-primary/5 p-2 ring-2 ring-primary/70',\n )}\n label={\n <Row gap=\"2\">\n <span>{fieldLabel(field)}</span>\n {field.validation?.required ? <span className=\"text-destructive\">*</span> : null}\n {localized ? <Badge variant=\"outline\">{locale}</Badge> : null}\n {fieldLevelReadOnly ? (\n <Badge variant=\"outline\">\n <Lock className=\"size-3\" /> {translate('cms.editor.readOnlyBadge')}\n </Badge>\n ) : null}\n <Spacer />\n {/* EC-318: the connected-field affordance replaces EC-176's passive\n \"showing EN\" text — a quiet chip (Follows EN / Translated) plus the\n matching action (Fill from EN / Reset to EN, the latter confirmed).\n Right-aligned so it stays out of the way on every localized row. */}\n {connection && !fieldReadOnly ? (\n <FieldConnectionControl\n connection={connection}\n fieldName={field.name}\n locale={locale}\n onFillFromBase={() =>\n documentDraft.editField(field, (d) =>\n fillFieldFromBase(collection, d, field.name, locale, source.localeConfig),\n )\n }\n onResetToBase={() =>\n documentDraft.editField(field, (d) => resetFieldToBase(collection, d, field.name, locale))\n }\n />\n ) : null}\n </Row>\n }\n htmlFor={`f-${field.name}`}\n fieldPath={field.name}\n hint={localizedLabel(field.form?.description) || undefined}\n error={fieldReadOnly ? undefined : errorsByField.get(field.name)}\n >\n {/* EC-595 A2: the thin presence note and the per-field conflict, on the field. */}\n <FieldPresenceNote\n entries={presentInField(documentDraft.presence, fieldPositionPath(collection, field.name, locale))}\n />\n {fieldReadOnly ? null : conflictNotices(field)}\n {/* EC-443: seed the anchor-path context with the top-level field name so\n the object/repeater controls can stamp full nested anchors below it.\n EC-595 A2: the commit boundary — focus / blur / Enter drive the field's\n commit policy and the presence heartbeat. */}\n <FieldCommitBoundary\n onFocusField={() => documentDraft.focused(field)}\n onBlurField={() => documentDraft.blurred(field)}\n onEnter={() => documentDraft.entered(field)}\n >\n <FieldPathContext.Provider value={field.name}>\n <FieldControl\n id={`f-${field.name}`}\n field={field}\n value={getValue(field)}\n onChange={(v) => setValue(field, v)}\n readOnly={fieldReadOnly}\n />\n </FieldPathContext.Provider>\n </FieldCommitBoundary>\n {/* EC-315: the slug field's derived composed-path preview now lives inside the\n slug control itself (field-control's `SlugField`), which subsumes the old\n EC-246d PathPreview — so nothing extra is rendered here. */}\n </Field>\n )\n }\n\n // The frame-owned `Versions` pane (EC-224) — appended after any view-supplied\n // pane (the canvas's `Properties`). One instance feeds both the form view's\n // sidebar and the canvas view's sidebar.\n const versionsPane = useMemo<InspectorPane>(\n () => ({\n id: 'versions',\n label: translate('cms.version.paneLabel'),\n icon: <History className=\"size-3.5\" />,\n render: () => <VersionsPane />,\n }),\n [],\n )\n // The frame-owned `Issues` pane (EC-283) — the document-scoped validation\n // surface that replaces the always-on footer band. The tab carries a count\n // badge (error- vs warning-toned) so a non-zero count is discoverable from\n // any tab; document-level issues (e.g. EC-260 nesting-depth) live only here.\n const issuesPane = useMemo<InspectorPane>(\n () => ({\n id: 'issues',\n label: translate('cms.editor.issuesPane'),\n icon: <CircleAlert className=\"size-3.5\" />,\n badge:\n issues.length === 0 ? undefined : (\n <Badge\n variant={issues.some((i) => i.severity === 'error') ? 'error' : 'warning'}\n className=\"px-1.5 py-0 leading-none\"\n >\n {issues.length}\n </Badge>\n ),\n render: () => (\n <IssuesPane issues={issues} collection={collection} onJumpToField={focusField} />\n ),\n }),\n [issues, errorCount, collection, focusField],\n )\n // EC-284 + EC-285: the document-metadata pane — slot assignment (EC-284) and/or\n // the document-level `sidebar`-group fields (EC-285). Present only when the\n // collection has either, so it never adds an empty tab elsewhere. First in the\n // order, so a slotted / sidebar-bearing document opens straight to it. Not\n // memoized: its render closes over per-render edit state (draft, highlight,\n // field errors) via `renderFieldRow`, and the inspector re-renders with the rest\n // of the editor anyway, so a stable pane identity would buy nothing here.\n // 0.0.42 (round 3): whether a deployment route addresses this collection — gates the\n // header's composed-URL row (which carries the live-page affordance, EC-315 hybrid\n // split). A cheap synchronous accessor, resolved on every render (NOT frozen in a\n // `useMemo` with a static dep — the same first-paint-empty-routes trap the SlugField\n // fix removed: routes arrive after the workspace/config loads).\n const routableCollection = resolveDeploymentRoutes().some(\n (route) => route.document?.collection === collection.id,\n )\n // The composed URL moved OUT of this pane and up to the header (round 3): a lone URL\n // row on an otherwise-empty pane looked odd. So the Details pane exists only for slots\n // and/or sidebar fields — never merely because the collection is routable (that would\n // resurrect the empty-pane problem). A routable page keeps its pane via its slug\n // sidebar field; a routable collection with neither has no pane (URL is in the header).\n const detailsPane: InspectorPane | null =\n hasAliases(collection) || visibleSidebarFields.length > 0\n ? {\n id: 'details',\n label: translate('cms.editor.detailsPane'),\n icon: <Tag className=\"size-3.5\" />,\n render: () => (\n <DetailsPane\n collection={collection}\n doc={draft}\n siblings={source.documents()}\n readOnly={viewReadOnly}\n fields={visibleSidebarFields}\n renderField={renderFieldRow}\n onAliasChange={(alias) => documentDraft.setAlias(alias)}\n />\n ),\n }\n : null\n // Versions is capability-gated (AD-19): a non-versioned rail (users) never mounts\n // the pane, so no version read fires on its records.\n const trailingPanes = [\n ...(detailsPane ? [detailsPane] : []),\n ...(canVersions ? [versionsPane] : []),\n // EC-618: the project's contributed panes (an addon's per-document panel).\n ...(contributedPanes ?? []),\n issuesPane,\n ]\n\n // EC-268 / 0.0.39 — the publish controller: the publish indicator state and the\n // \"Publish & close\" navigation. Handlers are named to match the header split button.\n const { publishState, handlePublish, handlePublishAndClose } = usePublishController({\n source,\n docRef: ref,\n projectId,\n flushDraft: documentDraft.flush,\n })\n\n // EC-442 (amended): Duplicate in the header `…` menu — gated on the explicit\n // `duplicate` capability (CMS collections only, owner call 2026-07-17) + a\n // detail surface to land on, and never a singleton (its shape IS \"exactly one\n // document\"; a copy would be EC-274 drift by construction, mirroring the\n // hidden Delete).\n const canDuplicate =\n !singleton && source.capabilities.duplicate && source.detailPath !== undefined\n async function handleDuplicate() {\n // EC-595 A2: the FORCED FLUSH first — the uncommitted fields commit and land — then\n // copy the committed draft (what the editor sees). The duplicate is a fresh DRAFT,\n // never auto-published (live-is-published-only), created insert-if-absent with a\n // factory id (`duplicateFromSource`).\n await documentDraft.flush()\n const newRef = duplicateFromSource(source, source.get(ref) ?? draft)\n if (!newRef) return\n toast.success(translate('cms.editor.duplicateCreated'))\n const splat = source.detailPath?.(newRef.id)\n if (splat === undefined) return\n void navigate({ to: STUDIO_PROJECT_ROUTE, params: { projectId, _splat: splat } })\n }\n\n function handleConfirmedAction() {\n if (confirmAction === 'unpublish') {\n setConfirmAction(null)\n void source.publishing?.unpublish(ref)\n return\n }\n if (confirmAction === 'delete') {\n setConfirmAction(null)\n source.remove(ref)\n // Return to the rail's list (rail-owned `listPath`), or the project index if\n // the rail has no list surface (AD-19 — never a hard-coded CMS route).\n void navigate({\n to: STUDIO_PROJECT_ROUTE,\n params: { projectId, _splat: source.listPath ?? studioPath.index() },\n })\n }\n }\n\n // While the published snapshot is pending, don't derive the title from the\n // draft (it must not read as the published title) — fall back to the id.\n const title = publishedPending ? '' : primaryTitle(viewDoc, collection, locale, source.localeConfig)\n // EC-242: the untranslated-title chip applies only to a field-backed title; a\n // function title pattern has no single source field to mark as a fallback.\n const titleFallback =\n publishedPending || typeof collection.titleField === 'function'\n ? null\n : displayedFieldFallback(\n collection,\n viewDoc,\n titleFieldOf(collection)?.name ?? 'title',\n locale,\n source.localeConfig,\n )\n\n // EC-214: the document is the active record — contribute the collection (a\n // link back to its list) and the document title to the global header\n // breadcrumb, replacing the editor's own back-link + collection/id line. A\n // singleton has no list, so it contributes a single, non-linked crumb. The\n // title tracks the live draft so a rename updates the crumb immediately.\n const breadcrumbItems = useMemo<BreadcrumbItem[]>(() => {\n const collectionLabel = localizedLabel(collection.form?.label, collection.id)\n // A singleton (no list) or a rail with no list surface contributes a single,\n // non-linked crumb; otherwise the collection crumb links back to its list via\n // the rail-owned `listPath` (never a hard-coded CMS route — AD-19).\n if (singleton || source.listPath === undefined) return [{ label: collectionLabel }]\n const docTitle = primaryTitle(draft, collection, locale, source.localeConfig) || doc.id\n return [\n {\n label: collectionLabel,\n to: STUDIO_PROJECT_ROUTE,\n params: { projectId, _splat: source.listPath },\n },\n { label: docTitle },\n ]\n }, [singleton, collection, draft, locale, source.localeConfig, source.listPath, doc.id, projectId])\n useSetBreadcrumb(breadcrumbItems)\n\n // EC-205/EC-216 — the header composed-URL row's live-link descriptor. Derives\n // strictly from PUBLISHED data (the pinned snapshot + published ancestors), never\n // the draft, so an unpublished slug/parent edit can't leak into the live URL; the\n // draft-derived path itself (rendered by `DocumentUrlPath`) still updates as you\n // type — only the OPEN-live action is published-gated. `undefined` when the\n // collection is non-routable.\n const { headerLive } = useLiveUrl({ source, collection, doc, locale, published, routableCollection })\n\n // EC-240: hide the tab bar when there is nothing to navigate — a single content\n // tab with no References/Compare (the users rail). When framework tabs ARE\n // present we KEEP the content tab(s) so there is always a way back to the form;\n // only a genuinely single-tab surface drops them. And drop the whole lens row\n // when it would be empty (no tabs to show, no locale/perspective controls), so a\n // bare rail (users) shows no orphaned row.\n const hasFrameworkTabs = showReferences || compare !== null\n const showContentTabs = tabs.length > 1 || hasFrameworkTabs\n const showLensRow = showContentTabs || canLocales || canPublish\n\n // 0.0.39 split Publish button — the shared gate (disabled + title), computed once\n // (pure `publishGate`) so the primary \"Publish\" and the \"Publish & close\" item can\n // never diverge.\n const { disabled: publishDisabled, title: publishTitle } = publishGate({\n hasErrors,\n viewReadOnly,\n publishState,\n errorCount,\n })\n const publishButtonLabel =\n publishState === 'pending' ? (\n <>\n <Loader2 className=\"animate-spin\" /> {translate('cms.editor.publishing')}\n </>\n ) : publishState === 'success' ? (\n <>\n <CircleCheck /> {translate('cms.editor.publishedState')}\n </>\n ) : (\n <>\n <Eye /> {translate('cms.editor.publish')}\n </>\n )\n // Offer \"Publish & close\" only when there IS a list to return to — the same gate\n // the removed EC-316 \"Save & close\" used (never a singleton or a list-less rail).\n const canPublishClose = !singleton && source.listPath !== undefined\n\n return (\n <DocumentEditorProvider\n value={{\n projectId,\n collection,\n docRef: ref,\n draft,\n dirty,\n hasErrors,\n issues,\n viewReadOnly,\n save,\n replaceDraft,\n compare,\n compareActive: activeTab === COMPARE_TAB,\n startCompare,\n setCompareBase,\n setCompareTarget,\n exitCompare,\n }}\n >\n {/* EC-443: publish the in-flight jump-to-field request to every nested\n array/object control (auto-expansion + exact-target ring). */}\n <FieldFocusRequestContext.Provider value={focusRequest}>\n <div className={cn('flex h-full min-h-0 flex-col', viewReadOnly && 'bg-info/[0.04]')}>\n {/* Header — the back-link + collection/id line moved into the global\n breadcrumb (EC-214); this keeps only the record title + actions. */}\n <div className=\"shrink-0 border-b border-border px-4 py-3 sm:px-6\">\n <Row gap=\"3\" align=\"start\">\n {/* Title + the composed-URL row beneath it (round 3): the URL is a\n first-class document property, so it sits under the (dominant) title in\n secondary/muted type. Routable collections only — a non-routable record\n (asset, singleton, users) shows the title alone, with no gap. The left\n block is `min-w-0` so a long title/URL truncates instead of shoving the\n header actions around. */}\n <Stack gap=\"1\" className=\"min-w-0\">\n <Row gap=\"2\" align=\"center\" className=\"min-w-0\">\n <Heading level={1} size=\"h2\" className=\"truncate\">\n {singleton ? localizedLabel(collection.form?.label, collection.id) : title || doc.id}\n </Heading>\n {singleton ? null : <FallbackChip fallback={titleFallback} testId=\"doc-title-fallback\" />}\n </Row>\n {routableCollection ? (\n <DocumentUrlPath\n projectId={projectId}\n collection={collection}\n doc={draft}\n siblings={source.documents()}\n routes={resolveDeploymentRoutes()}\n localeConfig={source.localeConfig}\n locale={locale}\n live={headerLive}\n />\n ) : null}\n </Stack>\n <Spacer />\n {/* Save status — an autosave rail reports Saving…/Saved; an explicit rail\n (users) reports Unsaved changes until the Save button commits. EC-422:\n a failed save ALSO surfaces the specific failure message — verbatim\n from `lastError.message` (producers own its localization, the\n EC-397/412/416 pattern; no re-mapping here) — as quiet destructive\n text under the generic status, for every rail using this editor.\n Truncated with the full text on `title`, the same idiom as the title\n block, so a long raw adapter message never blows up the header row.\n No message ⇒ today's generic text alone. */}\n <Stack gap=\"none\" align=\"end\" className=\"min-w-0\">\n <Text size=\"xs\" tone=\"muted\" className=\"whitespace-nowrap\" data-testid=\"autosave-status\">\n {/* EC-595 A2: a document commits on quiescence (blur / Enter / an idle\n pause), so an uncommitted edit is \"unsaved\" until then — never \"saving\". */}\n {source.lastError\n ? translate('cms.editor.saveFailed')\n : dirty\n ? translate('cms.editor.unsavedChanges')\n : translate('cms.editor.saved')}\n </Text>\n {source.lastError?.message ? (\n <Text\n size=\"xs\"\n className=\"max-w-64 truncate text-destructive\"\n title={source.lastError.message}\n data-testid=\"save-error-message\"\n >\n {source.lastError.message}\n </Text>\n ) : null}\n </Stack>\n {canPublish ? <DocStateBadge published={published} /> : null}\n {/* EC-216 / EC-205: the standalone \"View live\" button is retired (round 3).\n Opening the live page now hangs off the composed-URL row's LEAF segment\n under the title — same published-gating, one fewer header button. */}\n {/* 0.0.39: the Publish button is a SPLIT button — primary Publish (stay) +\n a \"Publish & close\" dropdown item (publish, then return to the list). The\n retired EC-316 \"Save & close\" is gone: autosave already persists edits, so\n a bare \"Save\" was meaningless. Both actions share identical gating (schema\n errors / view-read-only / in-flight); the close item is offered only when\n there IS a list to return to (never a singleton or list-less rail). */}\n {canPublish ? (\n <Row gap=\"px\" align=\"center\">\n <Button\n size=\"sm\"\n onClick={handlePublish}\n disabled={publishDisabled}\n title={publishTitle}\n className={canPublishClose ? 'rounded-r-none' : undefined}\n data-testid=\"doc-publish\"\n >\n {publishButtonLabel}\n </Button>\n {canPublishClose ? (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n size=\"sm\"\n disabled={publishDisabled}\n aria-label={translate('cms.editor.publishActions')}\n data-testid=\"doc-publish-actions\"\n className=\"rounded-l-none border-l border-primary-foreground/25 px-1.5\"\n >\n <ChevronDown className=\"size-3.5\" />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n <DropdownMenuItem onClick={handlePublishAndClose} data-testid=\"doc-publish-and-close\">\n <Save /> {translate('cms.editor.publishAndClose')}\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n ) : null}\n </Row>\n ) : null}\n {/* EC-240: an explicit-save rail commits the draft on demand (no publish\n step). Disabled until there are unsaved edits; the guard covers leaving. */}\n {explicitSave ? (\n <Button size=\"sm\" onClick={save} disabled={!dirty} data-testid=\"doc-save\">\n <Check /> {translate('common.save')}\n </Button>\n ) : null}\n {/* EC-332: AI \"Translate document\" — fills empty locale values on the draft.\n The gate renders nothing unless the studio is ai-configured AND the\n collection is localized with a target locale (so it is absent for\n single-locale collections, assets, and unconfigured studios). */}\n {!viewReadOnly ? (\n <TranslateDocumentAction\n projectId={projectId}\n collection={collection}\n docRef={ref}\n document={draft}\n localeConfig={source.localeConfig}\n localesEnabled={canLocales}\n flushDraft={documentDraft.flush}\n />\n ) : null}\n {/* EC-217: a singleton is never deleted; with nothing else to show\n (an unpublished singleton) the actions menu is omitted entirely. */}\n {published || !singleton ? (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant=\"outline\" size=\"icon-sm\" aria-label={translate('cms.editor.moreActions')}>\n <MoreHorizontal />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n {/* EC-442: Duplicate — copy this draft into a fresh draft document\n and open it. Additive (never destructive), so no confirmation;\n gated on the explicit duplicate capability + detail surface,\n never a singleton. */}\n {canDuplicate ? (\n <DropdownMenuItem data-testid=\"doc-duplicate\" onClick={() => void handleDuplicate()}>\n <Copy /> {translate('common.duplicate')}\n </DropdownMenuItem>\n ) : null}\n {/* EC-316: \"Discard changes\" — reverts the draft to exactly the\n published content (the same restore machinery the Compare\n view's \"Restore version\" uses, EC-298). Shown only when a\n published version exists to revert to; enabled once the\n draft actually differs from it — decided by the same\n semantic comparator the Versions pane uses, so the two\n never contradict each other. */}\n {discardStatus !== 'hidden' ? (\n <DropdownMenuItem\n data-testid=\"doc-discard-draft\"\n disabled={discardStatus !== 'ready'}\n title={discardDisabledReason}\n onClick={() => setDiscardConfirm(true)}\n >\n <RotateCcw /> {translate('cms.editor.discardDraft')}\n </DropdownMenuItem>\n ) : null}\n {published ? (\n <DropdownMenuItem onClick={() => setConfirmAction('unpublish')}>\n <EyeOff /> {translate('cms.editor.unpublish')}\n </DropdownMenuItem>\n ) : null}\n {singleton ? null : (\n <DropdownMenuItem\n data-testid=\"doc-delete\"\n className=\"text-destructive\"\n onClick={() => setConfirmAction('delete')}\n >\n <Trash2 /> {translate('common.delete')}\n </DropdownMenuItem>\n )}\n </DropdownMenuContent>\n </DropdownMenu>\n ) : null}\n </Row>\n\n {/* EC-246a consistency: this lens row mirrors the list header — the tabs\n (EC-073) lead on the left (like the list's view tabs), and the lens\n CONTROLS sit on the right: the ambient locale switcher (EC-176) then the\n Draft/Published view perspective (EC-226) — exactly where the list keeps\n locale + Display, so the locale no longer jumps sides between views. */}\n {showLensRow ? (\n <Row gap=\"3\" className=\"mt-3\" wrap>\n <Row gap=\"1\" align=\"center\">\n {/* Schema content tabs (EC-073), then a divider, then the framework\n tabs (EC-269 References; EC-298 the transient Compare chip). While\n comparing, no content tab is highlighted — the Compare chip is the\n active view, and clicking a content tab closes the comparison. A\n single-tab surface with no framework tabs hides these entirely. */}\n {showContentTabs ? tabs.map((tab) => renderContentTab(tab)) : null}\n {showReferences ? (\n <>\n <div className=\"mx-1 h-4 w-px bg-border\" aria-hidden />\n {renderContentTab(REFERENCES_TAB)}\n </>\n ) : null}\n {compare ? (\n <span\n className={cn(\n 'inline-flex items-center gap-1 rounded-md px-2.5 py-1 text-xs font-medium transition-colors',\n activeTab === COMPARE_TAB\n ? 'bg-accent text-accent-foreground'\n : 'text-muted-foreground hover:bg-muted',\n )}\n >\n <button\n type=\"button\"\n onClick={() => setActiveTab(COMPARE_TAB)}\n aria-pressed={activeTab === COMPARE_TAB}\n className=\"inline-flex items-center gap-1\"\n >\n <GitCompareArrows className=\"size-3\" aria-hidden /> {translate('cms.version.compare')}\n </button>\n <button\n type=\"button\"\n onClick={exitCompare}\n aria-label={translate('cms.version.closeCompare')}\n className=\"ml-0.5 rounded p-0.5 hover:bg-background/40\"\n >\n <X className=\"size-3\" />\n </button>\n </span>\n ) : null}\n </Row>\n <Spacer />\n {canLocales ? <LocaleSwitcher /> : null}\n {canPublish ? (\n <Row gap=\"px\" className=\"rounded-md bg-muted/60 p-0.5\">\n <PerspectiveButton\n label={translate('cms.editor.draftState')}\n active={variantOf(perspective) === DRAFT_VARIANT}\n onClick={() => setPerspective(DRAFT_PERSPECTIVE)}\n />\n <PerspectiveButton\n label={translate('cms.editor.publishedState')}\n active={perspective === 'published'}\n accent=\"info\"\n disabled={!published}\n title={published ? undefined : translate('cms.editor.publishToViewPublished')}\n onClick={() => setPerspective('published')}\n />\n </Row>\n ) : null}\n </Row>\n ) : null}\n </div>\n\n {/* EC-214: an unmistakable banner whenever the read-only Published snapshot\n is in view — disabled controls + a footer notice alone read as too\n subtle. Paired with the tinted surface and the accented toggle. */}\n {viewReadOnly ? (\n <Row\n gap=\"2\"\n className=\"shrink-0 border-b border-info/30 bg-info/10 px-4 py-1.5 text-info sm:px-6\"\n data-testid=\"published-view-banner\"\n >\n <Lock className=\"size-3.5 shrink-0\" aria-hidden />\n <Text size=\"xs\" className=\"text-info\">\n {translate('cms.editor.publishedReadOnlyBanner')}\n </Text>\n <Spacer />\n <button\n type=\"button\"\n onClick={() => setPerspective(DRAFT_PERSPECTIVE)}\n className=\"text-xs font-medium underline-offset-2 hover:underline\"\n >\n {translate('cms.editor.switchToDraft')}\n </button>\n </Row>\n ) : null}\n\n {/* Body — a blocks field takes over the body with the page-builder canvas\n (which carries its own inspector sidebar, EC-188/EC-224); otherwise the\n field form sits beside the shared inspector sidebar (Versions). In\n Published view the snapshot must load before rendering — the draft is\n never shown as published (EC-226). */}\n {publishedPending ? (\n <div className=\"grid min-h-0 flex-1 place-items-center p-8\">\n <Text size=\"sm\" tone=\"muted\">\n {publishedSnapshot.status === 'loading'\n ? translate('cms.editor.loadingPublishedVersion')\n : translate('cms.editor.noPublishedVersion')}\n </Text>\n </div>\n ) : activeTab === COMPARE_TAB && compare ? (\n // EC-298: the version compare view takes over the main area, with the\n // shared inspector (Versions pane) staying on as the navigator — an\n // in-app surface, not a modal, so arbitrary versions can be browsed.\n <div className=\"flex min-h-0 flex-1 overflow-hidden\">\n <div className=\"min-h-0 flex-1 overflow-auto\">\n <VersionCompare />\n </div>\n <InspectorSidebar\n panes={trailingPanes}\n activeId={inspectorPaneId}\n onActiveChange={setInspectorPaneId}\n className=\"w-[320px] shrink-0 border-l border-border\"\n />\n </div>\n ) : canvasField ? (\n <div className=\"min-h-0 flex-1 overflow-hidden\">\n <CompositionFieldEditor\n key={`${canvasField.name}:${documentDraft.canvasNonce}:${perspectiveKey(perspective)}`}\n field={canvasField}\n value={getValue(canvasField)}\n change={documentDraft.canvasChange}\n onChange={(v, base) => documentDraft.setCanvasValue(canvasField, v, base)}\n commits={canvasCommits}\n conflicts={conflictNotices(canvasField)}\n readOnly={viewReadOnly || source.isFieldReadOnly(canvasField)}\n trailingPanes={trailingPanes}\n />\n </div>\n ) : activeTab === REFERENCES_TAB ? (\n // EC-269: mounted only while this tab is active → reference data loads on\n // demand and is torn down on leave (no fetching during normal editing).\n <div className=\"flex min-h-0 flex-1 overflow-hidden\">\n <div className=\"min-h-0 flex-1 overflow-auto p-4 sm:p-6\">\n <div className=\"mx-auto w-full max-w-2xl\">\n <ReferencesPanel\n projectId={projectId}\n source={{ type: 'document', id: documentKey(ref) }}\n target={{ type: 'document', id: documentKey(ref) }}\n />\n </div>\n </div>\n </div>\n ) : (\n <div className=\"flex min-h-0 flex-1 overflow-hidden\">\n <div className=\"min-h-0 flex-1 overflow-auto p-4 sm:p-6\">\n <div className=\"mx-auto w-full max-w-2xl\">\n <Stack gap=\"6\">\n {groups.map((group) => {\n // EC-273/EC-240/EC-306: drop a fieldset whose every field is hidden —\n // by its own rule, by its (static or predicate) group section, or for\n // this principal — so the form never shows an empty section header.\n const visible = group.fields.filter(isFieldShown)\n if (visible.length === 0) return null\n const section = group.section\n // EC-241: a section `title` is a LocalizedString ({ en, de } or a plain\n // string) — resolve it against the active UI locale before rendering.\n const sectionTitle =\n section?.title !== undefined ? localizedLabel(section.title, group.name) : undefined\n return (\n <CollapsibleSection\n key={group.name}\n collapsible={section?.collapsible}\n defaultOpen={section?.defaultOpen}\n title={\n <Text\n size=\"sm\"\n weight=\"semibold\"\n className={sectionTitle || group.name === DEFAULT_FIELD_GROUP ? undefined : 'capitalize'}\n >\n {sectionTitle ??\n (group.name === DEFAULT_FIELD_GROUP\n ? translate('cms.editor.defaultGroup')\n : group.name)}\n </Text>\n }\n >\n {/* EC-306: fractional field widths — a 12-col grid honoring each\n field's `form.width`, collapsing to one column on narrow widths. */}\n <div className=\"grid grid-cols-1 gap-4 p-4 md:grid-cols-12\">\n {visible.map((field) => (\n <div\n key={field.name}\n className={cn('col-span-1', fieldWidthColSpan(field.form?.width))}\n >\n {renderFieldRow(field)}\n </div>\n ))}\n </div>\n </CollapsibleSection>\n )\n })}\n {/* EC-396: the form-column appendix seam — a direct-value node mounted\n below the fieldset cards, inside this same `max-w-2xl` column so it\n shares the cards' width and gap-6 rhythm (the account surface's\n CredentialPanel rides here). Renders only in the form view. */}\n {formAppendix}\n </Stack>\n </div>\n </div>\n {/* EC-430/AD-D: this sidebar no longer swaps for embed props — \"Edit\n settings\" on a rich-text embed opens the EmbedPropsStage (rendered by\n the embed node view itself), the ONE form reachable identically from\n the form view and the canvas tab. */}\n <InspectorSidebar\n panes={trailingPanes}\n activeId={inspectorPaneId}\n onActiveChange={setInspectorPaneId}\n className=\"w-[320px] shrink-0 border-l border-border\"\n />\n </div>\n )}\n\n {/* EC-283: the always-on validation footer is retired. Validation now lives\n in the document-scoped `Issues` inspector pane (full list + jump-to-field,\n count badge on its tab), field issues stay inline, and the Publish button\n gates on errors. Read-only is announced by the top banner (EC-214). */}\n\n {/* EC-240: on an explicit-save rail (no autosave), guard navigation away from\n unsaved edits — offer Save / Discard / Cancel. Autosave rails flush on\n unmount instead, so the guard is inert there. */}\n {explicitSave ? (\n <UnsavedChangesGuard\n when={dirty}\n onSave={() => {\n save()\n return true\n }}\n description={translate('cms.editor.unsavedChangesGuard')}\n />\n ) : null}\n\n {/* Reference-aware unpublish/delete confirmation (EC-173). */}\n {confirmAction !== null ? (\n <ReferenceConfirmDialog\n projectId={projectId}\n action={confirmAction}\n targets={confirmTargets}\n open\n onOpenChange={(open) => {\n if (!open) setConfirmAction(null)\n }}\n onConfirm={handleConfirmedAction}\n />\n ) : null}\n\n {/* EC-316: \"Discard changes\" confirmation — reverting the draft to the\n published content is destructive to the working edits (though itself\n undoable: the restore op snapshots the pre-discard draft first, EC-298),\n so it confirms before dispatching. */}\n <Dialog open={discardConfirm} onOpenChange={(open) => { if (!open) setDiscardConfirm(false) }}>\n <DialogContent>\n <DialogHeader>\n <DialogTitle>{translate('cms.editor.discardDraftTitle')}</DialogTitle>\n <DialogDescription>\n {translate('cms.editor.discardDraftDescription')}\n </DialogDescription>\n </DialogHeader>\n <DialogFooter className=\"mt-4\">\n <Button variant=\"ghost\" size=\"sm\" onClick={() => setDiscardConfirm(false)} disabled={discardBusy}>\n {translate('common.cancel')}\n </Button>\n <Button\n variant=\"destructive\"\n size=\"sm\"\n data-testid=\"discard-draft-confirm\"\n disabled={discardBusy}\n onClick={() => void handleDiscardDraft()}\n >\n {discardBusy ? (\n <>\n <Loader2 className=\"animate-spin\" /> {translate('cms.editor.discardingDraft')}\n </>\n ) : (\n <>\n <RotateCcw /> {translate('cms.editor.discardDraftConfirm')}\n </>\n )}\n </Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n\n </div>\n </FieldFocusRequestContext.Provider>\n </DocumentEditorProvider>\n )\n}\n\n/**\n * A segmented-control button for the Draft/Published view toggle (EC-226). The\n * `accent` variant (EC-214) gives the active Published segment a distinct info\n * treatment, so the read-only mode is obvious at the control itself.\n */\nfunction PerspectiveButton({\n label,\n active,\n accent,\n disabled,\n title,\n onClick,\n}: {\n label: string\n active: boolean\n accent?: 'info'\n disabled?: boolean\n title?: string\n onClick: () => void\n}) {\n return (\n <button\n type=\"button\"\n aria-pressed={active}\n disabled={disabled}\n title={title}\n onClick={onClick}\n className={cn(\n 'rounded px-2.5 py-1 text-xs font-medium transition-colors disabled:opacity-40',\n active\n ? accent === 'info'\n ? 'bg-info text-info-foreground shadow-sm'\n : 'bg-background text-foreground shadow-sm'\n : 'text-muted-foreground hover:text-foreground',\n )}\n >\n {label}\n </button>\n )\n}\n\ninterface FieldGroup {\n name: string\n fields: FieldDef[]\n /** EC-306: the presentational section descriptor, if one was declared for this group. */\n section?: FieldGroupSection\n}\n\n/** The implicit fieldset that holds fields with no declared `form.group` (localized via `cms.editor.defaultGroup`). */\nconst DEFAULT_FIELD_GROUP = 'fields'\n\nfunction groupFields(fields: FieldDef[], collection: CollectionDef): FieldGroup[] {\n const order = groupOrder(collection.form)\n const byGroup = new Map<string, FieldDef[]>()\n for (const field of fields) {\n const group = field.form?.group ?? DEFAULT_FIELD_GROUP\n if (!byGroup.has(group)) byGroup.set(group, [])\n byGroup.get(group)!.push(field)\n }\n const names = [...byGroup.keys()].sort((a, b) => {\n const ia = order.indexOf(a)\n const ib = order.indexOf(b)\n return (ia < 0 ? 99 : ia) - (ib < 0 ? 99 : ib)\n })\n return names.map((name) => ({\n name,\n section: groupSectionOf(collection.form, name),\n fields: byGroup.get(name)!.sort((a, b) => (a.form?.order ?? 99) - (b.form?.order ?? 99)),\n }))\n}\n\n// EC-306: translate a field's grid span (FIELD_WIDTH_SPANS, owned + tested in\n// core) into a literal Tailwind col-span class. Literal strings so Tailwind's\n// scanner generates them; the span math itself is single-sourced in core.\nconst COL_SPAN_CLASS: Record<number, string> = {\n 3: 'md:col-span-3',\n 4: 'md:col-span-4',\n 6: 'md:col-span-6',\n 8: 'md:col-span-8',\n 9: 'md:col-span-9',\n 12: 'md:col-span-12',\n}\n\nfunction fieldWidthColSpan(width: FieldWidth | undefined): string {\n return COL_SPAN_CLASS[FIELD_WIDTH_SPANS[width ?? '100%']] ?? 'md:col-span-12'\n}\n\nfunction primaryTitle(\n doc: CmsDocument,\n collection: CollectionDef,\n locale: Locale,\n config: LocaleConfig,\n): string {\n // EC-242: the header title is the document identity (resolveDocumentTitle) — a\n // string `titleField` or a function pattern — over the fallback-resolved values,\n // the same resolver that drives relation labels and the list title column.\n return resolveDocumentTitle(collection, valuesInLocale(collection, doc, locale, config), '')\n}\n"]}
|
|
1
|
+
{"version":3,"file":"detail-editor.js","sourceRoot":"","sources":["../../../src/components/cms/detail-editor.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,oBAAoB,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAC9F,OAAO,EACL,KAAK,EACL,WAAW,EACX,WAAW,EACX,WAAW,EACX,IAAI,EACJ,GAAG,EACH,MAAM,EACN,gBAAgB,EAChB,OAAO,EACP,OAAO,EACP,IAAI,EACJ,cAAc,EACd,SAAS,EACT,IAAI,EACJ,GAAG,EACH,MAAM,EACN,CAAC,GACF,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEtD,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,UAAU,EACV,cAAc,EACd,UAAU,EACV,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,oBAAoB,EACpB,YAAY,EACZ,aAAa,EACb,eA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rB,CAAA;AAED,SAAS,iBAAiB,CAAC,KAA6B;IACtD,OAAO,cAAc,CAAC,iBAAiB,CAAC,KAAK,IAAI,MAAM,CAAC,CAAC,IAAI,gBAAgB,CAAA;AAC/E,CAAC;AAED,SAAS,YAAY,CACnB,GAAgB,EAChB,UAAyB,EACzB,MAAc,EACd,MAAoB;IAEpB,+EAA+E;IAC/E,iFAAiF;IACjF,2EAA2E;IAC3E,OAAO,oBAAoB,CAAC,UAAU,EAAE,cAAc,CAAC,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAA;AAC9F,CAAC","sourcesContent":["import { Link, STUDIO_PROJECT_ROUTE, studioPath, useNavigate } from '@elytracms/studio/router'\nimport {\n Check,\n ChevronDown,\n CircleAlert,\n CircleCheck,\n Copy,\n Eye,\n EyeOff,\n GitCompareArrows,\n History,\n Loader2,\n Lock,\n MoreHorizontal,\n RotateCcw,\n Save,\n Tag,\n Trash2,\n X,\n} from 'lucide-react'\nimport { useCallback, useMemo, useState } from 'react'\nimport type { ReactNode } from 'react'\nimport {\n DRAFT_PERSPECTIVE,\n DRAFT_VARIANT,\n FIELD_WIDTH_SPANS,\n SIDEBAR_FIELD_GROUP,\n documentKey,\n groupOrder,\n groupSectionOf,\n hasAliases,\n isBlocksField,\n isFieldHiddenIn,\n isFieldLocalized,\n isSingleton,\n localeViews,\n resolveDocumentTitle,\n resolveField,\n sidebarFields,\n tabDescriptorOf,\n tabOrder,\n titleFieldOf,\n staticFieldHidden,\n valuesInLocale,\n perspectiveKey,\n variantOf,\n} from '@elytracms/core/cms-core'\nimport type {\n CmsDocument,\n CollectionDef,\n FieldDef,\n FieldGroupSection,\n FieldWidth,\n Locale,\n LocaleConfig,\n} from '@elytracms/core/cms-core'\nimport {\n Badge,\n Button,\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n CollapsibleSection,\n Field,\n Heading,\n Row,\n Spacer,\n Stack,\n Text,\n toast,\n} from '@elytracms/studio/ui'\nimport { studioManifestLookup } from '../../lib/registry'\nimport { cn } from '../../lib/utils'\nimport { localizedLabel, translate } from '../../lib/i18n'\nimport {\n LocaleSwitcher,\n displayedFieldFallback,\n fieldConnection,\n fillFieldFromBase,\n resetFieldToBase,\n} from '../../lib/locale'\nimport type { ReferenceAction } from '../../lib/references'\nimport { FallbackChip } from './cell'\nimport { FieldConnectionControl } from './field-connection'\nimport { FieldControl } from './field-control'\nimport { duplicateFromSource } from './duplicate-document'\n// EC-322: the lazy-wrapped page builder — the heavy canvas subtree code-splits out\n// of the detail-view critical path and downloads only when a `blocks` field opens.\nimport { CompositionFieldEditor } from '../builder/composition-field-editor-lazy'\nimport type { CanvasCommitChannel } from '../builder/canvas-commit-boundary'\nimport { fieldLabel } from './cms-labels'\nimport { useCmsCollectionViewSource } from '../collection-view/cms-collection-view-source'\nimport { CollectionViewProvider, useCollectionView } from '../collection-view/collection-view-context'\nimport { resolveFieldAccess } from '../../lib/collection-view/collection-view-source'\nimport type { CollectionViewSource } from '../../lib/collection-view/collection-view-source'\nimport { DocStateBadge } from './doc-state'\nimport { UnsavedChangesGuard } from '../guards'\nimport { ReferenceConfirmDialog } from './reference-confirm'\nimport { ReferencesPanel } from '../references/references-panel'\nimport { InspectorSidebar } from '../inspector/inspector-sidebar'\nimport type { InspectorPane } from '../inspector/inspector-sidebar'\nimport { useContributedDocumentPanes } from '../inspector/document-panes'\nimport { DocumentEditorProvider } from './document-editor-context'\nimport { TranslateDocumentAction } from '../ai/translate-document-action'\nimport { VersionsPane } from './versions-pane'\n// EC-322: the lazy-wrapped compare view — its diff UI code-splits off the detail-view\n// critical path and loads only when the Compare tab opens.\nimport { VersionCompare } from './version-compare-lazy'\nimport { IssuesPane } from './issues-pane'\nimport { DetailsPane } from './details-pane'\nimport { DocumentUrlPath } from './document-url-path'\nimport { useSetBreadcrumb } from '../breadcrumb-context'\nimport type { BreadcrumbItem } from '../breadcrumb-context'\nimport { useAiCurrentDocumentTap } from '../../lib/ai-current-document'\nimport { resolveDeploymentRoutes } from '../../lib/workspace'\n// EC-325 — the controller hooks EditorBody orchestrates (each independently\n// unit-tested at its pure core); the shell threads shared draft/ref/replaceDraft\n// state across their boundaries.\nimport { usePublishedPerspective } from './use-published-perspective'\nimport { useDocumentDraft } from './use-document-draft'\nimport {\n FieldCommitBoundary,\n FieldConflictNotice,\n FieldPresenceNote,\n conflictActorName,\n pathInField,\n presentInField,\n} from './field-collaboration'\nimport { fieldPositionPath } from '../../lib/cms/field-patch'\nimport { getStudioActor } from '../../lib/operations'\nimport { useDiscardController } from './use-discard-controller'\nimport { usePublishController, publishGate } from './use-publish-controller'\nimport { FieldFocusRequestContext, FieldPathContext } from './field-anchors'\nimport { useFieldFocus } from './use-field-focus'\nimport { useCompareSelection } from './use-compare-selection'\nimport { useLiveUrl } from './use-live-url'\nimport { cmsValidationIssueMessage } from '../../lib/persona/labels'\nimport { inlineFieldErrors } from './inline-field-errors'\n\nexport function DetailEditor({\n projectId,\n collectionId,\n documentId,\n focusPath,\n}: {\n projectId: string\n collectionId: string\n documentId: string\n /** Reference-index field path (`?field=`, EC-172): highlight + scroll to the exact field. */\n focusPath?: string\n}) {\n // AD-19: the edit shell is a portable surface over a CollectionViewSource, just\n // like the list. `DetailEditor` is the CMS entry point — it builds the CMS source\n // and hands it to the portable {@link PortableDetailEditor} so `EditorBody` (and\n // the shared field controls / pickers) render over the source, never `useCms()`.\n const source = useCmsCollectionViewSource(collectionId)\n // EC-618: the project's contributed inspector panes (`defineStudio({ documentPanes })`) —\n // CMS documents only, so this entry point resolves them and the rails' do not.\n const contributedPanes = useContributedDocumentPanes(projectId, collectionId, documentId)\n if (!source) {\n return (\n <DocumentNotFound\n projectId={projectId}\n listPath={studioPath.cmsCollection(collectionId)}\n label={collectionId}\n />\n )\n }\n return (\n <PortableDetailEditor\n source={source}\n projectId={projectId}\n documentId={documentId}\n focusPath={focusPath}\n contributedPanes={contributedPanes}\n />\n )\n}\n\n/**\n * The portable edit shell (EC-240 / AD-19): resolve the record by id from ANY\n * {@link CollectionViewSource}, then render the shared {@link EditorBody} over it.\n * The CMS entry point ({@link DetailEditor}) and the users rail both mount this —\n * routing (the \"back to list\" target, the not-found link) is rail-owned via\n * `source.listPath`, so the shell never hard-codes the CMS route.\n */\nexport function PortableDetailEditor({\n source,\n projectId,\n documentId,\n focusPath,\n formAppendix,\n contributedPanes,\n}: {\n source: CollectionViewSource\n projectId: string\n documentId: string\n focusPath?: string\n /** EC-618: panes contributed to the inspector (appended after the frame's Details / Versions, before Issues). */\n contributedPanes?: readonly InspectorPane[]\n /**\n * EC-396 — a form-column appendix seam (a direct-value node, per the customization\n * principle — no registry): rendered INSIDE the editor's form column, below the\n * fieldset cards, at the same `max-w-2xl` width and gap-6 rhythm. The account\n * surface mounts its `CredentialPanel` through it so the account page is ONE editor\n * surface (the editor owns the scroll + fills the height, so the Issues sidebar\n * spans the full surface), never a second parallel card wrapper. Absent for the CMS\n * and users entry points, which pass nothing.\n */\n formAppendix?: ReactNode\n}) {\n const doc = source.get({ collection: source.collectionId, id: documentId })\n // EC-274: singleton opening is owned by `SingletonGate` (it resolves the lone\n // document and materializes it). The detail editor just renders the document it\n // is given by id — singletons need no special case here.\n if (!doc) {\n return (\n <DocumentNotFound\n projectId={projectId}\n listPath={source.listPath}\n label={localizedLabel(source.schema.form?.label, source.collectionId)}\n />\n )\n }\n return (\n <CollectionViewProvider source={source}>\n <EditorBody\n key={`${source.collectionId}/${documentId}`}\n projectId={projectId}\n collection={source.schema}\n doc={doc}\n focusPath={focusPath}\n formAppendix={formAppendix}\n contributedPanes={contributedPanes}\n />\n </CollectionViewProvider>\n )\n}\n\n/** The record-not-found state — a heading + a rail-owned \"back to list\" link. */\nfunction DocumentNotFound({\n projectId,\n listPath,\n label,\n}: {\n projectId: string\n listPath?: string\n label: string\n}) {\n return (\n <div className=\"grid h-full place-items-center p-8\">\n <Stack gap=\"3\" align=\"center\" className=\"text-center\">\n <Heading level={2} size=\"h2\">\n {translate('cms.editor.notFoundTitle')}\n </Heading>\n {listPath !== undefined ? (\n <Link\n to={STUDIO_PROJECT_ROUTE}\n params={{ projectId, _splat: listPath }}\n className=\"text-sm text-primary hover:underline\"\n >\n {translate('cms.editor.backToList', { label })}\n </Link>\n ) : null}\n </Stack>\n </div>\n )\n}\n\nfunction EditorBody({\n projectId,\n collection,\n doc,\n focusPath,\n formAppendix,\n contributedPanes,\n}: {\n projectId: string\n collection: CollectionDef\n doc: CmsDocument\n focusPath?: string\n /** EC-396: rendered below the fieldset cards, inside the form column (see {@link PortableDetailEditor}). */\n formAppendix?: ReactNode\n /** EC-618: contributed inspector panes (see {@link PortableDetailEditor}). */\n contributedPanes?: readonly InspectorPane[]\n}) {\n const source = useCollectionView()\n const navigate = useNavigate()\n // AD-19: capability flags gate whole shell regions AND their method groups, so\n // the SAME edit shell serves a non-publishing / non-versioned / single-locale\n // rail (the users rail, EC-240) without a bespoke editor. A false flag hides its\n // region entirely — no dead controls, no reads fired on that region's behalf.\n const canPublish = source.capabilities.publish\n const canVersions = source.capabilities.versions\n const canLocales = source.capabilities.locales\n // References is the CMS content-graph surface (the reference index tracks the\n // publishable document rail). A non-publishing rail (users, future redirects) is\n // not part of that graph, so its References tab would be structurally empty —\n // gate it off. A dedicated `references` capability can split this later if a\n // non-publishing-but-referenceable rail appears (YAGNI today).\n const showReferences = canPublish\n // Principal-based field access (EC-240, AD-18): `edit|read|hidden`, resolved\n // per field for the current principal. Default-open — a source with no policy\n // derives it from `isFieldReadOnly`. Access depends on the record's identity, not\n // its edited values (content-conditional hiding is the separate `isHidden` axis),\n // so it keys off the stable `doc`, never the live draft.\n const accessOf = useCallback(\n (field: FieldDef) => resolveFieldAccess(source, field, doc),\n [source, doc],\n )\n // EC-217: a singleton collection has no list — there is nowhere to go \"back\"\n // to, and its one document is fixed (never deleted). The header drops the\n // back-crumb/id line and the Delete action accordingly.\n const singleton = isSingleton(collection)\n // The studio's ambient active locale (EC-176): the form displays and edits\n // exactly this locale — switched via the shared LocaleSwitcher, never per field.\n const locale = source.activeLocale\n // EC-173: unpublish/delete go through the reference-aware confirmation.\n const [confirmAction, setConfirmAction] = useState<ReferenceAction | null>(null)\n // Stable so the document-editor context value (EC-224) doesn't churn each render.\n const ref = useMemo(() => ({ collection: collection.id, id: doc.id }), [collection.id, doc.id])\n const confirmTargets = useMemo(\n () => [{ collection: collection.id, id: doc.id }],\n [collection.id, doc.id],\n )\n\n // EC-595 A2 — the draft over the revisioned document (`useDocumentDraft`): per-keystroke\n // edits, committed per control kind (commit on quiescence) as the patches of the\n // positions they wrote; rebased on the session's document whenever it changes (a write\n // result, a colleague's change by subscription); forced flushes on unmount and tab\n // hide; the thin presence heartbeat. The explicit-save rails keep their Save button.\n // EC-188: the canvas field is found from the schema (its tab), so the draft knows it.\n const lookupManifest = useMemo(() => studioManifestLookup(), [])\n const draftCanvasField = collection.fields.find(isBlocksField)\n const documentDraft = useDocumentDraft({\n source,\n collection,\n doc,\n locale,\n lookupManifest,\n ...(draftCanvasField ? { canvasField: draftCanvasField } : {}),\n })\n const { draft, dirty, explicitSave } = documentDraft\n // `save` — the forced commit (document model) / the Save button (record model);\n // `replaceDraft` adopts a restored snapshot (the canvas remounts when its value moved).\n const save = documentDraft.save\n const replaceDraft = documentDraft.replaceDraft\n\n // EC-378 — the current-document seam: publish WHICH document is open so the AI\n // assistant resolves \"this document\" without asking, and the FORCED FLUSH it runs\n // before reading or patching it (EC-595 A2 — the assistant's applied changes reach\n // this editor through the session, which the draft rebases on).\n useAiCurrentDocumentTap({\n collection: collection.id,\n id: doc.id,\n title: primaryTitle(draft, collection, locale, source.localeConfig) || doc.id,\n flush: documentDraft.flush,\n })\n\n // EC-226 / EC-316 / EC-325 — the Draft/Published VIEW perspective AND the pinned\n // published snapshot, both derived from the ONE shared version-history query\n // (AD-17: the single operations-backed cache — no raw `source.versioning.load`\n // in this component). `canDiscard`/`versionKey`/`publishedVersionNumber`/\n // `publishedSnapshotDoc` feed the Discard controller below off that same query.\n const {\n perspective,\n setPerspective,\n published,\n canDiscard,\n versionKey,\n publishedVersionNumber,\n publishedSnapshotDoc,\n publishedSnapshot,\n viewReadOnly,\n viewDoc,\n publishedPending,\n } = usePublishedPerspective({ ref, source, canPublish, canVersions, draft })\n\n // EC-586: THE equality verdict (`semanticValueEqual` over canonical forms) is the\n // draft's `dirty` (`useDocumentDraft`): uncommitted positions exist.\n // EC-589: ONE validation path. A strict relation (the reuse embed declares\n // `strict: true` on its relation prop) to an unpublished target is a blocking error\n // from the validator's relation-target pass — at every position the reference walk\n // reaches, localized buckets and rich-text embeds included — so it gates the Publish\n // button like any other error, and `documents.publish` refuses it for every client.\n // (The EC-300 special case that walked top-level `blocks` in `values` only, and let\n // the editor publish through, is gone.)\n const issues = useMemo(() => source.validate(draft), [source, draft])\n const errorCount = issues.filter((i) => i.severity === 'error').length\n const hasErrors = errorCount > 0\n\n // EC-595 A2 · EC-240 — the write model decides the discipline (`source.writes`): a\n // document commits on quiescence and flushes on unmount / tab hide; a record saves\n // explicitly and relies on the `UnsavedChangesGuard` below for navigation.\n\n // EC-316 / EC-325 — the \"Discard changes\" controller: the pure enablement\n // decision plus the shared restore sequence (flush → restore the pinned published\n // version whole → replaceDraft → invalidate). Destructured to the names the header\n // menu + confirm dialog already use.\n const {\n status: discardStatus,\n disabledReason: discardDisabledReason,\n confirmOpen: discardConfirm,\n setConfirmOpen: setDiscardConfirm,\n busy: discardBusy,\n discard: handleDiscardDraft,\n } = useDiscardController({\n canDiscard,\n published,\n viewReadOnly,\n publishedSnapshotDoc,\n publishedVersionNumber,\n versionKey,\n draft,\n source,\n docRef: ref,\n replaceDraft,\n dirty,\n save,\n })\n // EC-498: inline errors anchor on the issue's PATH resolved to its owning\n // top-level row, never on `meta.field` — that carries the LEAF subfield name,\n // so a nested repeater issue used to vanish from the form or land on an\n // unrelated top-level field that happened to share the leaf's name.\n const errorsByField = useMemo(\n () => inlineFieldErrors(collection, issues, cmsValidationIssueMessage),\n [collection, issues],\n )\n\n // EC-241: `form.tabs` may declare tabs as bare ids OR `{ id, label }` objects with a\n // localizable title — resolve to the ordered id list for all tab logic; labels are\n // resolved for display in `renderContentTab`.\n const declaredTabs = tabOrder(collection.form)\n const tabs = declaredTabs.length > 0 ? declaredTabs : ['main']\n // EC-269: References gets its own dedicated, visibility-gated tab — it mounts\n // (and loads) only when selected, and unmounts on leave, so normal editing\n // never triggers reference fetching. Appended after the collection's content tabs.\n const REFERENCES_TAB = 'references'\n // EC-298: the version-compare view is a sticky framework tab (kept open while\n // you tab to the real fields; closed only by its ✕).\n const COMPARE_TAB = 'compare'\n const [activeTab, setActiveTab] = useState(tabs[0]!)\n // EC-285: the reserved `sidebar` group is document-level metadata (slug, author…)\n // — it renders in the Details inspector pane, not as a content tab, so it is\n // excluded from the tab fields here and collected once below.\n const sidebarFieldDefs = useMemo(() => sidebarFields(collection), [collection])\n // EC-273: only STATICALLY hidden fields (`hidden: true`) are structurally\n // excluded here; a conditionally (predicate) hidden field stays in the tab and\n // is evaluated per-render against the current values (it may show or hide as the\n // editor types).\n const tabFields = collection.fields.filter(\n (f) =>\n (f.form?.tab ?? tabs[0]) === activeTab &&\n !staticFieldHidden(f) &&\n f.form?.group !== SIDEBAR_FIELD_GROUP,\n )\n const groups = groupFields(tabFields, collection)\n // EC-188 (AD-12): a composition (`blocks`) field is a special content feature,\n // not a field-row — it takes over its tab with the full page-builder canvas.\n // Convention: such a field lives on its own dedicated fieldset tab.\n const canvasField = tabFields.find(isBlocksField)\n // EC-630 — the canvas inspector's commit boundaries reach this draft's committer: a burst\n // of typing in a prop or a typography run commits on its control kind's policy.\n const { canvasFocused, canvasBlurred, canvasEntered } = documentDraft\n const canvasCommits = useMemo<CanvasCommitChannel | undefined>(\n () =>\n canvasField\n ? {\n focused: (position, policy) => canvasFocused(canvasField, position, policy),\n blurred: (position) => canvasBlurred(canvasField, position),\n entered: (position) => canvasEntered(canvasField, position),\n }\n : undefined,\n [canvasField, canvasFocused, canvasBlurred, canvasEntered],\n )\n\n // EC-172 / EC-283 / EC-443 — the field-focus/highlight controller (jump-to-field\n // from the reference deep-link `focusPath` and the Issues pane), now path-aware:\n // `focusRequest` is provided below via `FieldFocusRequestContext` so nested\n // array/object controls can auto-expand and ring the exact target. Owns the\n // highlight + the controlled inspector-pane state and the scroll/clear timers.\n const { highlightedField, focusRequest, inspectorPaneId, setInspectorPaneId, focusField } =\n useFieldFocus({\n collection,\n source,\n focusPath,\n setActiveTab,\n })\n // EC-298 — the sticky version-compare selection. Opening it focuses the Compare tab\n // + the Versions pane; tabbing to the real fields keeps it open (only its ✕ closes\n // it). `activeTab === COMPARE_TAB` is when the diff is visible.\n const { compare, startCompare, setCompareBase, setCompareTarget, exitCompare } = useCompareSelection({\n tabs,\n compareTab: COMPARE_TAB,\n setActiveTab,\n setInspectorPaneId,\n })\n // A content tab (schema tab or References). Selecting one leaves the Compare\n // view VISIBLE-wise but keeps the comparison open (sticky) — the diff is one\n // click away on its still-present tab chip.\n const renderContentTab = (tab: string) => {\n const active = tab === activeTab\n // EC-241 labels: the References framework tab is engine chrome (catalog); a schema\n // tab with a declared `{ id, label }` shows its localized label as authored; a bare\n // id keeps the title-cased-id behaviour (`capitalize`).\n const declaredLabel = tab === REFERENCES_TAB ? undefined : tabDescriptorOf(collection.form, tab)?.label\n const display =\n tab === REFERENCES_TAB\n ? translate('references.title')\n : declaredLabel !== undefined\n ? localizedLabel(declaredLabel, tab)\n : tab\n const titleCase = tab !== REFERENCES_TAB && declaredLabel === undefined\n return (\n <button\n key={tab}\n type=\"button\"\n aria-pressed={active}\n onClick={() => setActiveTab(tab)}\n className={cn(\n 'rounded-md px-2.5 py-1 text-xs font-medium transition-colors',\n titleCase && 'capitalize',\n active ? 'bg-accent text-accent-foreground' : 'text-muted-foreground hover:bg-muted',\n )}\n >\n {display}\n </button>\n )\n }\n function getValue(field: FieldDef): unknown {\n // EC-226: read from the active VIEW (the draft, or the pinned published\n // snapshot when viewing Published) — never directly from `draft`.\n // EC-390: ONE reader. The form reads through the SAME `resolveField` the\n // canvas/delivery path uses, so the two surfaces can never disagree on which\n // stored value a field shows. This subsumes the old explicit-variant short\n // circuit (resolveField's first branch IS the explicit per-locale read) and\n // the non-localized `values` read (its non-localized branch) — pinned by the\n // reader-agreement matrix in core's `value-shape.test.ts`. A fallback value\n // is still labeled by the field's fallback marker (EC-176), so a German view\n // shows the English text visibly, never an unexplained blank.\n return resolveField(collection, viewDoc, field.name, locale, source.localeConfig).value\n }\n\n // EC-176/EC-318/EC-580: the present/absent-key write is core's single `writeField`\n // — a localized field writes `localized[locale]`, clearing (value === undefined)\n // DELETES the key (reconnecting to base). `fill from base` / `reset to base` below\n // reuse the same foundation, so typing, filling, and resetting can never diverge.\n // EC-586: the write canonicalises (`writeField`), and the manifest lookup covers a\n // composition's static props — a canvas or embed edit lands canonical in the draft.\n // EC-595 A2: each write is also the patch of the position it wrote, committed per the\n // field's control kind (`useDocumentDraft` → `commit-policy.ts`).\n function setValue(field: FieldDef, value: unknown) {\n documentDraft.setFieldValue(field, value)\n }\n\n // EC-595 A2 — the per-field conflicts and the thin presence on this document.\n const documentWrites = source.writes.kind === 'document' ? source.writes : undefined\n const conflicts = documentWrites?.conflicts(ref) ?? []\n const selfActor = getStudioActor()?.id\n function conflictNotices(field: FieldDef) {\n if (!documentWrites) return null\n const own = conflicts.filter((conflict) =>\n pathInField(conflict.path, field.name, isFieldLocalized(collection, field.name) ? locale : undefined),\n )\n if (own.length === 0) return null\n return (\n <Stack gap=\"1\">\n {own.map((conflict) => (\n <FieldConflictNotice\n key={conflict.id}\n conflict={conflict}\n actorName={conflictActorName(conflict, documentDraft.presence, selfActor)}\n onTakeTheirs={() => documentWrites.resolveConflict(ref, conflict.id, 'theirs')}\n onKeepMine={() => documentWrites.resolveConflict(ref, conflict.id, 'mine')}\n />\n ))}\n </Stack>\n )\n }\n\n // EC-273/EC-580: conditional visibility, judged in the DISPLAYED view of the\n // draft (`valuesInLocale`, with the default-locale fallback) — a localized field\n // in the active locale's view, a shared field in the default locale's view in\n // every tab. These are the views the validator skips by and the publish strip\n // clears by, so a row is shown exactly when its value is validated and survives\n // publish (M4/M8). A field whose own predicate OR whose group section's predicate\n // hides it is omitted; recomputed as the draft changes, so rows show/hide live.\n const conditionViews = localeViews(collection, draft, source.localeConfig)\n const isHidden = (field: FieldDef) => isFieldHiddenIn(collection, field, conditionViews, locale)\n // Visible = not content-hidden AND not principal-hidden (EC-240 access === 'hidden').\n const isFieldShown = (field: FieldDef) => !isHidden(field) && accessOf(field) !== 'hidden'\n const visibleSidebarFields = sidebarFieldDefs.filter(isFieldShown)\n // EC-306: a hidden group section (static or predicate) needs no separate check —\n // each member's `isHidden` already judged its group, in that member's view, so a\n // hidden section has no shown member and renders nothing (below).\n\n // One document field row (label + fallback/translation/read-only badges + the\n // control), shared by the content groups and the EC-285 Details pane so a\n // sidebar field renders identically — same control, validation, localization,\n // and EC-283 highlight/jump target — wherever it surfaces. Returns null when the\n // field is conditionally hidden (EC-273).\n function renderFieldRow(field: FieldDef) {\n if (isHidden(field)) return null\n // EC-240: principal-based access. `hidden` drops the row entirely (this\n // principal can't see the field); `read` renders it read-only. Distinct from\n // the content-conditional `isHidden` above and the view-level read-only\n // (Published perspective) — the control honors all three.\n const access = accessOf(field)\n if (access === 'hidden') return null\n const fieldLevelReadOnly = access === 'read'\n const fieldReadOnly = viewReadOnly || fieldLevelReadOnly\n const localized = isFieldLocalized(collection, field.name)\n // EC-318 — connected fields: the per-locale connection state of a localized\n // field (connected/diverged + fill-from-base), DERIVED from the draft, never\n // stored. Null for a non-localized field or the base-locale view. Suppressed\n // while the row is read-only (Published view or a field-level `read` grant) —\n // there is nothing to connect or diverge there.\n const connection = localized\n ? fieldConnection(collection, draft, field.name, locale, source.localeConfig)\n : null\n return (\n <Field\n key={field.name}\n className={cn(\n 'rounded-md transition-shadow',\n highlightedField === field.name && 'bg-primary/5 p-2 ring-2 ring-primary/70',\n )}\n label={\n <Row gap=\"2\">\n <span>{fieldLabel(field)}</span>\n {field.validation?.required ? <span className=\"text-destructive\">*</span> : null}\n {localized ? <Badge variant=\"outline\">{locale}</Badge> : null}\n {fieldLevelReadOnly ? (\n <Badge variant=\"outline\">\n <Lock className=\"size-3\" /> {translate('cms.editor.readOnlyBadge')}\n </Badge>\n ) : null}\n <Spacer />\n {/* EC-318: the connected-field affordance replaces EC-176's passive\n \"showing EN\" text — a quiet chip (Follows EN / Translated) plus the\n matching action (Fill from EN / Reset to EN, the latter confirmed).\n Right-aligned so it stays out of the way on every localized row. */}\n {connection && !fieldReadOnly ? (\n <FieldConnectionControl\n connection={connection}\n fieldName={field.name}\n locale={locale}\n onFillFromBase={() =>\n documentDraft.editField(field, (d) =>\n fillFieldFromBase(collection, d, field.name, locale, source.localeConfig),\n )\n }\n onResetToBase={() =>\n documentDraft.editField(field, (d) => resetFieldToBase(collection, d, field.name, locale))\n }\n />\n ) : null}\n </Row>\n }\n htmlFor={`f-${field.name}`}\n fieldPath={field.name}\n hint={localizedLabel(field.form?.description) || undefined}\n error={fieldReadOnly ? undefined : errorsByField.get(field.name)}\n >\n {/* EC-595 A2: the thin presence note and the per-field conflict, on the field. */}\n <FieldPresenceNote\n entries={presentInField(documentDraft.presence, fieldPositionPath(collection, field.name, locale))}\n />\n {fieldReadOnly ? null : conflictNotices(field)}\n {/* EC-443: seed the anchor-path context with the top-level field name so\n the object/repeater controls can stamp full nested anchors below it.\n EC-595 A2: the commit boundary — focus / blur / Enter drive the field's\n commit policy and the presence heartbeat. */}\n <FieldCommitBoundary\n onFocusField={() => documentDraft.focused(field)}\n onBlurField={() => documentDraft.blurred(field)}\n onEnter={() => documentDraft.entered(field)}\n >\n <FieldPathContext.Provider value={field.name}>\n <FieldControl\n id={`f-${field.name}`}\n field={field}\n value={getValue(field)}\n onChange={(v) => setValue(field, v)}\n readOnly={fieldReadOnly}\n />\n </FieldPathContext.Provider>\n </FieldCommitBoundary>\n {/* EC-315: the slug field's derived composed-path preview now lives inside the\n slug control itself (field-control's `SlugField`), which subsumes the old\n EC-246d PathPreview — so nothing extra is rendered here. */}\n </Field>\n )\n }\n\n // The frame-owned `Versions` pane (EC-224) — appended after any view-supplied\n // pane (the canvas's `Properties`). One instance feeds both the form view's\n // sidebar and the canvas view's sidebar.\n const versionsPane = useMemo<InspectorPane>(\n () => ({\n id: 'versions',\n label: translate('cms.version.paneLabel'),\n icon: <History className=\"size-3.5\" />,\n render: () => <VersionsPane />,\n }),\n [],\n )\n // The frame-owned `Issues` pane (EC-283) — the document-scoped validation\n // surface that replaces the always-on footer band. The tab carries a count\n // badge (error- vs warning-toned) so a non-zero count is discoverable from\n // any tab; document-level issues (e.g. EC-260 nesting-depth) live only here.\n const issuesPane = useMemo<InspectorPane>(\n () => ({\n id: 'issues',\n label: translate('cms.editor.issuesPane'),\n icon: <CircleAlert className=\"size-3.5\" />,\n badge:\n issues.length === 0 ? undefined : (\n <Badge\n variant={issues.some((i) => i.severity === 'error') ? 'error' : 'warning'}\n className=\"px-1.5 py-0 leading-none\"\n >\n {issues.length}\n </Badge>\n ),\n render: () => (\n <IssuesPane issues={issues} collection={collection} onJumpToField={focusField} />\n ),\n }),\n [issues, errorCount, collection, focusField],\n )\n // EC-284 + EC-285: the document-metadata pane — slot assignment (EC-284) and/or\n // the document-level `sidebar`-group fields (EC-285). Present only when the\n // collection has either, so it never adds an empty tab elsewhere. First in the\n // order, so a slotted / sidebar-bearing document opens straight to it. Not\n // memoized: its render closes over per-render edit state (draft, highlight,\n // field errors) via `renderFieldRow`, and the inspector re-renders with the rest\n // of the editor anyway, so a stable pane identity would buy nothing here.\n // 0.0.42 (round 3): whether a deployment route addresses this collection — gates the\n // header's composed-URL row (which carries the live-page affordance, EC-315 hybrid\n // split). A cheap synchronous accessor, resolved on every render (NOT frozen in a\n // `useMemo` with a static dep — the same first-paint-empty-routes trap the SlugField\n // fix removed: routes arrive after the workspace/config loads).\n const routableCollection = resolveDeploymentRoutes().some(\n (route) => route.document?.collection === collection.id,\n )\n // The composed URL moved OUT of this pane and up to the header (round 3): a lone URL\n // row on an otherwise-empty pane looked odd. So the Details pane exists only for slots\n // and/or sidebar fields — never merely because the collection is routable (that would\n // resurrect the empty-pane problem). A routable page keeps its pane via its slug\n // sidebar field; a routable collection with neither has no pane (URL is in the header).\n const detailsPane: InspectorPane | null =\n hasAliases(collection) || visibleSidebarFields.length > 0\n ? {\n id: 'details',\n label: translate('cms.editor.detailsPane'),\n icon: <Tag className=\"size-3.5\" />,\n render: () => (\n <DetailsPane\n collection={collection}\n doc={draft}\n siblings={source.documents()}\n readOnly={viewReadOnly}\n fields={visibleSidebarFields}\n renderField={renderFieldRow}\n onAliasChange={(alias) => documentDraft.setAlias(alias)}\n />\n ),\n }\n : null\n // Versions is capability-gated (AD-19): a non-versioned rail (users) never mounts\n // the pane, so no version read fires on its records.\n const trailingPanes = [\n ...(detailsPane ? [detailsPane] : []),\n ...(canVersions ? [versionsPane] : []),\n // EC-618: the project's contributed panes (an addon's per-document panel).\n ...(contributedPanes ?? []),\n issuesPane,\n ]\n\n // EC-268 / 0.0.39 — the publish controller: the publish indicator state and the\n // \"Publish & close\" navigation. Handlers are named to match the header split button.\n const { publishState, handlePublish, handlePublishAndClose } = usePublishController({\n source,\n docRef: ref,\n projectId,\n flushDraft: documentDraft.flush,\n })\n\n // EC-442 (amended): Duplicate in the header `…` menu — gated on the explicit\n // `duplicate` capability (CMS collections only, owner call 2026-07-17) + a\n // detail surface to land on, and never a singleton (its shape IS \"exactly one\n // document\"; a copy would be EC-274 drift by construction, mirroring the\n // hidden Delete).\n const canDuplicate =\n !singleton && source.capabilities.duplicate && source.detailPath !== undefined\n async function handleDuplicate() {\n // EC-595 A2: the FORCED FLUSH first — the uncommitted fields commit and land — then\n // copy the committed draft (what the editor sees). The duplicate is a fresh DRAFT,\n // never auto-published (live-is-published-only), created insert-if-absent with a\n // factory id (`duplicateFromSource`).\n await documentDraft.flush()\n const newRef = duplicateFromSource(source, source.get(ref) ?? draft)\n if (!newRef) return\n toast.success(translate('cms.editor.duplicateCreated'))\n const splat = source.detailPath?.(newRef.id)\n if (splat === undefined) return\n void navigate({ to: STUDIO_PROJECT_ROUTE, params: { projectId, _splat: splat } })\n }\n\n function handleConfirmedAction() {\n if (confirmAction === 'unpublish') {\n setConfirmAction(null)\n void source.publishing?.unpublish(ref)\n return\n }\n if (confirmAction === 'delete') {\n setConfirmAction(null)\n source.remove(ref)\n // Return to the rail's list (rail-owned `listPath`), or the project index if\n // the rail has no list surface (AD-19 — never a hard-coded CMS route).\n void navigate({\n to: STUDIO_PROJECT_ROUTE,\n params: { projectId, _splat: source.listPath ?? studioPath.index() },\n })\n }\n }\n\n // While the published snapshot is pending, don't derive the title from the\n // draft (it must not read as the published title) — fall back to the id.\n const title = publishedPending ? '' : primaryTitle(viewDoc, collection, locale, source.localeConfig)\n // EC-242: the untranslated-title chip applies only to a field-backed title; a\n // function title pattern has no single source field to mark as a fallback.\n const titleFallback =\n publishedPending || typeof collection.titleField === 'function'\n ? null\n : displayedFieldFallback(\n collection,\n viewDoc,\n titleFieldOf(collection)?.name ?? 'title',\n locale,\n source.localeConfig,\n )\n\n // EC-214: the document is the active record — contribute the collection (a\n // link back to its list) and the document title to the global header\n // breadcrumb, replacing the editor's own back-link + collection/id line. A\n // singleton has no list, so it contributes a single, non-linked crumb. The\n // title tracks the live draft so a rename updates the crumb immediately.\n const breadcrumbItems = useMemo<BreadcrumbItem[]>(() => {\n const collectionLabel = localizedLabel(collection.form?.label, collection.id)\n // A singleton (no list) or a rail with no list surface contributes a single,\n // non-linked crumb; otherwise the collection crumb links back to its list via\n // the rail-owned `listPath` (never a hard-coded CMS route — AD-19).\n if (singleton || source.listPath === undefined) return [{ label: collectionLabel }]\n const docTitle = primaryTitle(draft, collection, locale, source.localeConfig) || doc.id\n return [\n {\n label: collectionLabel,\n to: STUDIO_PROJECT_ROUTE,\n params: { projectId, _splat: source.listPath },\n },\n { label: docTitle },\n ]\n }, [singleton, collection, draft, locale, source.localeConfig, source.listPath, doc.id, projectId])\n useSetBreadcrumb(breadcrumbItems)\n\n // EC-205/EC-216 — the header composed-URL row's live-link descriptor. Derives\n // strictly from PUBLISHED data (the pinned snapshot + published ancestors), never\n // the draft, so an unpublished slug/parent edit can't leak into the live URL; the\n // draft-derived path itself (rendered by `DocumentUrlPath`) still updates as you\n // type — only the OPEN-live action is published-gated. `undefined` when the\n // collection is non-routable.\n const { headerLive } = useLiveUrl({ source, collection, doc, locale, published, routableCollection })\n\n // EC-240: hide the tab bar when there is nothing to navigate — a single content\n // tab with no References/Compare (the users rail). When framework tabs ARE\n // present we KEEP the content tab(s) so there is always a way back to the form;\n // only a genuinely single-tab surface drops them. And drop the whole lens row\n // when it would be empty (no tabs to show, no locale/perspective controls), so a\n // bare rail (users) shows no orphaned row.\n const hasFrameworkTabs = showReferences || compare !== null\n const showContentTabs = tabs.length > 1 || hasFrameworkTabs\n const showLensRow = showContentTabs || canLocales || canPublish\n\n // 0.0.39 split Publish button — the shared gate (disabled + title), computed once\n // (pure `publishGate`) so the primary \"Publish\" and the \"Publish & close\" item can\n // never diverge.\n const { disabled: publishDisabled, title: publishTitle } = publishGate({\n hasErrors,\n viewReadOnly,\n publishState,\n errorCount,\n })\n const publishButtonLabel =\n publishState === 'pending' ? (\n <>\n <Loader2 className=\"animate-spin\" /> {translate('cms.editor.publishing')}\n </>\n ) : publishState === 'success' ? (\n <>\n <CircleCheck /> {translate('cms.editor.publishedState')}\n </>\n ) : (\n <>\n <Eye /> {translate('cms.editor.publish')}\n </>\n )\n // Offer \"Publish & close\" only when there IS a list to return to — the same gate\n // the removed EC-316 \"Save & close\" used (never a singleton or a list-less rail).\n const canPublishClose = !singleton && source.listPath !== undefined\n\n return (\n <DocumentEditorProvider\n value={{\n projectId,\n collection,\n docRef: ref,\n draft,\n dirty,\n hasErrors,\n issues,\n viewReadOnly,\n save,\n replaceDraft,\n compare,\n compareActive: activeTab === COMPARE_TAB,\n startCompare,\n setCompareBase,\n setCompareTarget,\n exitCompare,\n }}\n >\n {/* EC-443: publish the in-flight jump-to-field request to every nested\n array/object control (auto-expansion + exact-target ring). */}\n <FieldFocusRequestContext.Provider value={focusRequest}>\n <div className={cn('flex h-full min-h-0 flex-col', viewReadOnly && 'bg-info/[0.04]')}>\n {/* Header — the back-link + collection/id line moved into the global\n breadcrumb (EC-214); this keeps only the record title + actions. */}\n <div className=\"shrink-0 border-b border-border px-4 py-3 sm:px-6\">\n <Row gap=\"3\" align=\"start\">\n {/* Title + the composed-URL row beneath it (round 3): the URL is a\n first-class document property, so it sits under the (dominant) title in\n secondary/muted type. Routable collections only — a non-routable record\n (asset, singleton, users) shows the title alone, with no gap. The left\n block is `min-w-0` so a long title/URL truncates instead of shoving the\n header actions around. */}\n <Stack gap=\"1\" className=\"min-w-0\">\n <Row gap=\"2\" align=\"center\" className=\"min-w-0\">\n <Heading level={1} size=\"h2\" className=\"truncate\">\n {singleton ? localizedLabel(collection.form?.label, collection.id) : title || doc.id}\n </Heading>\n {singleton ? null : <FallbackChip fallback={titleFallback} testId=\"doc-title-fallback\" />}\n </Row>\n {routableCollection ? (\n <DocumentUrlPath\n projectId={projectId}\n collection={collection}\n doc={draft}\n siblings={source.documents()}\n routes={resolveDeploymentRoutes()}\n localeConfig={source.localeConfig}\n locale={locale}\n live={headerLive}\n />\n ) : null}\n </Stack>\n <Spacer />\n {/* Save status — an autosave rail reports Saving…/Saved; an explicit rail\n (users) reports Unsaved changes until the Save button commits. EC-422:\n a failed save ALSO surfaces the specific failure message — verbatim\n from `lastError.message` (producers own its localization, the\n EC-397/412/416 pattern; no re-mapping here) — as quiet destructive\n text under the generic status, for every rail using this editor.\n Truncated with the full text on `title`, the same idiom as the title\n block, so a long raw adapter message never blows up the header row.\n No message ⇒ today's generic text alone. */}\n <Stack gap=\"none\" align=\"end\" className=\"min-w-0\">\n <Text size=\"xs\" tone=\"muted\" className=\"whitespace-nowrap\" data-testid=\"autosave-status\">\n {/* EC-595 A2: a document commits on quiescence (blur / Enter / an idle\n pause), so an uncommitted edit is \"unsaved\" until then — never \"saving\". */}\n {source.lastError\n ? translate('cms.editor.saveFailed')\n : dirty\n ? translate('cms.editor.unsavedChanges')\n : translate('cms.editor.saved')}\n </Text>\n {source.lastError?.message ? (\n <Text\n size=\"xs\"\n className=\"max-w-64 truncate text-destructive\"\n title={source.lastError.message}\n data-testid=\"save-error-message\"\n >\n {source.lastError.message}\n </Text>\n ) : null}\n </Stack>\n {canPublish ? <DocStateBadge published={published} /> : null}\n {/* EC-216 / EC-205: the standalone \"View live\" button is retired (round 3).\n Opening the live page now hangs off the composed-URL row's LEAF segment\n under the title — same published-gating, one fewer header button. */}\n {/* 0.0.39: the Publish button is a SPLIT button — primary Publish (stay) +\n a \"Publish & close\" dropdown item (publish, then return to the list). The\n retired EC-316 \"Save & close\" is gone: autosave already persists edits, so\n a bare \"Save\" was meaningless. Both actions share identical gating (schema\n errors / view-read-only / in-flight); the close item is offered only when\n there IS a list to return to (never a singleton or list-less rail). */}\n {canPublish ? (\n <Row gap=\"px\" align=\"center\">\n <Button\n size=\"sm\"\n onClick={handlePublish}\n disabled={publishDisabled}\n title={publishTitle}\n className={canPublishClose ? 'rounded-r-none' : undefined}\n data-testid=\"doc-publish\"\n >\n {publishButtonLabel}\n </Button>\n {canPublishClose ? (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n size=\"sm\"\n disabled={publishDisabled}\n aria-label={translate('cms.editor.publishActions')}\n data-testid=\"doc-publish-actions\"\n className=\"rounded-l-none border-l border-primary-foreground/25 px-1.5\"\n >\n <ChevronDown className=\"size-3.5\" />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n <DropdownMenuItem onClick={handlePublishAndClose} data-testid=\"doc-publish-and-close\">\n <Save /> {translate('cms.editor.publishAndClose')}\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n ) : null}\n </Row>\n ) : null}\n {/* EC-240: an explicit-save rail commits the draft on demand (no publish\n step). Disabled until there are unsaved edits; the guard covers leaving. */}\n {explicitSave ? (\n <Button size=\"sm\" onClick={save} disabled={!dirty} data-testid=\"doc-save\">\n <Check /> {translate('common.save')}\n </Button>\n ) : null}\n {/* EC-332: AI \"Translate document\" — fills empty locale values on the draft.\n The gate renders nothing unless the studio is ai-configured AND the\n collection is localized with a target locale (so it is absent for\n single-locale collections, assets, and unconfigured studios). */}\n {!viewReadOnly ? (\n <TranslateDocumentAction\n projectId={projectId}\n collection={collection}\n docRef={ref}\n document={draft}\n revision={documentDraft.revision}\n localeConfig={source.localeConfig}\n localesEnabled={canLocales}\n flushDraft={documentDraft.flush}\n />\n ) : null}\n {/* EC-217: a singleton is never deleted; with nothing else to show\n (an unpublished singleton) the actions menu is omitted entirely. */}\n {published || !singleton ? (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant=\"outline\" size=\"icon-sm\" aria-label={translate('cms.editor.moreActions')}>\n <MoreHorizontal />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n {/* EC-442: Duplicate — copy this draft into a fresh draft document\n and open it. Additive (never destructive), so no confirmation;\n gated on the explicit duplicate capability + detail surface,\n never a singleton. */}\n {canDuplicate ? (\n <DropdownMenuItem data-testid=\"doc-duplicate\" onClick={() => void handleDuplicate()}>\n <Copy /> {translate('common.duplicate')}\n </DropdownMenuItem>\n ) : null}\n {/* EC-316: \"Discard changes\" — reverts the draft to exactly the\n published content (the same restore machinery the Compare\n view's \"Restore version\" uses, EC-298). Shown only when a\n published version exists to revert to; enabled once the\n draft actually differs from it — decided by the same\n semantic comparator the Versions pane uses, so the two\n never contradict each other. */}\n {discardStatus !== 'hidden' ? (\n <DropdownMenuItem\n data-testid=\"doc-discard-draft\"\n disabled={discardStatus !== 'ready'}\n title={discardDisabledReason}\n onClick={() => setDiscardConfirm(true)}\n >\n <RotateCcw /> {translate('cms.editor.discardDraft')}\n </DropdownMenuItem>\n ) : null}\n {published ? (\n <DropdownMenuItem onClick={() => setConfirmAction('unpublish')}>\n <EyeOff /> {translate('cms.editor.unpublish')}\n </DropdownMenuItem>\n ) : null}\n {singleton ? null : (\n <DropdownMenuItem\n data-testid=\"doc-delete\"\n className=\"text-destructive\"\n onClick={() => setConfirmAction('delete')}\n >\n <Trash2 /> {translate('common.delete')}\n </DropdownMenuItem>\n )}\n </DropdownMenuContent>\n </DropdownMenu>\n ) : null}\n </Row>\n\n {/* EC-246a consistency: this lens row mirrors the list header — the tabs\n (EC-073) lead on the left (like the list's view tabs), and the lens\n CONTROLS sit on the right: the ambient locale switcher (EC-176) then the\n Draft/Published view perspective (EC-226) — exactly where the list keeps\n locale + Display, so the locale no longer jumps sides between views. */}\n {showLensRow ? (\n <Row gap=\"3\" className=\"mt-3\" wrap>\n <Row gap=\"1\" align=\"center\">\n {/* Schema content tabs (EC-073), then a divider, then the framework\n tabs (EC-269 References; EC-298 the transient Compare chip). While\n comparing, no content tab is highlighted — the Compare chip is the\n active view, and clicking a content tab closes the comparison. A\n single-tab surface with no framework tabs hides these entirely. */}\n {showContentTabs ? tabs.map((tab) => renderContentTab(tab)) : null}\n {showReferences ? (\n <>\n <div className=\"mx-1 h-4 w-px bg-border\" aria-hidden />\n {renderContentTab(REFERENCES_TAB)}\n </>\n ) : null}\n {compare ? (\n <span\n className={cn(\n 'inline-flex items-center gap-1 rounded-md px-2.5 py-1 text-xs font-medium transition-colors',\n activeTab === COMPARE_TAB\n ? 'bg-accent text-accent-foreground'\n : 'text-muted-foreground hover:bg-muted',\n )}\n >\n <button\n type=\"button\"\n onClick={() => setActiveTab(COMPARE_TAB)}\n aria-pressed={activeTab === COMPARE_TAB}\n className=\"inline-flex items-center gap-1\"\n >\n <GitCompareArrows className=\"size-3\" aria-hidden /> {translate('cms.version.compare')}\n </button>\n <button\n type=\"button\"\n onClick={exitCompare}\n aria-label={translate('cms.version.closeCompare')}\n className=\"ml-0.5 rounded p-0.5 hover:bg-background/40\"\n >\n <X className=\"size-3\" />\n </button>\n </span>\n ) : null}\n </Row>\n <Spacer />\n {canLocales ? <LocaleSwitcher /> : null}\n {canPublish ? (\n <Row gap=\"px\" className=\"rounded-md bg-muted/60 p-0.5\">\n <PerspectiveButton\n label={translate('cms.editor.draftState')}\n active={variantOf(perspective) === DRAFT_VARIANT}\n onClick={() => setPerspective(DRAFT_PERSPECTIVE)}\n />\n <PerspectiveButton\n label={translate('cms.editor.publishedState')}\n active={perspective === 'published'}\n accent=\"info\"\n disabled={!published}\n title={published ? undefined : translate('cms.editor.publishToViewPublished')}\n onClick={() => setPerspective('published')}\n />\n </Row>\n ) : null}\n </Row>\n ) : null}\n </div>\n\n {/* EC-214: an unmistakable banner whenever the read-only Published snapshot\n is in view — disabled controls + a footer notice alone read as too\n subtle. Paired with the tinted surface and the accented toggle. */}\n {viewReadOnly ? (\n <Row\n gap=\"2\"\n className=\"shrink-0 border-b border-info/30 bg-info/10 px-4 py-1.5 text-info sm:px-6\"\n data-testid=\"published-view-banner\"\n >\n <Lock className=\"size-3.5 shrink-0\" aria-hidden />\n <Text size=\"xs\" className=\"text-info\">\n {translate('cms.editor.publishedReadOnlyBanner')}\n </Text>\n <Spacer />\n <button\n type=\"button\"\n onClick={() => setPerspective(DRAFT_PERSPECTIVE)}\n className=\"text-xs font-medium underline-offset-2 hover:underline\"\n >\n {translate('cms.editor.switchToDraft')}\n </button>\n </Row>\n ) : null}\n\n {/* Body — a blocks field takes over the body with the page-builder canvas\n (which carries its own inspector sidebar, EC-188/EC-224); otherwise the\n field form sits beside the shared inspector sidebar (Versions). In\n Published view the snapshot must load before rendering — the draft is\n never shown as published (EC-226). */}\n {publishedPending ? (\n <div className=\"grid min-h-0 flex-1 place-items-center p-8\">\n <Text size=\"sm\" tone=\"muted\">\n {publishedSnapshot.status === 'loading'\n ? translate('cms.editor.loadingPublishedVersion')\n : translate('cms.editor.noPublishedVersion')}\n </Text>\n </div>\n ) : activeTab === COMPARE_TAB && compare ? (\n // EC-298: the version compare view takes over the main area, with the\n // shared inspector (Versions pane) staying on as the navigator — an\n // in-app surface, not a modal, so arbitrary versions can be browsed.\n <div className=\"flex min-h-0 flex-1 overflow-hidden\">\n <div className=\"min-h-0 flex-1 overflow-auto\">\n <VersionCompare />\n </div>\n <InspectorSidebar\n panes={trailingPanes}\n activeId={inspectorPaneId}\n onActiveChange={setInspectorPaneId}\n className=\"w-[320px] shrink-0 border-l border-border\"\n />\n </div>\n ) : canvasField ? (\n <div className=\"min-h-0 flex-1 overflow-hidden\">\n <CompositionFieldEditor\n key={`${canvasField.name}:${documentDraft.canvasNonce}:${perspectiveKey(perspective)}`}\n field={canvasField}\n value={getValue(canvasField)}\n revision={documentDraft.revision}\n change={documentDraft.canvasChange}\n onChange={(lift) => documentDraft.setCanvasValue(canvasField, lift)}\n commits={canvasCommits}\n conflicts={conflictNotices(canvasField)}\n readOnly={viewReadOnly || source.isFieldReadOnly(canvasField)}\n trailingPanes={trailingPanes}\n />\n </div>\n ) : activeTab === REFERENCES_TAB ? (\n // EC-269: mounted only while this tab is active → reference data loads on\n // demand and is torn down on leave (no fetching during normal editing).\n <div className=\"flex min-h-0 flex-1 overflow-hidden\">\n <div className=\"min-h-0 flex-1 overflow-auto p-4 sm:p-6\">\n <div className=\"mx-auto w-full max-w-2xl\">\n <ReferencesPanel\n projectId={projectId}\n source={{ type: 'document', id: documentKey(ref) }}\n target={{ type: 'document', id: documentKey(ref) }}\n />\n </div>\n </div>\n </div>\n ) : (\n <div className=\"flex min-h-0 flex-1 overflow-hidden\">\n <div className=\"min-h-0 flex-1 overflow-auto p-4 sm:p-6\">\n <div className=\"mx-auto w-full max-w-2xl\">\n <Stack gap=\"6\">\n {groups.map((group) => {\n // EC-273/EC-240/EC-306: drop a fieldset whose every field is hidden —\n // by its own rule, by its (static or predicate) group section, or for\n // this principal — so the form never shows an empty section header.\n const visible = group.fields.filter(isFieldShown)\n if (visible.length === 0) return null\n const section = group.section\n // EC-241: a section `title` is a LocalizedString ({ en, de } or a plain\n // string) — resolve it against the active UI locale before rendering.\n const sectionTitle =\n section?.title !== undefined ? localizedLabel(section.title, group.name) : undefined\n return (\n <CollapsibleSection\n key={group.name}\n collapsible={section?.collapsible}\n defaultOpen={section?.defaultOpen}\n title={\n <Text\n size=\"sm\"\n weight=\"semibold\"\n className={sectionTitle || group.name === DEFAULT_FIELD_GROUP ? undefined : 'capitalize'}\n >\n {sectionTitle ??\n (group.name === DEFAULT_FIELD_GROUP\n ? translate('cms.editor.defaultGroup')\n : group.name)}\n </Text>\n }\n >\n {/* EC-306: fractional field widths — a 12-col grid honoring each\n field's `form.width`, collapsing to one column on narrow widths. */}\n <div className=\"grid grid-cols-1 gap-4 p-4 md:grid-cols-12\">\n {visible.map((field) => (\n <div\n key={field.name}\n className={cn('col-span-1', fieldWidthColSpan(field.form?.width))}\n >\n {renderFieldRow(field)}\n </div>\n ))}\n </div>\n </CollapsibleSection>\n )\n })}\n {/* EC-396: the form-column appendix seam — a direct-value node mounted\n below the fieldset cards, inside this same `max-w-2xl` column so it\n shares the cards' width and gap-6 rhythm (the account surface's\n CredentialPanel rides here). Renders only in the form view. */}\n {formAppendix}\n </Stack>\n </div>\n </div>\n {/* EC-430/AD-D: this sidebar no longer swaps for embed props — \"Edit\n settings\" on a rich-text embed opens the EmbedPropsStage (rendered by\n the embed node view itself), the ONE form reachable identically from\n the form view and the canvas tab. */}\n <InspectorSidebar\n panes={trailingPanes}\n activeId={inspectorPaneId}\n onActiveChange={setInspectorPaneId}\n className=\"w-[320px] shrink-0 border-l border-border\"\n />\n </div>\n )}\n\n {/* EC-283: the always-on validation footer is retired. Validation now lives\n in the document-scoped `Issues` inspector pane (full list + jump-to-field,\n count badge on its tab), field issues stay inline, and the Publish button\n gates on errors. Read-only is announced by the top banner (EC-214). */}\n\n {/* EC-240: on an explicit-save rail (no autosave), guard navigation away from\n unsaved edits — offer Save / Discard / Cancel. Autosave rails flush on\n unmount instead, so the guard is inert there. */}\n {explicitSave ? (\n <UnsavedChangesGuard\n when={dirty}\n onSave={() => {\n save()\n return true\n }}\n description={translate('cms.editor.unsavedChangesGuard')}\n />\n ) : null}\n\n {/* Reference-aware unpublish/delete confirmation (EC-173). */}\n {confirmAction !== null ? (\n <ReferenceConfirmDialog\n projectId={projectId}\n action={confirmAction}\n targets={confirmTargets}\n open\n onOpenChange={(open) => {\n if (!open) setConfirmAction(null)\n }}\n onConfirm={handleConfirmedAction}\n />\n ) : null}\n\n {/* EC-316: \"Discard changes\" confirmation — reverting the draft to the\n published content is destructive to the working edits (though itself\n undoable: the restore op snapshots the pre-discard draft first, EC-298),\n so it confirms before dispatching. */}\n <Dialog open={discardConfirm} onOpenChange={(open) => { if (!open) setDiscardConfirm(false) }}>\n <DialogContent>\n <DialogHeader>\n <DialogTitle>{translate('cms.editor.discardDraftTitle')}</DialogTitle>\n <DialogDescription>\n {translate('cms.editor.discardDraftDescription')}\n </DialogDescription>\n </DialogHeader>\n <DialogFooter className=\"mt-4\">\n <Button variant=\"ghost\" size=\"sm\" onClick={() => setDiscardConfirm(false)} disabled={discardBusy}>\n {translate('common.cancel')}\n </Button>\n <Button\n variant=\"destructive\"\n size=\"sm\"\n data-testid=\"discard-draft-confirm\"\n disabled={discardBusy}\n onClick={() => void handleDiscardDraft()}\n >\n {discardBusy ? (\n <>\n <Loader2 className=\"animate-spin\" /> {translate('cms.editor.discardingDraft')}\n </>\n ) : (\n <>\n <RotateCcw /> {translate('cms.editor.discardDraftConfirm')}\n </>\n )}\n </Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n\n </div>\n </FieldFocusRequestContext.Provider>\n </DocumentEditorProvider>\n )\n}\n\n/**\n * A segmented-control button for the Draft/Published view toggle (EC-226). The\n * `accent` variant (EC-214) gives the active Published segment a distinct info\n * treatment, so the read-only mode is obvious at the control itself.\n */\nfunction PerspectiveButton({\n label,\n active,\n accent,\n disabled,\n title,\n onClick,\n}: {\n label: string\n active: boolean\n accent?: 'info'\n disabled?: boolean\n title?: string\n onClick: () => void\n}) {\n return (\n <button\n type=\"button\"\n aria-pressed={active}\n disabled={disabled}\n title={title}\n onClick={onClick}\n className={cn(\n 'rounded px-2.5 py-1 text-xs font-medium transition-colors disabled:opacity-40',\n active\n ? accent === 'info'\n ? 'bg-info text-info-foreground shadow-sm'\n : 'bg-background text-foreground shadow-sm'\n : 'text-muted-foreground hover:text-foreground',\n )}\n >\n {label}\n </button>\n )\n}\n\ninterface FieldGroup {\n name: string\n fields: FieldDef[]\n /** EC-306: the presentational section descriptor, if one was declared for this group. */\n section?: FieldGroupSection\n}\n\n/** The implicit fieldset that holds fields with no declared `form.group` (localized via `cms.editor.defaultGroup`). */\nconst DEFAULT_FIELD_GROUP = 'fields'\n\nfunction groupFields(fields: FieldDef[], collection: CollectionDef): FieldGroup[] {\n const order = groupOrder(collection.form)\n const byGroup = new Map<string, FieldDef[]>()\n for (const field of fields) {\n const group = field.form?.group ?? DEFAULT_FIELD_GROUP\n if (!byGroup.has(group)) byGroup.set(group, [])\n byGroup.get(group)!.push(field)\n }\n const names = [...byGroup.keys()].sort((a, b) => {\n const ia = order.indexOf(a)\n const ib = order.indexOf(b)\n return (ia < 0 ? 99 : ia) - (ib < 0 ? 99 : ib)\n })\n return names.map((name) => ({\n name,\n section: groupSectionOf(collection.form, name),\n fields: byGroup.get(name)!.sort((a, b) => (a.form?.order ?? 99) - (b.form?.order ?? 99)),\n }))\n}\n\n// EC-306: translate a field's grid span (FIELD_WIDTH_SPANS, owned + tested in\n// core) into a literal Tailwind col-span class. Literal strings so Tailwind's\n// scanner generates them; the span math itself is single-sourced in core.\nconst COL_SPAN_CLASS: Record<number, string> = {\n 3: 'md:col-span-3',\n 4: 'md:col-span-4',\n 6: 'md:col-span-6',\n 8: 'md:col-span-8',\n 9: 'md:col-span-9',\n 12: 'md:col-span-12',\n}\n\nfunction fieldWidthColSpan(width: FieldWidth | undefined): string {\n return COL_SPAN_CLASS[FIELD_WIDTH_SPANS[width ?? '100%']] ?? 'md:col-span-12'\n}\n\nfunction primaryTitle(\n doc: CmsDocument,\n collection: CollectionDef,\n locale: Locale,\n config: LocaleConfig,\n): string {\n // EC-242: the header title is the document identity (resolveDocumentTitle) — a\n // string `titleField` or a function pattern — over the fallback-resolved values,\n // the same resolver that drives relation labels and the list title column.\n return resolveDocumentTitle(collection, valuesInLocale(collection, doc, locale, config), '')\n}\n"]}
|
|
@@ -42,8 +42,16 @@ export interface UncommittedPosition {
|
|
|
42
42
|
readonly base: number | undefined;
|
|
43
43
|
}
|
|
44
44
|
export interface DraftCommitter {
|
|
45
|
-
/**
|
|
46
|
-
|
|
45
|
+
/**
|
|
46
|
+
* A field's control wrote `path`. `authored` — the revision the edit was authored
|
|
47
|
+
* against when the writer knows it better than the draft does (EC-647: a canvas
|
|
48
|
+
* inspector control's burst is authored on the CANVAS's value, whose revision can trail
|
|
49
|
+
* the draft's); absent → {@link DraftCommitterOptions.baseOf}. A re-edit of an
|
|
50
|
+
* uncommitted position keeps the base of its first edit either way.
|
|
51
|
+
*/
|
|
52
|
+
edited(field: string, path: ValuePath, authored?: {
|
|
53
|
+
readonly base: number | undefined;
|
|
54
|
+
}): void;
|
|
47
55
|
/** Focus entered a field's control. */
|
|
48
56
|
focused(field: string): void;
|
|
49
57
|
/** Focus left a field's control (commits it and what rode along). */
|
|
@@ -61,7 +69,12 @@ export interface DraftCommitter {
|
|
|
61
69
|
}
|
|
62
70
|
export interface DraftCommitterOptions {
|
|
63
71
|
policyOf: (field: string) => CommitPolicy;
|
|
64
|
-
/**
|
|
72
|
+
/**
|
|
73
|
+
* The revision the editor's draft is at now — the revision of the view a field's edit
|
|
74
|
+
* is authored on (captured as a position's base on its first edit). EC-647: the
|
|
75
|
+
* draft's, never the session's tracked one (which may hold a change the draft has not
|
|
76
|
+
* rebased onto yet).
|
|
77
|
+
*/
|
|
65
78
|
baseOf?: () => number | undefined;
|
|
66
79
|
commit: (positions: readonly UncommittedPosition[]) => void;
|
|
67
80
|
scheduler?: Scheduler;
|
|
@@ -29,10 +29,11 @@ export function createDraftCommitter(options) {
|
|
|
29
29
|
options.commit(batch.map(([, position]) => position));
|
|
30
30
|
};
|
|
31
31
|
return {
|
|
32
|
-
edited(field, path) {
|
|
32
|
+
edited(field, path, authored) {
|
|
33
33
|
const key = formatValuePath(path);
|
|
34
34
|
const previous = pending.get(key);
|
|
35
|
-
|
|
35
|
+
const base = previous ? previous.base : authored ? authored.base : options.baseOf?.();
|
|
36
|
+
pending.set(key, { field, path, base });
|
|
36
37
|
const policy = options.policyOf(field);
|
|
37
38
|
if (policy === 'change' || focus === undefined) {
|
|
38
39
|
commitField(field);
|