@modusoperandi/licit 1.0.11 → 1.1.0

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.
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Portions Copyright (c) 2020 Modus Operandi Inc
4
+ Portions Copyright (c) 2018-2019 Chan Zuckerberg Initiative
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
@@ -43,6 +43,26 @@ var ParagraphNodeSpec = {
43
43
  },
44
44
  innerLink: {
45
45
  "default": null
46
+ },
47
+ // [KNITE-1465] 24-12-2024
48
+ // added attributes for indent, align and linespacing overrides.
49
+ overriddenAlign: {
50
+ "default": null
51
+ },
52
+ overriddenLineSpacing: {
53
+ "default": null
54
+ },
55
+ overriddenIndent: {
56
+ "default": null
57
+ },
58
+ overriddenAlignValue: {
59
+ "default": null
60
+ },
61
+ overriddenLineSpacingValue: {
62
+ "default": null
63
+ },
64
+ overriddenIndentValue: {
65
+ "default": null
46
66
  }
47
67
  },
48
68
  content: 'inline*',
@@ -69,6 +89,12 @@ function getAttrs(dom) {
69
89
  indent = indent || MIN_INDENT_LEVEL;
70
90
  var lineSpacing = lineHeight ? toCSSLineSpacing(lineHeight) : null;
71
91
  var id = dom.getAttribute('id') || '';
92
+ var overriddenAlign = dom.getAttribute('overriddenAlign') || '';
93
+ var overriddenAlignValue = dom.getAttribute('overriddenAlignValue') || '';
94
+ var overriddenLineSpacing = dom.getAttribute('overriddenLineSpacing') || '';
95
+ var overriddenLineSpacingValue = dom.getAttribute('overriddenLineSpacingValue') || '';
96
+ var overriddenIndent = dom.getAttribute('overriddenIndent') || '';
97
+ var overriddenIndentValue = dom.getAttribute('overriddenIndentValue') || '';
72
98
  var innerLink = dom.getAttribute('innerLink') || '';
73
99
  return {
74
100
  align: align,
@@ -77,6 +103,12 @@ function getAttrs(dom) {
77
103
  paddingTop: paddingTop,
78
104
  paddingBottom: paddingBottom,
79
105
  id: id,
106
+ overriddenAlign: overriddenAlign,
107
+ overriddenAlignValue: overriddenAlignValue,
108
+ overriddenLineSpacing: overriddenLineSpacing,
109
+ overriddenLineSpacingValue: overriddenLineSpacingValue,
110
+ overriddenIndent: overriddenIndent,
111
+ overriddenIndentValue: overriddenIndentValue,
80
112
  innerLink: innerLink
81
113
  };
82
114
  }
@@ -108,6 +140,12 @@ function toDOM(node) {
108
140
  var _node$attrs = node.attrs,
109
141
  indent = _node$attrs.indent,
110
142
  id = _node$attrs.id,
143
+ overriddenAlign = _node$attrs.overriddenAlign,
144
+ overriddenAlignValue = _node$attrs.overriddenAlignValue,
145
+ overriddenLineSpacing = _node$attrs.overriddenLineSpacing,
146
+ overriddenLineSpacingValue = _node$attrs.overriddenLineSpacingValue,
147
+ overriddenIndent = _node$attrs.overriddenIndent,
148
+ overriddenIndentValue = _node$attrs.overriddenIndentValue,
111
149
  innerLink = _node$attrs.innerLink;
112
150
  var attrs = {};
113
151
  var _getStyle = getStyle(node.attrs),
@@ -119,6 +157,12 @@ function toDOM(node) {
119
157
  if (id) {
120
158
  attrs.id = id;
121
159
  }
160
+ attrs.overriddenAlign = overriddenAlign;
161
+ attrs.overriddenLineSpacing = overriddenLineSpacing;
162
+ attrs.overriddenIndent = overriddenIndent;
163
+ attrs.overriddenAlignValue = overriddenAlignValue;
164
+ attrs.overriddenLineSpacingValue = overriddenLineSpacingValue;
165
+ attrs.overriddenIndentValue = overriddenIndentValue;
122
166
  if (innerLink) {
123
167
  attrs.innerLink = innerLink;
124
168
  }
@@ -51,6 +51,26 @@ const ParagraphNodeSpec: NodeSpec = {
51
51
  innerLink: {
52
52
  default: null,
53
53
  },
54
+ // [KNITE-1465] 24-12-2024
55
+ // added attributes for indent, align and linespacing overrides.
56
+ overriddenAlign: {
57
+ default: null,
58
+ },
59
+ overriddenLineSpacing: {
60
+ default: null,
61
+ },
62
+ overriddenIndent: {
63
+ default: null,
64
+ },
65
+ overriddenAlignValue: {
66
+ default: null,
67
+ },
68
+ overriddenLineSpacingValue: {
69
+ default: null,
70
+ },
71
+ overriddenIndentValue: {
72
+ default: null,
73
+ },
54
74
  },
55
75
  content: 'inline*',
56
76
  group: 'block',
@@ -86,6 +106,12 @@ function getAttrs(dom: HTMLElement): Object {
86
106
  const lineSpacing = lineHeight ? toCSSLineSpacing(lineHeight) : null;
87
107
 
88
108
  const id = dom.getAttribute('id') || '';
109
+ const overriddenAlign = dom.getAttribute('overriddenAlign') || '';
110
+ const overriddenAlignValue = dom.getAttribute('overriddenAlignValue') || '';
111
+ const overriddenLineSpacing = dom.getAttribute('overriddenLineSpacing') || '';
112
+ const overriddenLineSpacingValue = dom.getAttribute('overriddenLineSpacingValue') || '';
113
+ const overriddenIndent = dom.getAttribute('overriddenIndent') || '';
114
+ const overriddenIndentValue = dom.getAttribute('overriddenIndentValue') || '';
89
115
  const innerLink = dom.getAttribute('innerLink') || '';
90
116
  return {
91
117
  align,
@@ -94,6 +120,12 @@ function getAttrs(dom: HTMLElement): Object {
94
120
  paddingTop,
95
121
  paddingBottom,
96
122
  id,
123
+ overriddenAlign,
124
+ overriddenAlignValue,
125
+ overriddenLineSpacing,
126
+ overriddenLineSpacingValue,
127
+ overriddenIndent,
128
+ overriddenIndentValue,
97
129
  innerLink,
98
130
  };
99
131
  }
@@ -133,7 +165,7 @@ function getStyleEx(align, lineSpacing, paddingTop, paddingBottom) {
133
165
  }
134
166
 
135
167
  function toDOM(node: Node): Array<any> {
136
- const { indent, id, innerLink } = node.attrs;
168
+ const { indent, id, overriddenAlign,overriddenAlignValue, overriddenLineSpacing,overriddenLineSpacingValue, overriddenIndent,overriddenIndentValue, innerLink } = node.attrs;
137
169
  const attrs = {};
138
170
  const { style } = getStyle(node.attrs);
139
171
 
@@ -145,6 +177,13 @@ function toDOM(node: Node): Array<any> {
145
177
  if (id) {
146
178
  attrs.id = id;
147
179
  }
180
+ attrs.overriddenAlign = overriddenAlign;
181
+ attrs.overriddenLineSpacing = overriddenLineSpacing;
182
+ attrs.overriddenIndent = overriddenIndent;
183
+ attrs.overriddenAlignValue = overriddenAlignValue;
184
+ attrs.overriddenLineSpacingValue = overriddenLineSpacingValue;
185
+ attrs.overriddenIndentValue = overriddenIndentValue;
186
+
148
187
  if (innerLink) {
149
188
  attrs.innerLink = innerLink;
150
189
  }