@atlaskit/editor-plugin-batch-attribute-updates
Version:
Provider a runtime tool to merge an array of SetAttrsStep and/or AttrsSteps into an unique BatchAttrsStep
16 lines (15 loc) • 738 B
TypeScript
import type { BatchAttrsStep } from '@atlaskit/adf-schema/steps/batch-attrs-step';
import type { SetAttrsStep } from '@atlaskit/adf-schema/steps/set-attrs';
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
import type { AttrStep } from '@atlaskit/editor-prosemirror/transform';
import type { Step } from '@atlaskit/editor-prosemirror/transform-override';
export type BatchStepsAction = (props: {
doc: PMNode;
steps: Array<AttrStep | SetAttrsStep> | Array<Step>;
}) => BatchAttrsStep;
export type BatchAttributeUpdatesPlugin = NextEditorPlugin<'batchAttributeUpdates', {
actions: {
batchSteps: BatchStepsAction;
};
}>;