UNPKG

@atlaskit/editor-plugin-show-diff

Version:

ShowDiff plugin for @atlaskit/editor-core

16 lines (14 loc) • 646 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getWidgetElement = void 0; // prosemirror-view does not type `Decoration.type`; a widget's `type.toDOM` is the node passed to // `Decoration.widget()` (an element or a factory — the `WidgetConstructor` union). // The element a widget renders, or undefined if it renders via a factory. var getWidgetElement = exports.getWidgetElement = function getWidgetElement(decoration) { var _type; var _ref = (_type = decoration.type) !== null && _type !== void 0 ? _type : {}, toDOM = _ref.toDOM; return toDOM instanceof HTMLElement ? toDOM : undefined; };