@sanity/visual-editing
Version:
[](https://npm-stat.com/charts.html?package=@sanity/visual-editing) [](https://
91 lines • 8.4 kB
TypeScript
import { $ as OverlayPluginExclusiveDefinition, A as OverlayMsgDragToggleMinimap, B as OverlayMsgElementDeactivate, C as OverlayMsgActivate, D as OverlayMsgDragEndMinimapTransition, E as OverlayMsgDragEnd, F as OverlayMsgDragUpdateSkeleton, G as OverlayMsgElementUpdate, H as OverlayMsgElementMouseLeave, I as OverlayMsgElement, J as OverlayMsgSetCursor, K as OverlayMsgElementUpdateRect, L as OverlayMsgElementActivate, M as OverlayMsgDragUpdateCursorPosition, N as OverlayMsgDragUpdateGroupRect, O as OverlayMsgDragStart, P as OverlayMsgDragUpdateInsertPosition, Q as OverlayPluginDefinitionBase, R as OverlayMsgElementClick, S as OverlayMsg, T as OverlayMsgDeactivate, U as OverlayMsgElementRegister, V as OverlayMsgElementMouseEnter, W as OverlayMsgElementUnregister, X as OverlayPluginComponent, Y as OverlayOptions, Z as OverlayPluginDefinition, _ as OverlayComponentResolverContext, a as ElementChildTarget, at as VisualEditingOptions, b as OverlayElementParent, c as ElementState, d as HistoryRefresh, et as OverlayPluginHudDefinition, f as HistoryUpdate, g as OverlayComponentResolver, h as OverlayComponentProps, i as DragSkeleton, j as OverlayMsgDragToggleMinimapPrompt, k as OverlayMsgDragStartMinimapTransition, l as HistoryAdapter, m as OverlayComponent, n as DragEndEvent, nt as SanityNode, o as ElementFocusedState, p as Msg, q as OverlayMsgResetMouseState, r as DragInsertPosition, rt as SanityStegaNode, s as ElementNode, t as DisableVisualEditing, tt as OverlayRect, u as HistoryAdapterNavigate, v as OverlayController, w as OverlayMsgBlur, x as OverlayEventHandler, y as OverlayElementField, z as OverlayMsgElementContextMenu } from "./_chunks-dts/types.js";
import { a as OptimisticReducer$1, c as PathValue$1, i as OptimisticDocumentPatches$1, l as DatasetMutatorMachineInput$1, n as DocumentsMutate$1, o as OptimisticReducerAction$1, r as OptimisticDocument$1, s as Path$1, t as DocumentsGet$1 } from "./_chunks-dts/types2.js";
import { n as useDocuments$1, t as useOptimistic$1 } from "./_chunks-dts/useOptimistic.js";
import { CreateDataAttribute, CreateDataAttributeProps, WithRequired, createDataAttribute } from "@sanity/visual-editing-csm";
import { SanityDocument } from "@sanity/client";
import { DocumentSchema, SanityNode as SanityNode$1, SchemaArrayItem, SchemaArrayNode, SchemaBooleanNode, SchemaInlineNode, SchemaNode, SchemaNullNode, SchemaNumberNode, SchemaObjectField, SchemaObjectNode, SchemaStringNode, SchemaUnionNode, SchemaUnionNodeOptions, SchemaUnionOption, SchemaUnknownNode } from "@sanity/presentation-comlink";
import { NodePatchList } from "@sanity/mutate";
/**
* Creates a controller which dispatches overlay related events
*
* @param handler - Dispatched event handler
* @param overlayElement - Parent element containing rendered overlay elements
* @public
*/
declare function createOverlayController({
handler,
overlayElement,
inFrame,
inPopUp,
optimisticActorReady
}: OverlayOptions): OverlayController;
/**
* Enables Visual Editing overlay in a page with sourcemap encoding.
*
* This will overlay UI on hovered elements that deep-links to Sanity Studio.
* @public
*/
declare function enableVisualEditing(options?: VisualEditingOptions): DisableVisualEditing;
declare function useSharedState<T extends boolean | null | number | object | string | undefined | unknown = unknown>(key: string): T;
declare function getArrayItemKeyAndParentPath(pathOrNode: string | SanityNode$1): {
path: string;
key: string;
hasExplicitKey: boolean;
};
/**
* @public
* @deprecated Use `import {useDocuments} from '@sanity/visual-editing/react'` instead
*/
declare const useDocuments: typeof useDocuments$1;
/**
* @public
* @deprecated Use `import {useOptimistic} from '@sanity/visual-editing/react'` instead
*/
declare const useOptimistic: typeof useOptimistic$1;
/**
* @public
* @deprecated Use `import type {DatasetMutatorMachineInput} from '@sanity/visual-editing/optimistic'` instead
*/
type DatasetMutatorMachineInput = DatasetMutatorMachineInput$1;
/**
* @public
* @deprecated Use `import type {DocumentsGet} from '@sanity/visual-editing/optimistic'` instead
*/
type DocumentsGet = DocumentsGet$1;
/**
* @public
* @deprecated Use `import type {DocumentsMutate} from '@sanity/visual-editing/optimistic'` instead
*/
type DocumentsMutate = DocumentsMutate$1;
/**
* @public
* @deprecated Use `import type {OptimisticDocument} from '@sanity/visual-editing/optimistic'` instead
*/
type OptimisticDocument = OptimisticDocument$1;
/**
* @public
* @deprecated Use `import type {OptimisticDocumentPatches} from '@sanity/visual-editing/optimistic'` instead
*/
type OptimisticDocumentPatches = OptimisticDocumentPatches$1;
/**
* @public
* @deprecated Use `import type {OptimisticReducer} from '@sanity/visual-editing/optimistic'` instead
*/
type OptimisticReducer<T, U> = OptimisticReducer$1<T, U>;
/**
* @public
* @deprecated Use `import type {OptimisticReducerAction} from '@sanity/visual-editing/optimistic'` instead
*/
type OptimisticReducerAction<T> = OptimisticReducerAction$1<T>;
/**
* @public
* @deprecated Use `import type {Path} from '@sanity/visual-editing/optimistic'` instead
*/
type Path<T, K extends keyof T> = Path$1<T, K>;
/**
* @public
* @deprecated Use `import type {PathValue} from '@sanity/visual-editing/optimistic'` instead
*/
type PathValue<T, P extends string> = PathValue$1<T, P>;
export { type CreateDataAttribute, type CreateDataAttributeProps, DatasetMutatorMachineInput, type DatasetMutatorMachineInput$1 as DatasetMutatorMachineInputDeprecated, type DisableVisualEditing, type DocumentSchema, DocumentsGet, type DocumentsGet$1 as DocumentsGetDeprecated, DocumentsMutate, type DocumentsMutate$1 as DocumentsMutateDeprecated, type DragEndEvent, type DragInsertPosition, type DragSkeleton, type ElementChildTarget, type ElementFocusedState, type ElementNode, type ElementState, type HistoryAdapter, type HistoryAdapterNavigate, type HistoryRefresh, type HistoryUpdate, type Msg, OptimisticDocument, type OptimisticDocument$1 as OptimisticDocumentDeprecated, OptimisticDocumentPatches, type OptimisticDocumentPatches$1 as OptimisticDocumentPatchesDeprecated, OptimisticReducer, OptimisticReducerAction, type OptimisticReducerAction$1 as OptimisticReducerActionDeprecated, type OptimisticReducer$1 as OptimisticReducerDeprecated, type OverlayComponent, type OverlayComponentProps, type OverlayComponentResolver, type OverlayComponentResolverContext, type OverlayController, type OverlayElementField, type OverlayElementParent, type OverlayEventHandler, type OverlayMsg, type OverlayMsgActivate, type OverlayMsgBlur, type OverlayMsgDeactivate, type OverlayMsgDragEnd, type OverlayMsgDragEndMinimapTransition, type OverlayMsgDragStart, type OverlayMsgDragStartMinimapTransition, type OverlayMsgDragToggleMinimap, type OverlayMsgDragToggleMinimapPrompt, type OverlayMsgDragUpdateCursorPosition, type OverlayMsgDragUpdateGroupRect, type OverlayMsgDragUpdateInsertPosition, type OverlayMsgDragUpdateSkeleton, type OverlayMsgElement, type OverlayMsgElementActivate, type OverlayMsgElementClick, type OverlayMsgElementContextMenu, type OverlayMsgElementDeactivate, type OverlayMsgElementMouseEnter, type OverlayMsgElementMouseLeave, type OverlayMsgElementRegister, type OverlayMsgElementUnregister, type OverlayMsgElementUpdate, type OverlayMsgElementUpdateRect, type OverlayMsgResetMouseState, type OverlayMsgSetCursor, type OverlayOptions, type OverlayPluginComponent, type OverlayPluginDefinition, type OverlayPluginDefinitionBase, type OverlayPluginExclusiveDefinition, type OverlayPluginHudDefinition, type OverlayRect, Path, type Path$1 as PathDeprecated, PathValue, type PathValue$1 as PathValueDeprecated, type SanityNode, type SanityStegaNode, type SchemaArrayItem, type SchemaArrayNode, type SchemaBooleanNode, type SchemaInlineNode, type SchemaNode, type SchemaNullNode, type SchemaNumberNode, type SchemaObjectField, type SchemaObjectNode, type SchemaStringNode, type SchemaUnionNode, type SchemaUnionNodeOptions, type SchemaUnionOption, type SchemaUnknownNode, type VisualEditingOptions, type WithRequired, createDataAttribute, createOverlayController, enableVisualEditing, getArrayItemKeyAndParentPath, useDocuments, type useDocuments$1 as useDocumentsDeprecated, useOptimistic, type useOptimistic$1 as useOptimisticDeprecated, useSharedState };
//# sourceMappingURL=index.d.ts.map