UNPKG

@atlaskit/editor-plugin-batch-attribute-updates

Version:

Provider a runtime tool to merge an array of SetAttrsStep and/or AttrsSteps into an unique BatchAttrsStep

14 lines (13 loc) 590 B
import type { BatchAttrsStep, SetAttrsStep } from '@atlaskit/adf-schema/steps'; import type { NextEditorPlugin } from '@atlaskit/editor-common/types'; import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model'; import type { AttrStep, Step } from '@atlaskit/editor-prosemirror/transform'; export type BatchStepsAction = (props: { doc: PMNode; steps: Array<AttrStep | SetAttrsStep> | Array<Step>; }) => BatchAttrsStep; export type BatchAttributeUpdatesPlugin = NextEditorPlugin<'batchAttributeUpdates', { actions: { batchSteps: BatchStepsAction; }; }>;