import type { PublishedVersionInfo } from './form-renderer.js'; import type { ScheduledPublicationState } from './scheduled-publication-state.js'; /** * Shape of a content-locale option as consumed by the Copy-to-Locale * modal. Matches the host adapter's `ContentLocaleOption`; declared * locally so this package does not take a dependency on host code. */ export interface DocumentActionsLocaleOption { code: string; label: string; } export declare function DocumentActions({ disabled, publishedVersion, onUnpublish, onDelete, onDuplicate, sourceTitle, onCopyToLocale, sourceLocale, contentLocales, hasUnsavedChanges, onUnsavedChanges, onDeleteLocale, defaultLocale, availableLocales, scheduledPublicationState, onSchedulePublication, onConfirmScheduledPublication, onCancelScheduledPublication, }: { disabled?: boolean; publishedVersion?: PublishedVersionInfo | null; onUnpublish?: () => Promise; onDelete?: () => Promise; /** * Called when the editor confirms the duplicate modal. The parent runs * the server fn, surfaces a toast, and navigates to the new document. */ onDuplicate?: () => Promise; /** * The current (saved) value of the source document's `useAsTitle` * field, used to render the suffix preview inside the duplicate modal. * Sourced from the form's `initialData`, not live form state, so the * preview reflects what will actually be duplicated. */ sourceTitle?: string | null; /** * Called when the editor confirms the Copy-to-Locale modal. The * parent runs the server fn, surfaces a toast, and navigates to the * target locale view. Menu item is hidden when omitted, or when fewer * than two content locales are configured. */ onCopyToLocale?: (args: { targetLocale: string; overwrite: boolean; }) => Promise; /** * The locale the form is currently displaying. Used as the read-only * "From" label in the Copy-to-Locale modal and excluded from the * target Select. */ sourceLocale?: string; /** * All configured content locales (code + display label). The * Copy-to-Locale Select lists every locale except `sourceLocale`. */ contentLocales?: ReadonlyArray; /** * Whether the form currently has unsaved changes. Duplicate and * Copy-to-Locale operate on the *saved* version, so when this is true * the action is blocked and `onUnsavedChanges` fires instead of opening * the action's modal. Delete is intentionally not gated. */ hasUnsavedChanges?: boolean; /** * Called when a save-gated action (duplicate / copy-to-locale / * delete-locale) is triggered while `hasUnsavedChanges` is true. The parent * surfaces a "save first" prompt. */ onUnsavedChanges?: () => void; /** * Called when the editor confirms the Delete-Locale modal. The parent runs * the server fn, surfaces a toast, and navigates to a surviving locale. * Menu item is hidden when omitted, or when the document has no non-default * locale to delete. */ onDeleteLocale?: (args: { targetLocale: string; }) => Promise; /** * The default content locale (the document's anchor). Excluded from the * Delete-Locale list — it can never be removed. */ defaultLocale?: string; /** * The locales the document currently has content in (the derived * `_availableVersionLocales` ledger). The Delete-Locale list is this set * minus the default locale and the `'all'` sentinel. */ availableLocales?: string[]; /** * Derived presentation state for the document's pending publication * schedule. Decides which of the scheduling menu items appear; omit it (or * pass a `none` state with no capabilities) and the group is hidden * entirely — which is what an ineligible document, a single-status * workflow, or an actor missing either ability all reduce to. */ scheduledPublicationState?: ScheduledPublicationState; /** Opens the schedule / reschedule modal. Save-gated by the caller. */ onSchedulePublication?: () => void; /** Re-confirms a suspended schedule against the current version. Save-gated by the caller. */ onConfirmScheduledPublication?: () => void | Promise; /** Withdraws the pending schedule. Deliberately not save-gated. */ onCancelScheduledPublication?: () => void | Promise; }): import("react").JSX.Element;