@modusoperandi/licit 1.4.8 → 1.4.9

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.
@@ -72,6 +72,13 @@ var ParagraphNodeSpec = {
72
72
  },
73
73
  indentPosition: {
74
74
  "default": null
75
+ },
76
+ isDeco: {
77
+ "default": {
78
+ isTag: false,
79
+ isComment: false,
80
+ isSlice: false
81
+ }
75
82
  }
76
83
  },
77
84
  content: 'inline*',
@@ -110,6 +117,11 @@ function getAttrs(dom) {
110
117
  var objectId = dom.getAttribute('objectId') || '';
111
118
  var hangingIndent = dom.getAttribute('hangingIndent') || '';
112
119
  var indentPosition = dom.getAttribute('indentPosition') || '';
120
+ var isDeco = {
121
+ isTag: dom.getAttribute('isTag') === 'true',
122
+ isComment: dom.getAttribute('isComment') === 'true',
123
+ isSlice: dom.getAttribute('isSlice') === 'true'
124
+ };
113
125
  return {
114
126
  align: align,
115
127
  indent: indent,
@@ -127,7 +139,8 @@ function getAttrs(dom) {
127
139
  selectionId: selectionId,
128
140
  objectId: objectId,
129
141
  hangingIndent: hangingIndent,
130
- indentPosition: indentPosition
142
+ indentPosition: indentPosition,
143
+ isDeco: isDeco
131
144
  };
132
145
  }
133
146
  function getStyle(attrs) {
@@ -167,7 +180,8 @@ function toDOM(node) {
167
180
  overriddenIndentValue = _node$attrs.overriddenIndentValue,
168
181
  selectionId = _node$attrs.selectionId,
169
182
  hangingIndent = _node$attrs.hangingIndent,
170
- indentPosition = _node$attrs.indentPosition;
183
+ indentPosition = _node$attrs.indentPosition,
184
+ isDeco = _node$attrs.isDeco;
171
185
  var attrs = _objectSpread({}, node.attrs);
172
186
  var _getStyle = getStyle(node.attrs),
173
187
  style = _getStyle.style;
@@ -195,6 +209,11 @@ function toDOM(node) {
195
209
  if (selectionId) {
196
210
  attrs.selectionId = selectionId;
197
211
  }
212
+ if (isDeco) {
213
+ if (isDeco.isTag !== undefined) attrs.isTag = String(isDeco.isTag);
214
+ if (isDeco.isComment !== undefined) attrs.isComment = String(isDeco.isComment);
215
+ if (isDeco.isSlice !== undefined) attrs.isSlice = String(isDeco.isSlice);
216
+ }
198
217
  return ['p', attrs, 0];
199
218
  }
200
219
  export var toParagraphDOM = toDOM;
@@ -74,6 +74,13 @@ const ParagraphNodeSpec: NodeSpec = {
74
74
  indentPosition: {
75
75
  default: null,
76
76
  },
77
+ isDeco: {
78
+ default: {
79
+ isTag: false,
80
+ isComment: false,
81
+ isSlice: false,
82
+ },
83
+ },
77
84
  },
78
85
  content: 'inline*',
79
86
  group: 'block',
@@ -116,6 +123,11 @@ function getAttrs(dom: HTMLElement): Object {
116
123
  const objectId = dom.getAttribute('objectId') || '';
117
124
  const hangingIndent = dom.getAttribute('hangingIndent') || '';
118
125
  const indentPosition = dom.getAttribute('indentPosition') || '';
126
+ const isDeco = {
127
+ isTag: dom.getAttribute('isTag') === 'true',
128
+ isComment: dom.getAttribute('isComment') === 'true',
129
+ isSlice: dom.getAttribute('isSlice') === 'true',
130
+ };
119
131
  return {
120
132
  align,
121
133
  indent,
@@ -133,7 +145,8 @@ function getAttrs(dom: HTMLElement): Object {
133
145
  selectionId,
134
146
  objectId,
135
147
  hangingIndent,
136
- indentPosition
148
+ indentPosition,
149
+ isDeco
137
150
  };
138
151
  }
139
152
 
@@ -183,7 +196,8 @@ function toDOM(node: Node): Array<any> {
183
196
  overriddenIndentValue,
184
197
  selectionId,
185
198
  hangingIndent,
186
- indentPosition
199
+ indentPosition,
200
+ isDeco
187
201
  } = node.attrs;
188
202
  const attrs = { ...node.attrs };
189
203
  const { style } = getStyle(node.attrs);
@@ -215,6 +229,12 @@ function toDOM(node: Node): Array<any> {
215
229
  attrs.selectionId = selectionId;
216
230
  }
217
231
 
232
+ if (isDeco) {
233
+ if (isDeco.isTag !== undefined) attrs.isTag = String(isDeco.isTag);
234
+ if (isDeco.isComment !== undefined) attrs.isComment = String(isDeco.isComment);
235
+ if (isDeco.isSlice !== undefined) attrs.isSlice = String(isDeco.isSlice);
236
+ }
237
+
218
238
  return ['p', attrs, 0];
219
239
  }
220
240