@elliemae/ds-truncated-expandable-text 2.0.0-next.3 → 2.0.0-next.4

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.
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
6
+ require('core-js/modules/web.dom-collections.iterator.js');
6
7
  var react = require('react');
7
8
  var reactDesc = require('react-desc');
8
9
  var styled = require('styled-components');
@@ -39,7 +40,7 @@ const TruncatedExpandableText = ({
39
40
  } = element.getBoundingClientRect();
40
41
  value.split('').forEach((char, index) => {
41
42
  // try the hyphen here
42
- element.innerText = `${newHyphenizedValue}-${char}`;
43
+ element.innerText = "".concat(newHyphenizedValue, "-").concat(char);
43
44
  const {
44
45
  height: newHeight
45
46
  } = element.getBoundingClientRect(); // if it's the first line or the height didn't change, hyphen doesn't go here,
@@ -50,20 +51,20 @@ const TruncatedExpandableText = ({
50
51
  newHyphenizedValue += char;
51
52
  } else if (index < value.length - 1 && value[index + 1].match(/\s/)) {
52
53
  // end of word
53
- element.innerText = `${newHyphenizedValue}${char}`; // sometimes the last character is wider and doesn't fit
54
+ element.innerText = "".concat(newHyphenizedValue).concat(char); // sometimes the last character is wider and doesn't fit
54
55
 
55
56
  const {
56
57
  height: endOfWordHeight
57
58
  } = element.getBoundingClientRect();
58
- if (endOfWordHeight === previousHeight) newHyphenizedValue += char;else newHyphenizedValue += `-${char}`;
59
+ if (endOfWordHeight === previousHeight) newHyphenizedValue += char;else newHyphenizedValue += "-".concat(char);
59
60
  } else if (char.match(/\s/)) {
60
61
  // we dont want "- ", leave the space character only
61
62
  newHyphenizedValue += char;
62
63
  } else if (newHyphenizedValue.length && newHyphenizedValue[newHyphenizedValue.length - 1].match(/\s/)) {
63
64
  // we produce and empty space to make sure to start on the next line
64
- newHyphenizedValue += ` ${char}`;
65
+ newHyphenizedValue += " ".concat(char);
65
66
  } else {
66
- newHyphenizedValue += `-${char}`;
67
+ newHyphenizedValue += "-".concat(char);
67
68
  }
68
69
 
69
70
  previousHeight = newHeight;
@@ -1,4 +1,5 @@
1
1
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
2
+ import 'core-js/modules/web.dom-collections.iterator.js';
2
3
  import { useState, useRef, useLayoutEffect } from 'react';
3
4
  import { describe } from 'react-desc';
4
5
  import styled from 'styled-components';
@@ -30,7 +31,7 @@ const TruncatedExpandableText = ({
30
31
  } = element.getBoundingClientRect();
31
32
  value.split('').forEach((char, index) => {
32
33
  // try the hyphen here
33
- element.innerText = `${newHyphenizedValue}-${char}`;
34
+ element.innerText = "".concat(newHyphenizedValue, "-").concat(char);
34
35
  const {
35
36
  height: newHeight
36
37
  } = element.getBoundingClientRect(); // if it's the first line or the height didn't change, hyphen doesn't go here,
@@ -41,20 +42,20 @@ const TruncatedExpandableText = ({
41
42
  newHyphenizedValue += char;
42
43
  } else if (index < value.length - 1 && value[index + 1].match(/\s/)) {
43
44
  // end of word
44
- element.innerText = `${newHyphenizedValue}${char}`; // sometimes the last character is wider and doesn't fit
45
+ element.innerText = "".concat(newHyphenizedValue).concat(char); // sometimes the last character is wider and doesn't fit
45
46
 
46
47
  const {
47
48
  height: endOfWordHeight
48
49
  } = element.getBoundingClientRect();
49
- if (endOfWordHeight === previousHeight) newHyphenizedValue += char;else newHyphenizedValue += `-${char}`;
50
+ if (endOfWordHeight === previousHeight) newHyphenizedValue += char;else newHyphenizedValue += "-".concat(char);
50
51
  } else if (char.match(/\s/)) {
51
52
  // we dont want "- ", leave the space character only
52
53
  newHyphenizedValue += char;
53
54
  } else if (newHyphenizedValue.length && newHyphenizedValue[newHyphenizedValue.length - 1].match(/\s/)) {
54
55
  // we produce and empty space to make sure to start on the next line
55
- newHyphenizedValue += ` ${char}`;
56
+ newHyphenizedValue += " ".concat(char);
56
57
  } else {
57
- newHyphenizedValue += `-${char}`;
58
+ newHyphenizedValue += "-".concat(char);
58
59
  }
59
60
 
60
61
  previousHeight = newHeight;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-truncated-expandable-text",
3
- "version": "2.0.0-next.3",
3
+ "version": "2.0.0-next.4",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Truncated Expandable Text",
6
6
  "module": "./esm/index.js",
@@ -44,8 +44,8 @@
44
44
  "build": "node ../../scripts/build/build.js"
45
45
  },
46
46
  "dependencies": {
47
- "@elliemae/ds-classnames": "2.0.0-next.3",
48
- "@elliemae/ds-utilities": "2.0.0-next.3"
47
+ "@elliemae/ds-classnames": "2.0.0-next.4",
48
+ "@elliemae/ds-utilities": "2.0.0-next.4"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@types/styled-components": "~5.1.14",
package/cjs/package.json DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "type": "commonjs",
3
- "sideEffects": [
4
- "*.css",
5
- "*.scss"
6
- ]
7
- }
package/esm/package.json DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "type": "module",
3
- "sideEffects": [
4
- "*.css",
5
- "*.scss"
6
- ]
7
- }