UNPKG

@atlaskit/adf-schema

Version:

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

37 lines (35 loc) 898 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ruleWithLocalId = exports.rule = void 0; var _nodeTypes = require("../../next-schema/generated/nodeTypes"); var _uuid = require("../../utils/uuid"); /** * @name rule_node */ var hrDOM = ['hr']; var rule = exports.rule = (0, _nodeTypes.rule)({ parseDOM: [{ tag: 'hr' }], toDOM: function toDOM() { return hrDOM; } }); var ruleWithLocalId = exports.ruleWithLocalId = (0, _nodeTypes.rule)({ parseDOM: [{ tag: 'hr', getAttrs: function getAttrs() { return { localId: _uuid.uuid.generate() }; } }], toDOM: function toDOM(node) { var _node$attrs; return ['hr', { '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 }]; } });