@limetech/lime-elements 37.65.4 → 37.65.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,7 +8,9 @@ const createMarkdownSerializerFunction = (config) => {
8
8
  .join('') +
9
9
  '>';
10
10
  const tagClose = `</${config.tagName}>`;
11
- state.write(`${tagOpen}${tagClose}`);
11
+ state.write(tagOpen);
12
+ state.renderContent(node);
13
+ state.write(tagClose);
12
14
  };
13
15
  };
14
16
  const buildMarkdownSerializer = (plugins) => {
@@ -1 +1 @@
1
- {"version":3,"file":"markdown-converter.js","sourceRoot":"","sources":["../../../../src/components/text-editor/utils/markdown-converter.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,kBAAkB,EAElB,yBAAyB,GAC5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAQhE,MAAM,gCAAgC,GAAG,CACrC,MAA+B,EACL,EAAE;EAC5B,OAAO,CAAC,KAA8B,EAAE,IAAqB,EAAE,EAAE;IAC7D,MAAM,OAAO,GACT,IAAI,MAAM,CAAC,OAAO,EAAE;MACpB,MAAM,CAAC,UAAU;SACZ,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,KAAK,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;SAC/C,IAAI,CAAC,EAAE,CAAC;MACb,GAAG,CAAC;IACR,MAAM,QAAQ,GAAG,KAAK,MAAM,CAAC,OAAO,GAAG,CAAC;IAExC,KAAK,CAAC,KAAK,CAAC,GAAG,OAAO,GAAG,QAAQ,EAAE,CAAC,CAAC;EACzC,CAAC,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,uBAAuB,GAAG,CAC5B,OAAkC,EAChB,EAAE;EACpB,MAAM,WAAW,GAAG,EAAE,CAAC;EAEvB,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;IACvB,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,gCAAgC,CAAC,MAAM,CAAC,CAAC;EAC3E,CAAC,CAAC,CAAC;EAEH,MAAM,KAAK,mCACJ,yBAAyB,CAAC,KAAK,GAC/B,WAAW,CACjB,CAAC;EAEF,MAAM,KAAK,mCACJ,yBAAyB,CAAC,KAAK,KAClC,aAAa,EAAE;MACX,IAAI,EAAE,IAAI;MACV,KAAK,EAAE,IAAI;MACX,OAAO,EAAE,IAAI;MACb,wBAAwB,EAAE,IAAI;KACjC,GACJ,CAAC;EAEF,OAAO,IAAI,kBAAkB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAChD,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,OAAO,iBAAiB;EAI1B,YAAY,OAAkC;IAIvC,gBAAW,GAAG,CAAC,IAAY,EAAmB,EAAE;MACnD,MAAM,SAAS,GAA8B,IAAI,CAAC,WAAW,CAAC,GAAG,CAC7D,CAAC,UAAmC,EAAE,EAAE,CAAC,CAAC;QACtC,OAAO,EAAE,UAAU,CAAC,OAAO;QAC3B,UAAU,EAAE,UAAU,CAAC,UAAU;OACpC,CAAC,CACL,CAAC;MAEF,OAAO,cAAc,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC;IAC1D,CAAC,CAAC;IAEK,cAAS,GAAG,CAAC,IAAgB,EAAU,EAAE;MAC5C,IAAI,IAAI,CAAC,GAAG,CAAC,WAAW,KAAK,EAAE,EAAE;QAC7B,OAAO,EAAE,CAAC;OACb;WAAM;QACH,OAAO,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;OAC5D;IACL,CAAC,CAAC;IApBE,IAAI,CAAC,kBAAkB,GAAG,uBAAuB,CAAC,OAAO,CAAC,CAAC;IAC3D,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC;EAC/B,CAAC;CAmBJ","sourcesContent":["import { ContentTypeConverter } from './content-type-converter';\nimport { EditorView } from 'prosemirror-view';\nimport { Node as ProseMirrorNode } from 'prosemirror-model';\nimport {\n MarkdownSerializer,\n MarkdownSerializerState,\n defaultMarkdownSerializer,\n} from 'prosemirror-markdown';\nimport { markdownToHTML } from '../../markdown/markdown-parser';\nimport { CustomElementDefinition } from '../../../global/shared-types/custom-element.types';\n\ntype MarkdownSerializerFunction = (\n state: MarkdownSerializerState,\n node: ProseMirrorNode,\n) => void;\n\nconst createMarkdownSerializerFunction = (\n config: CustomElementDefinition,\n): MarkdownSerializerFunction => {\n return (state: MarkdownSerializerState, node: ProseMirrorNode) => {\n const tagOpen =\n `<${config.tagName}` +\n config.attributes\n .map((attr) => ` ${attr}=\"${node.attrs[attr]}\"`)\n .join('') +\n '>';\n const tagClose = `</${config.tagName}>`;\n\n state.write(`${tagOpen}${tagClose}`);\n };\n};\n\nconst buildMarkdownSerializer = (\n plugins: CustomElementDefinition[],\n): MarkdownSerializer => {\n const customNodes = {};\n\n plugins.forEach((plugin) => {\n customNodes[plugin.tagName] = createMarkdownSerializerFunction(plugin);\n });\n\n const nodes = {\n ...defaultMarkdownSerializer.nodes,\n ...customNodes,\n };\n\n const marks = {\n ...defaultMarkdownSerializer.marks,\n strikethrough: {\n open: '~~',\n close: '~~',\n mixable: true,\n expelEnclosingWhitespace: true,\n },\n };\n\n return new MarkdownSerializer(nodes, marks);\n};\n\n/**\n * @private\n */\nexport class MarkdownConverter implements ContentTypeConverter {\n private markdownSerializer: MarkdownSerializer;\n private customNodes: CustomElementDefinition[];\n\n constructor(plugins: CustomElementDefinition[]) {\n this.markdownSerializer = buildMarkdownSerializer(plugins);\n this.customNodes = plugins;\n }\n public parseAsHTML = (text: string): Promise<string> => {\n const whitelist: CustomElementDefinition[] = this.customNodes.map(\n (nodeConfig: CustomElementDefinition) => ({\n tagName: nodeConfig.tagName,\n attributes: nodeConfig.attributes,\n }),\n );\n\n return markdownToHTML(text, { whitelist: whitelist });\n };\n\n public serialize = (view: EditorView): string => {\n if (view.dom.textContent === '') {\n return '';\n } else {\n return this.markdownSerializer.serialize(view.state.doc);\n }\n };\n}\n"]}
1
+ {"version":3,"file":"markdown-converter.js","sourceRoot":"","sources":["../../../../src/components/text-editor/utils/markdown-converter.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,kBAAkB,EAElB,yBAAyB,GAC5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAQhE,MAAM,gCAAgC,GAAG,CACrC,MAA+B,EACL,EAAE;EAC5B,OAAO,CAAC,KAA8B,EAAE,IAAqB,EAAE,EAAE;IAC7D,MAAM,OAAO,GACT,IAAI,MAAM,CAAC,OAAO,EAAE;MACpB,MAAM,CAAC,UAAU;SACZ,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,KAAK,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;SAC/C,IAAI,CAAC,EAAE,CAAC;MACb,GAAG,CAAC;IACR,MAAM,QAAQ,GAAG,KAAK,MAAM,CAAC,OAAO,GAAG,CAAC;IAExC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACrB,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAC1B,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;EAC1B,CAAC,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,uBAAuB,GAAG,CAC5B,OAAkC,EAChB,EAAE;EACpB,MAAM,WAAW,GAAG,EAAE,CAAC;EAEvB,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;IACvB,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,gCAAgC,CAAC,MAAM,CAAC,CAAC;EAC3E,CAAC,CAAC,CAAC;EAEH,MAAM,KAAK,mCACJ,yBAAyB,CAAC,KAAK,GAC/B,WAAW,CACjB,CAAC;EAEF,MAAM,KAAK,mCACJ,yBAAyB,CAAC,KAAK,KAClC,aAAa,EAAE;MACX,IAAI,EAAE,IAAI;MACV,KAAK,EAAE,IAAI;MACX,OAAO,EAAE,IAAI;MACb,wBAAwB,EAAE,IAAI;KACjC,GACJ,CAAC;EAEF,OAAO,IAAI,kBAAkB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAChD,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,OAAO,iBAAiB;EAI1B,YAAY,OAAkC;IAIvC,gBAAW,GAAG,CAAC,IAAY,EAAmB,EAAE;MACnD,MAAM,SAAS,GAA8B,IAAI,CAAC,WAAW,CAAC,GAAG,CAC7D,CAAC,UAAmC,EAAE,EAAE,CAAC,CAAC;QACtC,OAAO,EAAE,UAAU,CAAC,OAAO;QAC3B,UAAU,EAAE,UAAU,CAAC,UAAU;OACpC,CAAC,CACL,CAAC;MAEF,OAAO,cAAc,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC;IAC1D,CAAC,CAAC;IAEK,cAAS,GAAG,CAAC,IAAgB,EAAU,EAAE;MAC5C,IAAI,IAAI,CAAC,GAAG,CAAC,WAAW,KAAK,EAAE,EAAE;QAC7B,OAAO,EAAE,CAAC;OACb;WAAM;QACH,OAAO,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;OAC5D;IACL,CAAC,CAAC;IApBE,IAAI,CAAC,kBAAkB,GAAG,uBAAuB,CAAC,OAAO,CAAC,CAAC;IAC3D,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC;EAC/B,CAAC;CAmBJ","sourcesContent":["import { ContentTypeConverter } from './content-type-converter';\nimport { EditorView } from 'prosemirror-view';\nimport { Node as ProseMirrorNode } from 'prosemirror-model';\nimport {\n MarkdownSerializer,\n MarkdownSerializerState,\n defaultMarkdownSerializer,\n} from 'prosemirror-markdown';\nimport { markdownToHTML } from '../../markdown/markdown-parser';\nimport { CustomElementDefinition } from '../../../global/shared-types/custom-element.types';\n\ntype MarkdownSerializerFunction = (\n state: MarkdownSerializerState,\n node: ProseMirrorNode,\n) => void;\n\nconst createMarkdownSerializerFunction = (\n config: CustomElementDefinition,\n): MarkdownSerializerFunction => {\n return (state: MarkdownSerializerState, node: ProseMirrorNode) => {\n const tagOpen =\n `<${config.tagName}` +\n config.attributes\n .map((attr) => ` ${attr}=\"${node.attrs[attr]}\"`)\n .join('') +\n '>';\n const tagClose = `</${config.tagName}>`;\n\n state.write(tagOpen);\n state.renderContent(node);\n state.write(tagClose);\n };\n};\n\nconst buildMarkdownSerializer = (\n plugins: CustomElementDefinition[],\n): MarkdownSerializer => {\n const customNodes = {};\n\n plugins.forEach((plugin) => {\n customNodes[plugin.tagName] = createMarkdownSerializerFunction(plugin);\n });\n\n const nodes = {\n ...defaultMarkdownSerializer.nodes,\n ...customNodes,\n };\n\n const marks = {\n ...defaultMarkdownSerializer.marks,\n strikethrough: {\n open: '~~',\n close: '~~',\n mixable: true,\n expelEnclosingWhitespace: true,\n },\n };\n\n return new MarkdownSerializer(nodes, marks);\n};\n\n/**\n * @private\n */\nexport class MarkdownConverter implements ContentTypeConverter {\n private markdownSerializer: MarkdownSerializer;\n private customNodes: CustomElementDefinition[];\n\n constructor(plugins: CustomElementDefinition[]) {\n this.markdownSerializer = buildMarkdownSerializer(plugins);\n this.customNodes = plugins;\n }\n public parseAsHTML = (text: string): Promise<string> => {\n const whitelist: CustomElementDefinition[] = this.customNodes.map(\n (nodeConfig: CustomElementDefinition) => ({\n tagName: nodeConfig.tagName,\n attributes: nodeConfig.attributes,\n }),\n );\n\n return markdownToHTML(text, { whitelist: whitelist });\n };\n\n public serialize = (view: EditorView): string => {\n if (view.dom.textContent === '') {\n return '';\n } else {\n return this.markdownSerializer.serialize(view.state.doc);\n }\n };\n}\n"]}
@@ -1,28 +1,24 @@
1
1
  export const createNodeSpec = (config) => {
2
- const attributes = config.attributes.reduce((acc, attr) => {
3
- acc[attr] = {};
4
- return acc;
5
- }, {});
2
+ const attributeSpecs = {};
3
+ config.attributes.forEach((attribute) => (attributeSpecs[attribute] = {}));
4
+ const tag = `${config.tagName}[${config.attributes.map((attr) => attr).join('][')}]`;
6
5
  return {
7
6
  group: 'inline',
7
+ content: '(text* | inline*)',
8
8
  inline: true,
9
- atom: false,
9
+ atom: true,
10
10
  selectable: true,
11
- attrs: attributes,
12
- toDOM: (node) => [
13
- config.tagName,
14
- config.attributes.reduce((acc, attr) => {
15
- acc[attr] = node.attrs[attr];
16
- return acc;
17
- }, {}),
18
- ],
11
+ attrs: attributeSpecs,
12
+ toDOM: (node) => [config.tagName, node.attrs],
19
13
  parseDOM: [
20
14
  {
21
- tag: `${config.tagName}[${config.attributes.map((attr) => attr).join('][')}]`,
22
- getAttrs: (dom) => config.attributes.reduce((acc, attr) => {
23
- acc[attr] = dom.getAttribute(attr);
24
- return acc;
25
- }, {}),
15
+ tag: tag,
16
+ getAttrs: (dom) => {
17
+ const attributes = {};
18
+ config.attributes.forEach((attribute) => (attributes[attribute] =
19
+ dom.getAttribute(attribute)));
20
+ return attributes;
21
+ },
26
22
  },
27
23
  ],
28
24
  };
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-factory.js","sourceRoot":"","sources":["../../../../src/components/text-editor/utils/plugin-factory.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,cAAc,GAAoB,CAC3C,MAA+B,EACvB,EAAE;EACV,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;IACtD,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;IAEf,OAAO,GAAG,CAAC;EACf,CAAC,EAAE,EAAE,CAAC,CAAC;EAEP,OAAO;IACH,KAAK,EAAE,QAAQ;IACf,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,KAAK;IACX,UAAU,EAAE,IAAI;IAChB,KAAK,EAAE,UAAU;IAEjB,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC;MACb,MAAM,CAAC,OAAO;MACd,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;QACnC,GAAG,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAE7B,OAAO,GAAG,CAAC;MACf,CAAC,EAAE,EAAE,CAAC;KACT;IACD,QAAQ,EAAE;MACN;QACI,GAAG,EAAE,GAAG,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;QAC7E,QAAQ,EAAE,CAAC,GAAY,EAAE,EAAE,CACvB,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;UACnC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;UAEnC,OAAO,GAAG,CAAC;QACf,CAAC,EAAE,EAAE,CAAC;OACb;KACJ;GACJ,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { NodeSpec } from 'prosemirror-model';\nimport { CustomElementDefinition } from '../../../global/shared-types/custom-element.types';\n\ntype NodeSpecFactory = (config: CustomElementDefinition) => NodeSpec;\n\nexport const createNodeSpec: NodeSpecFactory = (\n config: CustomElementDefinition,\n): NodeSpec => {\n const attributes = config.attributes.reduce((acc, attr) => {\n acc[attr] = {};\n\n return acc;\n }, {});\n\n return {\n group: 'inline',\n inline: true,\n atom: false,\n selectable: true,\n attrs: attributes,\n\n toDOM: (node) => [\n config.tagName,\n config.attributes.reduce((acc, attr) => {\n acc[attr] = node.attrs[attr];\n\n return acc;\n }, {}),\n ],\n parseDOM: [\n {\n tag: `${config.tagName}[${config.attributes.map((attr) => attr).join('][')}]`,\n getAttrs: (dom: Element) =>\n config.attributes.reduce((acc, attr) => {\n acc[attr] = dom.getAttribute(attr);\n\n return acc;\n }, {}),\n },\n ],\n };\n};\n"]}
1
+ {"version":3,"file":"plugin-factory.js","sourceRoot":"","sources":["../../../../src/components/text-editor/utils/plugin-factory.ts"],"names":[],"mappings":"AAgBA,MAAM,CAAC,MAAM,cAAc,GAAoB,CAC3C,MAA+B,EACvB,EAAE;EACV,MAAM,cAAc,GAAmB,EAAE,CAAC;EAC1C,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,cAAc,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;EAE3E,MAAM,GAAG,GAAG,GAAG,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;EAErF,OAAO;IACH,KAAK,EAAE,QAAQ;IACf,OAAO,EAAE,mBAAmB;IAC5B,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,IAAI;IACV,UAAU,EAAE,IAAI;IAChB,KAAK,EAAE,cAAc;IAErB,KAAK,EAAE,CAAC,IAAI,EAAiB,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC;IAC5D,QAAQ,EAAE;MACN;QACI,GAAG,EAAE,GAAG;QACR,QAAQ,EAAE,CAAC,GAAY,EAAS,EAAE;UAC9B,MAAM,UAAU,GAAiB,EAAE,CAAC;UACpC,MAAM,CAAC,UAAU,CAAC,OAAO,CACrB,CAAC,SAAiB,EAAE,EAAE,CAClB,CAAC,UAAU,CAAC,SAAS,CAAC;YAClB,GAAG,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CACvC,CAAC;UAEF,OAAO,UAAmB,CAAC;QAC/B,CAAC;OACJ;KACJ;GACJ,CAAC;AACN,CAAC,CAAC","sourcesContent":["import {\n AttributeSpec,\n Attrs,\n DOMOutputSpec,\n NodeSpec,\n} from 'prosemirror-model';\nimport { CustomElementDefinition } from '../../../global/shared-types/custom-element.types';\n\ntype NodeSpecFactory = (config: CustomElementDefinition) => NodeSpec;\ntype AttributeSpecs = {\n [name: string]: AttributeSpec;\n};\ntype MutableAttrs = {\n [attr: string]: any;\n};\n\nexport const createNodeSpec: NodeSpecFactory = (\n config: CustomElementDefinition,\n): NodeSpec => {\n const attributeSpecs: AttributeSpecs = {};\n config.attributes.forEach((attribute) => (attributeSpecs[attribute] = {}));\n\n const tag = `${config.tagName}[${config.attributes.map((attr) => attr).join('][')}]`;\n\n return {\n group: 'inline',\n content: '(text* | inline*)',\n inline: true,\n atom: true,\n selectable: true,\n attrs: attributeSpecs,\n\n toDOM: (node): DOMOutputSpec => [config.tagName, node.attrs],\n parseDOM: [\n {\n tag: tag,\n getAttrs: (dom: Element): Attrs => {\n const attributes: MutableAttrs = {};\n config.attributes.forEach(\n (attribute: string) =>\n (attributes[attribute] =\n dom.getAttribute(attribute)),\n );\n\n return attributes as Attrs;\n },\n },\n ],\n };\n};\n"]}
@@ -25670,7 +25670,9 @@ const createMarkdownSerializerFunction = (config) => {
25670
25670
  .join('') +
25671
25671
  '>';
25672
25672
  const tagClose = `</${config.tagName}>`;
25673
- state.write(`${tagOpen}${tagClose}`);
25673
+ state.write(tagOpen);
25674
+ state.renderContent(node);
25675
+ state.write(tagClose);
25674
25676
  };
25675
25677
  };
25676
25678
  const buildMarkdownSerializer = (plugins) => {
@@ -26099,30 +26101,26 @@ const createActionBarInteractionPlugin = (menuCommandFactory) => {
26099
26101
  };
26100
26102
 
26101
26103
  const createNodeSpec = (config) => {
26102
- const attributes = config.attributes.reduce((acc, attr) => {
26103
- acc[attr] = {};
26104
- return acc;
26105
- }, {});
26104
+ const attributeSpecs = {};
26105
+ config.attributes.forEach((attribute) => (attributeSpecs[attribute] = {}));
26106
+ const tag = `${config.tagName}[${config.attributes.map((attr) => attr).join('][')}]`;
26106
26107
  return {
26107
26108
  group: 'inline',
26109
+ content: '(text* | inline*)',
26108
26110
  inline: true,
26109
- atom: false,
26111
+ atom: true,
26110
26112
  selectable: true,
26111
- attrs: attributes,
26112
- toDOM: (node) => [
26113
- config.tagName,
26114
- config.attributes.reduce((acc, attr) => {
26115
- acc[attr] = node.attrs[attr];
26116
- return acc;
26117
- }, {}),
26118
- ],
26113
+ attrs: attributeSpecs,
26114
+ toDOM: (node) => [config.tagName, node.attrs],
26119
26115
  parseDOM: [
26120
26116
  {
26121
- tag: `${config.tagName}[${config.attributes.map((attr) => attr).join('][')}]`,
26122
- getAttrs: (dom) => config.attributes.reduce((acc, attr) => {
26123
- acc[attr] = dom.getAttribute(attr);
26124
- return acc;
26125
- }, {}),
26117
+ tag: tag,
26118
+ getAttrs: (dom) => {
26119
+ const attributes = {};
26120
+ config.attributes.forEach((attribute) => (attributes[attribute] =
26121
+ dom.getAttribute(attribute)));
26122
+ return attributes;
26123
+ },
26126
26124
  },
26127
26125
  ],
26128
26126
  };