@pie-lib/mask-markup 1.13.34-next.0 → 2.0.0-beta.2

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +0 -8
  2. package/lib/choices/choice.js +6 -29
  3. package/lib/choices/choice.js.map +1 -1
  4. package/lib/choices/index.js +4 -32
  5. package/lib/choices/index.js.map +1 -1
  6. package/lib/componentize.js +0 -3
  7. package/lib/componentize.js.map +1 -1
  8. package/lib/components/blank.js +10 -50
  9. package/lib/components/blank.js.map +1 -1
  10. package/lib/components/correct-input.js +8 -24
  11. package/lib/components/correct-input.js.map +1 -1
  12. package/lib/components/dropdown.js +10 -36
  13. package/lib/components/dropdown.js.map +1 -1
  14. package/lib/components/input.js +9 -15
  15. package/lib/components/input.js.map +1 -1
  16. package/lib/constructed-response.js +7 -13
  17. package/lib/constructed-response.js.map +1 -1
  18. package/lib/drag-in-the-blank.js +17 -49
  19. package/lib/drag-in-the-blank.js.map +1 -1
  20. package/lib/index.js +0 -6
  21. package/lib/index.js.map +1 -1
  22. package/lib/inline-dropdown.js +3 -10
  23. package/lib/inline-dropdown.js.map +1 -1
  24. package/lib/mask.js +12 -64
  25. package/lib/mask.js.map +1 -1
  26. package/lib/new-serialization.js +267 -0
  27. package/lib/new-serialization.js.map +1 -0
  28. package/lib/parse-html.js +17 -0
  29. package/lib/parse-html.js.map +1 -0
  30. package/lib/serialization.js +33 -61
  31. package/lib/serialization.js.map +1 -1
  32. package/lib/test-serializer.js +164 -0
  33. package/lib/test-serializer.js.map +1 -0
  34. package/lib/with-mask.js +6 -30
  35. package/lib/with-mask.js.map +1 -1
  36. package/package.json +10 -9
  37. package/src/mask.jsx +9 -21
  38. package/src/new-serialization.jsx +291 -0
  39. package/src/parse-html.js +8 -0
  40. package/src/serialization.js +34 -22
  41. package/src/test-serializer.js +163 -0
  42. package/src/with-mask.jsx +1 -1
  43. package/LICENSE.md +0 -5
package/src/mask.jsx CHANGED
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import get from 'lodash/get';
3
+ import { Text } from 'slate';
4
4
  import { withStyles } from '@material-ui/core/styles';
5
5
  import { MARK_TAGS } from './serialization';
6
6
 
@@ -25,13 +25,9 @@ const addText = (parentNode, text) => {
25
25
  };
26
26
 
27
27
  const getMark = (n) => {
28
- const mark = n.leaves.find((leave) => get(leave, 'marks', []).length);
28
+ const markTags = Object.values(MARK_TAGS);
29
29
 
30
- if (mark) {
31
- return mark.marks[0];
32
- }
33
-
34
- return null;
30
+ return markTags.includes(n.type);
35
31
  };
36
32
 
37
33
  export const renderChildren = (layout, value, onChange, rootRenderChildren, parentNode) => {
@@ -41,16 +37,12 @@ export const renderChildren = (layout, value, onChange, rootRenderChildren, pare
41
37
 
42
38
  const children = [];
43
39
 
44
- (layout.nodes || []).forEach((n, index) => {
45
- const key = n.type ? `${n.type}-${index}` : `${index}`;
40
+ (layout.children || []).forEach((n, index) => {
41
+ const key = `${n.type}-${index}`;
46
42
 
47
43
  if (n.isMath) {
48
44
  children.push(
49
- <span
50
- dangerouslySetInnerHTML={{
51
- __html: `<math displaystyle="true">${n.nodes[0].innerHTML}</math>`,
52
- }}
53
- />,
45
+ <span dangerouslySetInnerHTML={{ __html: `<math displaystyle="true">${n.children[0].innerHTML}</math>` }} />,
54
46
  );
55
47
  return children;
56
48
  }
@@ -63,12 +55,8 @@ export const renderChildren = (layout, value, onChange, rootRenderChildren, pare
63
55
  }
64
56
  }
65
57
 
66
- if (n.object === 'text') {
67
- const content = n.leaves.reduce((acc, l) => {
68
- const t = l.text;
69
- const extraText = addText(parentNode, t);
70
- return extraText ? acc + extraText : acc;
71
- }, '');
58
+ if (Text.isText(n)) {
59
+ const content = n.text;
72
60
  const mark = getMark(n);
73
61
 
74
62
  if (mark) {
@@ -91,7 +79,7 @@ export const renderChildren = (layout, value, onChange, rootRenderChildren, pare
91
79
  children.push(<Paragraph key={key}>{subNodes}</Paragraph>);
92
80
  } else {
93
81
  const Tag = n.type;
94
- if (n.nodes && n.nodes.length > 0) {
82
+ if (Tag !== 'source' && n.children && n.children.length > 0) {
95
83
  children.push(
96
84
  <Tag key={key} {...n.data.attributes}>
97
85
  {subNodes}
@@ -0,0 +1,291 @@
1
+ import TestSerializer from './test-serializer';
2
+ import React from 'react';
3
+ import debug from 'debug';
4
+ import { object as toStyleObject } from 'to-style';
5
+
6
+ import { serialization as imgSerialization } from './plugins/image';
7
+ import { serialization as mathSerialization } from './plugins/math';
8
+ import { serialization as mediaSerialization } from './plugins/media';
9
+ import { serialization as listSerialization } from './plugins/list';
10
+ import { serialization as tableSerialization } from './plugins/table';
11
+ import { serialization as responseAreaSerialization } from './plugins/respArea';
12
+ import { Mark, Value } from 'slate';
13
+ import { jsx } from 'slate-hyperscript';
14
+
15
+ const log = debug('@pie-lib:editable-html:serialization');
16
+
17
+ /**
18
+ * Tags to blocks.
19
+ *
20
+ * @type {Object}
21
+ */
22
+
23
+ export const BLOCK_TAGS = {
24
+ div: 'div',
25
+ span: 'span',
26
+ p: 'paragraph',
27
+ blockquote: 'quote',
28
+ pre: 'code',
29
+ h1: 'heading-one',
30
+ h2: 'heading-two',
31
+ h3: 'heading-three',
32
+ h4: 'heading-four',
33
+ h5: 'heading-five',
34
+ h6: 'heading-six',
35
+ };
36
+
37
+ /**
38
+ * Tags to marks.
39
+ *
40
+ * @type {Object}
41
+ */
42
+
43
+ const MARK_TAGS = {
44
+ b: 'bold',
45
+ em: 'italic',
46
+ u: 'underline',
47
+ s: 'strikethrough',
48
+ code: 'code',
49
+ strong: 'bold',
50
+ };
51
+
52
+ export const parseStyleString = (s) => {
53
+ const regex = /([\w-]*)\s*:\s*([^;]*)/g;
54
+ let match;
55
+ const result = {};
56
+ while ((match = regex.exec(s))) {
57
+ result[match[1]] = match[2].trim();
58
+ }
59
+ return result;
60
+ };
61
+
62
+ export const getBase64 = (file) => {
63
+ return new Promise((resolve, reject) => {
64
+ const reader = new FileReader();
65
+ reader.readAsDataURL(file);
66
+ reader.onload = () => resolve(reader.result);
67
+ reader.onerror = (error) => reject(error);
68
+ });
69
+ };
70
+
71
+ export const reactAttributes = (o) => toStyleObject(o, { camelize: true, addUnits: false });
72
+
73
+ const attributesToMap = (el) => (acc, attribute) => {
74
+ const value = el.getAttribute(attribute);
75
+ if (value) {
76
+ if (attribute === 'style') {
77
+ const styleString = el.getAttribute(attribute);
78
+ const reactStyleObject = reactAttributes(parseStyleString(styleString));
79
+ acc['style'] = reactStyleObject;
80
+ } else {
81
+ acc[attribute] = el.getAttribute(attribute);
82
+ }
83
+ }
84
+ return acc;
85
+ };
86
+
87
+ const attributes = ['border', 'cellpadding', 'cellspacing', 'class', 'style'];
88
+
89
+ /**
90
+ * Serializer rules.
91
+ *
92
+ * @type {Array}
93
+ */
94
+
95
+ const blocks = {
96
+ deserialize(el, next) {
97
+ log('[blocks:deserialize] block: ', el);
98
+ const block = BLOCK_TAGS[el.tagName.toLowerCase()];
99
+ if (!block) return;
100
+ log('[blocks:deserialize] block: ', block);
101
+
102
+ if (el.childNodes.length === 1) {
103
+ const cn = el.childNodes[0];
104
+ if (cn && cn.tagName && cn.tagName.toLowerCase() === block) {
105
+ log('[we have a child node of the same]...');
106
+ return;
107
+ }
108
+ }
109
+
110
+ return jsx(
111
+ 'element',
112
+ {
113
+ type: block,
114
+ /**
115
+ * Here for rendering styles for all block elements
116
+ */
117
+ data: { attributes: attributes.reduce(attributesToMap(el), {}) },
118
+ },
119
+ next(el.childNodes),
120
+ );
121
+ },
122
+ serialize: (object, children) => {
123
+ if (object.object !== 'block') return;
124
+
125
+ const jsonData = object.data.toJSON();
126
+
127
+ log('[blocks:serialize] object: ', object, children);
128
+ let key;
129
+
130
+ for (key in BLOCK_TAGS) {
131
+ if (BLOCK_TAGS[key] === object.type) {
132
+ const Tag = key;
133
+
134
+ return <Tag {...jsonData.attributes}>{children}</Tag>;
135
+ }
136
+ }
137
+ },
138
+ };
139
+
140
+ const marks = {
141
+ deserialize(el, next) {
142
+ const mark = MARK_TAGS[el.tagName.toLowerCase()];
143
+ if (!mark) {
144
+ return;
145
+ }
146
+ log('[deserialize] mark: ', mark);
147
+
148
+ return jsx('element', { type: mark }, next(el.childNodes));
149
+ },
150
+ serialize(object, children) {
151
+ /*if (Mark.isMark(object)) {
152
+ for (var key in MARK_TAGS) {
153
+ if (MARK_TAGS[key] === object.type) {
154
+ const Tag = key;
155
+ return <Tag>{children}</Tag>;
156
+ }
157
+ }
158
+ }*/
159
+ },
160
+ };
161
+
162
+ const findPreviousText = (el) => {
163
+ if (el.nodeName === '#text') {
164
+ return el;
165
+ }
166
+
167
+ if (el.previousSibling) {
168
+ return findPreviousText(el.previousSibling);
169
+ }
170
+
171
+ return null;
172
+ };
173
+
174
+ export const TEXT_RULE = {
175
+ deserialize(el) {
176
+ /**
177
+ * This needs to be called on the dom element in order to merge the adjacent text nodes together
178
+ * */
179
+ el.normalize();
180
+
181
+ if (el.tagName && el.tagName.toLowerCase() === 'br') {
182
+ return jsx('text', {});
183
+ }
184
+
185
+ if (el.nodeName === '#text') {
186
+ if (el.nodeValue && el.nodeValue.match(/<!--.*?-->/)) return;
187
+
188
+ log('[text:deserialize] return text object..');
189
+ return jsx('text', {}, el.nodeValue);
190
+ }
191
+ },
192
+
193
+ serialize(obj, children) {
194
+ if (obj.object === 'string') {
195
+ return children.split('\n').reduce((array, text, i) => {
196
+ if (i !== 0) array.push(<br />);
197
+ array.push(text);
198
+ return array;
199
+ }, []);
200
+ }
201
+ },
202
+ };
203
+
204
+ const RULES = [
205
+ listSerialization,
206
+ mathSerialization,
207
+ mediaSerialization,
208
+ imgSerialization,
209
+ tableSerialization,
210
+ responseAreaSerialization,
211
+ TEXT_RULE,
212
+ blocks,
213
+ marks,
214
+ ];
215
+
216
+ function allWhitespace(node) {
217
+ // Use ECMA-262 Edition 3 String and RegExp features
218
+ return !/[^\t\n\r ]/.test(node.textContent);
219
+ }
220
+
221
+ function defaultParseHtml(html) {
222
+ if (typeof DOMParser === 'undefined') {
223
+ throw new Error(
224
+ 'The native `DOMParser` global which the `Html` serializer uses by default is not present in this environment. You must supply the `options.parseHtml` function instead.',
225
+ );
226
+ }
227
+
228
+ const parsed = new DOMParser().parseFromString(html, 'text/html');
229
+
230
+ const { body } = parsed;
231
+ const textNodes = document.createTreeWalker(body, NodeFilter.SHOW_TEXT, null, null);
232
+ let n = textNodes.nextNode();
233
+
234
+ while (n) {
235
+ if (allWhitespace(n) || n.nodeValue === '\u200B') {
236
+ n.parentNode.removeChild(n);
237
+ }
238
+ n = textNodes.nextNode();
239
+ }
240
+
241
+ return body;
242
+ }
243
+
244
+ /** If this lib is used on the server side, we need to bypass using the DOMParser - just put in a stub. */
245
+ const parseHtml =
246
+ typeof window === 'undefined'
247
+ ? () => ({
248
+ childNodes: [],
249
+ })
250
+ : defaultParseHtml;
251
+
252
+ const serializer = new TestSerializer({
253
+ defaultBlock: 'div',
254
+ rules: RULES,
255
+ parseHtml,
256
+ });
257
+
258
+ const _extends =
259
+ Object.assign ||
260
+ function(target) {
261
+ for (var i = 1; i < arguments.length; i++) {
262
+ var source = arguments[i];
263
+
264
+ for (var key in source) {
265
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
266
+ target[key] = source[key];
267
+ }
268
+ }
269
+ }
270
+
271
+ return target;
272
+ };
273
+
274
+ export const htmlToValue = (html) => {
275
+ try {
276
+ return serializer.deserialize(html);
277
+ } catch (e) {
278
+ console.log("Couldn't parse html: ", e);
279
+ return {};
280
+ }
281
+ };
282
+
283
+ export const valueToHtml = (value) => serializer.serialize(value);
284
+
285
+ /**
286
+ *
287
+ * <div><div>a</div></div> -> <div>a</div>
288
+ *
289
+ * <div><div>a</div><div>b</div></div> -> <div>a</div><div>b</div>
290
+ * <div><div>a</div>4444<div>b</div></div> -> <div>a</div>4444<div>b</div>
291
+ */
@@ -0,0 +1,8 @@
1
+ export const parseDegrees = (html) =>
2
+ html
3
+ // removes \( use case: 50°
4
+ .replace(/\\[(]/g, '')
5
+ // removes \) use case: 50°+m<1
6
+ .replace(/\\[)]/g, '')
7
+ // removes \degree use case: 50°
8
+ .replace(/\\degree/g, '&deg;');
@@ -1,7 +1,10 @@
1
- import Html from 'slate-html-serializer';
1
+ import React from 'react';
2
+ import { jsx } from 'slate-hyperscript';
2
3
  import { object as toStyleObject } from 'to-style';
3
4
  import debug from 'debug';
4
5
 
6
+ import Html from './test-serializer';
7
+
5
8
  const log = debug('@pie-lib:mask-markup:serialization');
6
9
 
7
10
  const INLINE = ['span'];
@@ -105,13 +108,13 @@ export const MARK_TAGS = {
105
108
  const marks = {
106
109
  deserialize(el, next) {
107
110
  const mark = MARK_TAGS[el.tagName.toLowerCase()];
108
- if (!mark) return;
111
+
112
+ if (!mark) {
113
+ return;
114
+ }
115
+
109
116
  log('[deserialize] mark: ', mark);
110
- return {
111
- object: 'mark',
112
- type: mark,
113
- nodes: next(el.childNodes),
114
- };
117
+ return jsx('text', { type: mark }, next(el.childNodes));
115
118
  },
116
119
  };
117
120
 
@@ -127,10 +130,7 @@ const rules = [
127
130
  }
128
131
 
129
132
  if (el.nodeType === TEXT_NODE) {
130
- return {
131
- object: 'text',
132
- leaves: [{ text: el.textContent }],
133
- };
133
+ return jsx('text', el.textContent);
134
134
  }
135
135
 
136
136
  const type = el.tagName.toLowerCase();
@@ -142,21 +142,33 @@ const rules = [
142
142
  }
143
143
 
144
144
  const allAttrs = attributes.reduce(attributesToMap(el), { ...normalAttrs });
145
- const object = getObject(type);
146
145
 
147
146
  if (el.tagName.toLowerCase() === 'math') {
148
- return {
149
- isMath: true,
150
- nodes: [el],
151
- };
147
+ return jsx('element', {
148
+ type: 'mathml',
149
+ data: {
150
+ html: el.innerHTML,
151
+ },
152
+ });
153
+
154
+ // return {
155
+ // isMath: true,
156
+ // nodes: [el]
157
+ // };
158
+ }
159
+
160
+ if (el.tagName.toLowerCase() === 'br') {
161
+ return jsx('element', { type, data: {} });
152
162
  }
153
163
 
154
- return {
155
- object,
156
- type,
157
- data: { dataset: { ...el.dataset }, attributes: { ...allAttrs } },
158
- nodes: next(el.childNodes),
159
- };
164
+ return jsx(
165
+ 'element',
166
+ {
167
+ type,
168
+ data: { dataset: { ...el.dataset }, attributes: { ...allAttrs } },
169
+ },
170
+ next(el.childNodes),
171
+ );
160
172
  },
161
173
  },
162
174
  ];
@@ -0,0 +1,163 @@
1
+ import React from 'react';
2
+ import ReactServer from 'react-dom/server';
3
+ import escapeHtml from 'escape-html';
4
+ import { Text } from 'slate';
5
+ import { jsx } from 'slate-hyperscript';
6
+
7
+ function allWhitespace(node) {
8
+ // Use ECMA-262 Edition 3 String and RegExp features
9
+ return !/[^\t\n\r ]/.test(node.textContent);
10
+ }
11
+
12
+ function defaultParseHtml(html) {
13
+ if (typeof DOMParser === 'undefined') {
14
+ throw new Error(
15
+ 'The native `DOMParser` global which the `Html` serializer uses by default is not present in this environment. You must supply the `options.parseHtml` function instead.',
16
+ );
17
+ }
18
+
19
+ const parsed = new DOMParser().parseFromString(html, 'text/html');
20
+
21
+ const { body } = parsed;
22
+ const textNodes = document.createTreeWalker(body, NodeFilter.SHOW_TEXT, null, null);
23
+ let n = textNodes.nextNode();
24
+
25
+ while (n) {
26
+ if (allWhitespace(n) || n.nodeValue === '\u200B') {
27
+ n.parentNode.removeChild(n);
28
+ }
29
+ n = textNodes.nextNode();
30
+ }
31
+
32
+ return body;
33
+ }
34
+
35
+ class Html {
36
+ constructor(props) {
37
+ this.defaultBlock = props.defaultBlock;
38
+ this.parseHtml = defaultParseHtml;
39
+ this.rules = props.rules;
40
+ }
41
+
42
+ serializeEls = (node) => {
43
+ if (Text.isText(node)) {
44
+ let string = escapeHtml(node.text);
45
+ if (node.bold) {
46
+ string = <strong>{string}</strong>;
47
+ }
48
+ return string;
49
+ }
50
+
51
+ let children = (node.children || []).map((n) => this.serializeEls(n));
52
+
53
+ const correctRule = this.rules.reduce((res, rule) => {
54
+ return res || rule.serialize(node, children);
55
+ }, null);
56
+
57
+ if (correctRule) {
58
+ return correctRule;
59
+ }
60
+
61
+ switch (node.type) {
62
+ case 'quote':
63
+ return (
64
+ <blockquote>
65
+ <p>{children}</p>
66
+ </blockquote>
67
+ );
68
+ case 'paragraph':
69
+ return <p>{children}</p>;
70
+ case 'link':
71
+ return <a href={escapeHtml(node.url)}>{children}</a>;
72
+ default:
73
+ return children;
74
+ }
75
+ };
76
+
77
+ serialize = (node) => {
78
+ const deserialized = this.serializeEls(node);
79
+ const html = ReactServer.renderToStaticMarkup(React.createElement('body', null, deserialized));
80
+ const inner = html.slice(6, -7);
81
+ return inner;
82
+ };
83
+
84
+ deserialize = (html) => {
85
+ let body = this.parseHtml(html);
86
+
87
+ if (body.firstChild && body.firstChild.nodeType === Node.TEXT_NODE) {
88
+ body = this.parseHtml(`<span>${html}</span>`);
89
+ }
90
+
91
+ return this.deserializeEls(body);
92
+ };
93
+
94
+ deserializeEls = (element, markAttributes = {}) => {
95
+ if (element.nodeType === Node.TEXT_NODE) {
96
+ return jsx('text', markAttributes, element.textContent);
97
+ } else if (element.nodeType !== Node.ELEMENT_NODE) {
98
+ return null;
99
+ }
100
+
101
+ const nodeAttributes = { ...markAttributes };
102
+
103
+ // define attributes for text nodes
104
+ if (element.nodeName === 'STRONG') {
105
+ nodeAttributes.bold = true;
106
+ }
107
+
108
+ const nextFn = (nodes) => {
109
+ const childNodes = Array.from(nodes);
110
+ const children = Array.from(childNodes)
111
+ .map((node) => this.deserializeEls(node, nodeAttributes))
112
+ .flat();
113
+
114
+ if (children.length === 0) {
115
+ children.push(jsx('text', nodeAttributes, ''));
116
+ }
117
+
118
+ return children;
119
+ };
120
+
121
+ const correctRule = this.rules.reduce((res, rule) => {
122
+ return res || rule.deserialize(element, nextFn);
123
+ }, null);
124
+
125
+ if (correctRule) {
126
+ return correctRule;
127
+ }
128
+
129
+ const childNodes = Array.from(element.childNodes);
130
+ const children = Array.from(childNodes)
131
+ .map((node) => this.deserializeEls(node, nodeAttributes))
132
+ .flat();
133
+
134
+ if (children.length === 0) {
135
+ children.push(jsx('text', nodeAttributes, ''));
136
+ }
137
+
138
+ switch (element.nodeName) {
139
+ case 'TABLE':
140
+ return jsx('element', { type: 'table' }, children);
141
+ case 'TBODY':
142
+ return jsx('element', { type: 'tbody' }, children);
143
+ case 'TR':
144
+ return jsx('element', { type: 'tr' }, children);
145
+ case 'TD':
146
+ return jsx('element', { type: 'td' }, children);
147
+ case 'BODY':
148
+ return jsx('fragment', {}, children);
149
+ case 'BR':
150
+ return '\n';
151
+ case 'BLOCKQUOTE':
152
+ return jsx('element', { type: 'quote' }, children);
153
+ case 'P':
154
+ return jsx('element', { type: 'paragraph' }, children);
155
+ case 'A':
156
+ return jsx('element', { type: 'link', url: element.getAttribute('href') }, children);
157
+ default:
158
+ return children;
159
+ }
160
+ };
161
+ }
162
+
163
+ export default Html;
package/src/with-mask.jsx CHANGED
@@ -7,7 +7,7 @@ import { deserialize } from './serialization';
7
7
  export const buildLayoutFromMarkup = (markup, type) => {
8
8
  const { markup: processed } = componentize(markup, type);
9
9
  const value = deserialize(processed);
10
- return value.document;
10
+ return value;
11
11
  };
12
12
 
13
13
  export const withMask = (type, renderChildren) => {
package/LICENSE.md DELETED
@@ -1,5 +0,0 @@
1
- Copyright 2019 CoreSpring Inc
2
-
3
- Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
4
-
5
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.