UNPKG

@atlaskit/adf-schema

Version:

Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs

34 lines (32 loc) 776 B
import { listItem as listItemFactory } from '../../next-schema/generated/nodeTypes'; import { uuid } from '../../utils'; /** * @name list_item */ export var listItem = listItemFactory({ parseDOM: [{ tag: 'li' }], toDOM: function toDOM() { return ['li', 0]; } }); /** * @name list_item_with_local_id */ export var listItemWithLocalId = listItemFactory({ parseDOM: [{ tag: 'li', getAttrs: function getAttrs() { return { localId: uuid.generate() }; } }], toDOM: function toDOM(node) { var _node$attrs; return ['li', { 'data-local-id': (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId) || undefined }, 0]; } });