@instructure/ui-truncate-text 11.7.9-snapshot-0 → 11.7.9-snapshot-1
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/CHANGELOG.md +1 -1
- package/lib/TruncateText/v1/index.js +10 -12
- package/lib/TruncateText/v1/utils/cleanData.js +2 -2
- package/lib/TruncateText/v1/utils/measureText.js +2 -2
- package/lib/TruncateText/v1/utils/truncate.js +9 -11
- package/lib/TruncateText/v2/index.js +10 -12
- package/lib/TruncateText/v2/utils/cleanData.js +2 -2
- package/lib/TruncateText/v2/utils/measureText.js +2 -2
- package/lib/TruncateText/v2/utils/truncate.js +9 -11
- package/package.json +13 -13
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [11.7.9-snapshot-
|
|
6
|
+
## [11.7.9-snapshot-1](https://github.com/instructure/instructure-ui/compare/v11.7.8...v11.7.9-snapshot-1) (2026-10-06)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @instructure/ui-truncate-text
|
|
9
9
|
|
|
@@ -7,10 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = exports.TruncateText = void 0;
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _debounce = require("@instructure/debounce");
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var _safeCloneElement = require("@instructure/ui-react-utils/lib/safeCloneElement.js");
|
|
13
|
-
var _ensureSingleChild = require("@instructure/ui-react-utils/lib/ensureSingleChild.js");
|
|
10
|
+
var _uiDomUtils = require("@instructure/ui-dom-utils");
|
|
11
|
+
var _uiReactUtils = require("@instructure/ui-react-utils");
|
|
14
12
|
var _console = require("@instructure/console");
|
|
15
13
|
var _emotion = require("@instructure/emotion");
|
|
16
14
|
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
@@ -89,14 +87,14 @@ let TruncateText = exports.TruncateText = (_dec = (0, _emotion.withStyle)(_style
|
|
|
89
87
|
makeStyles?.();
|
|
90
88
|
if (children) {
|
|
91
89
|
this.checkChildren();
|
|
92
|
-
const txt = (0,
|
|
90
|
+
const txt = (0, _uiReactUtils.ensureSingleChild)(children);
|
|
93
91
|
this._text = txt ? txt : undefined;
|
|
94
92
|
this.truncate();
|
|
95
93
|
this._debounced = (0, _debounce.debounce)(this.update, this.props.debounce, {
|
|
96
94
|
leading: true,
|
|
97
95
|
trailing: true
|
|
98
96
|
});
|
|
99
|
-
this._prevWidth = (0,
|
|
97
|
+
this._prevWidth = (0, _uiDomUtils.getBoundingClientRect)(this.ref)?.width;
|
|
100
98
|
this._resizeListener = new ResizeObserver(entries => {
|
|
101
99
|
// requestAnimationFrame call is needed becuase some truncatetext test cases
|
|
102
100
|
// failed due to ResizeObserver was not able to deliver all observations within a single animation frame
|
|
@@ -156,7 +154,7 @@ let TruncateText = exports.TruncateText = (_dec = (0, _emotion.withStyle)(_style
|
|
|
156
154
|
if (prevProps.children !== this.props.children) {
|
|
157
155
|
// reset internal text variable if children change
|
|
158
156
|
this.checkChildren();
|
|
159
|
-
const txt = (0,
|
|
157
|
+
const txt = (0, _uiReactUtils.ensureSingleChild)(children);
|
|
160
158
|
this._text = txt ? txt : undefined;
|
|
161
159
|
}
|
|
162
160
|
// require the double render whenever props change
|
|
@@ -174,7 +172,7 @@ let TruncateText = exports.TruncateText = (_dec = (0, _emotion.withStyle)(_style
|
|
|
174
172
|
checkChildren() {
|
|
175
173
|
(0, _console.logError)(!(() => {
|
|
176
174
|
let isTooDeep = false;
|
|
177
|
-
const text = (0,
|
|
175
|
+
const text = (0, _uiReactUtils.ensureSingleChild)(this.props.children);
|
|
178
176
|
_react.Children.forEach(text.props.children, child => {
|
|
179
177
|
if (child.props) {
|
|
180
178
|
_react.Children.forEach(child.props.children, grandChild => {
|
|
@@ -198,7 +196,7 @@ let TruncateText = exports.TruncateText = (_dec = (0, _emotion.withStyle)(_style
|
|
|
198
196
|
if (!this.state.needsSecondRender) {
|
|
199
197
|
return;
|
|
200
198
|
}
|
|
201
|
-
if (
|
|
199
|
+
if (_uiDomUtils.canUseDOM) {
|
|
202
200
|
const result = (0, _truncate.default)(this._stage, {
|
|
203
201
|
...this.props,
|
|
204
202
|
parent: this.ref ? this.ref : undefined,
|
|
@@ -236,7 +234,7 @@ let TruncateText = exports.TruncateText = (_dec = (0, _emotion.withStyle)(_style
|
|
|
236
234
|
const nodeText = item.join('');
|
|
237
235
|
if (element && element.props) {
|
|
238
236
|
// if node is an html element and not just a string
|
|
239
|
-
childElements.push((0,
|
|
237
|
+
childElements.push((0, _uiReactUtils.safeCloneElement)(element, element.props, nodeText));
|
|
240
238
|
} else {
|
|
241
239
|
childElements.push(nodeText);
|
|
242
240
|
}
|
|
@@ -251,7 +249,7 @@ let TruncateText = exports.TruncateText = (_dec = (0, _emotion.withStyle)(_style
|
|
|
251
249
|
}
|
|
252
250
|
}, "spacer"));
|
|
253
251
|
const children = _react.Children.map(childElements, child => child);
|
|
254
|
-
return this._text.props ? (0,
|
|
252
|
+
return this._text.props ? (0, _uiReactUtils.safeCloneElement)(this._text, this._text.props, children) : children;
|
|
255
253
|
}
|
|
256
254
|
render() {
|
|
257
255
|
const {
|
|
@@ -270,7 +268,7 @@ let TruncateText = exports.TruncateText = (_dec = (0, _emotion.withStyle)(_style
|
|
|
270
268
|
ref: el => {
|
|
271
269
|
this._stage = el;
|
|
272
270
|
},
|
|
273
|
-
children: (0,
|
|
271
|
+
children: (0, _uiReactUtils.ensureSingleChild)(children)
|
|
274
272
|
})), truncatedElement]
|
|
275
273
|
});
|
|
276
274
|
}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _uiUtils = require("@instructure/ui-utils");
|
|
8
8
|
/*
|
|
9
9
|
* The MIT License (MIT)
|
|
10
10
|
*
|
|
@@ -50,7 +50,7 @@ function cleanData(stringData, options, repeat = false) {
|
|
|
50
50
|
ignore,
|
|
51
51
|
ellipsis
|
|
52
52
|
} = options;
|
|
53
|
-
let newData = (0,
|
|
53
|
+
let newData = (0, _uiUtils.cloneArray)(stringData);
|
|
54
54
|
let ellipsisNode = -1;
|
|
55
55
|
let ellipsisIndex = -1;
|
|
56
56
|
const findEllipsis = () => {
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _uiDomUtils = require("@instructure/ui-dom-utils");
|
|
8
8
|
/*
|
|
9
9
|
* The MIT License (MIT)
|
|
10
10
|
*
|
|
@@ -48,7 +48,7 @@ function measureText(nodes, parentNode) {
|
|
|
48
48
|
return width;
|
|
49
49
|
}
|
|
50
50
|
function measure(string, domNode) {
|
|
51
|
-
const style = (0,
|
|
51
|
+
const style = (0, _uiDomUtils.getCSSStyleDeclaration)(domNode);
|
|
52
52
|
// we use a canvas in a doc fragment to prevent having to render the string full width in the DOM
|
|
53
53
|
const canvas = document.createElement('canvas');
|
|
54
54
|
document.createDocumentFragment().appendChild(canvas);
|
|
@@ -5,11 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var
|
|
8
|
+
var _uiUtils = require("@instructure/ui-utils");
|
|
9
9
|
var _console = require("@instructure/console");
|
|
10
|
-
var
|
|
11
|
-
var _getBoundingClientRect = require("@instructure/ui-dom-utils/lib/getBoundingClientRect.js");
|
|
12
|
-
var _isVisible = require("@instructure/ui-dom-utils/lib/isVisible.js");
|
|
10
|
+
var _uiDomUtils = require("@instructure/ui-dom-utils");
|
|
13
11
|
var _measureText = _interopRequireDefault(require("./measureText.js"));
|
|
14
12
|
var _cleanString = _interopRequireDefault(require("./cleanString.js"));
|
|
15
13
|
var _cleanData = _interopRequireDefault(require("./cleanData.js"));
|
|
@@ -101,7 +99,7 @@ class Truncator {
|
|
|
101
99
|
if (!this._stage) {
|
|
102
100
|
return;
|
|
103
101
|
}
|
|
104
|
-
const style = (0,
|
|
102
|
+
const style = (0, _uiDomUtils.getCSSStyleDeclaration)(this._parent);
|
|
105
103
|
if (!style) {
|
|
106
104
|
return;
|
|
107
105
|
}
|
|
@@ -128,9 +126,9 @@ class Truncator {
|
|
|
128
126
|
nodeDataIndexes.push(i);
|
|
129
127
|
}
|
|
130
128
|
}
|
|
131
|
-
this._defaultStringData = (0,
|
|
132
|
-
this._nodeDataIndexes = (0,
|
|
133
|
-
this._maxHeight = maxLines === 'auto' ? (0,
|
|
129
|
+
this._defaultStringData = (0, _uiUtils.cloneArray)(stringData);
|
|
130
|
+
this._nodeDataIndexes = (0, _uiUtils.cloneArray)(nodeDataIndexes);
|
|
131
|
+
this._maxHeight = maxLines === 'auto' ? (0, _uiDomUtils.getBoundingClientRect)(this._parent).height : maxLines * actualLineHeight;
|
|
134
132
|
this._maxWidth = (0, _measureText.default)(this._nodeMap.map(item => item.node), this._parent);
|
|
135
133
|
this._maxLines = maxLines === 'auto' ? Math.round(this._maxHeight / actualLineHeight) : maxLines;
|
|
136
134
|
}
|
|
@@ -144,7 +142,7 @@ class Truncator {
|
|
|
144
142
|
// parse child nodes and build a data map to associate each node with its data
|
|
145
143
|
nodes.forEach(node => {
|
|
146
144
|
if (node.nodeType === 1 || node.nodeType === 3) {
|
|
147
|
-
const shouldTruncate = shouldTruncateWhenInvisible ? true : (0,
|
|
145
|
+
const shouldTruncate = shouldTruncateWhenInvisible ? true : (0, _uiDomUtils.isVisible)(node, false);
|
|
148
146
|
const textContent = node.textContent + ' ';
|
|
149
147
|
map.push({
|
|
150
148
|
node,
|
|
@@ -191,7 +189,7 @@ class Truncator {
|
|
|
191
189
|
}
|
|
192
190
|
|
|
193
191
|
// allow a 0.5 px margin of error for browser calculation discrepancies
|
|
194
|
-
if ((0,
|
|
192
|
+
if ((0, _uiDomUtils.getBoundingClientRect)(node).height - this._maxHeight > 0.5) {
|
|
195
193
|
fits = false;
|
|
196
194
|
}
|
|
197
195
|
return fits;
|
|
@@ -228,7 +226,7 @@ class Truncator {
|
|
|
228
226
|
};
|
|
229
227
|
const truncateArray = (truncatedLength, originalArray, indexArray, middle) => {
|
|
230
228
|
let truncated = false;
|
|
231
|
-
const truncatedArray = (0,
|
|
229
|
+
const truncatedArray = (0, _uiUtils.cloneArray)(originalArray);
|
|
232
230
|
switch (truncatedLength) {
|
|
233
231
|
// truncate nothing
|
|
234
232
|
case 0:
|
|
@@ -7,10 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = exports.TruncateText = void 0;
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _debounce = require("@instructure/debounce");
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var _safeCloneElement = require("@instructure/ui-react-utils/lib/safeCloneElement.js");
|
|
13
|
-
var _ensureSingleChild = require("@instructure/ui-react-utils/lib/ensureSingleChild.js");
|
|
10
|
+
var _uiDomUtils = require("@instructure/ui-dom-utils");
|
|
11
|
+
var _uiReactUtils = require("@instructure/ui-react-utils");
|
|
14
12
|
var _console = require("@instructure/console");
|
|
15
13
|
var _emotion = require("@instructure/emotion");
|
|
16
14
|
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
@@ -85,14 +83,14 @@ let TruncateText = exports.TruncateText = (_dec = (0, _emotion.withStyleNew)(_st
|
|
|
85
83
|
makeStyles?.();
|
|
86
84
|
if (children) {
|
|
87
85
|
this.checkChildren();
|
|
88
|
-
const txt = (0,
|
|
86
|
+
const txt = (0, _uiReactUtils.ensureSingleChild)(children);
|
|
89
87
|
this._text = txt ? txt : undefined;
|
|
90
88
|
this.truncate();
|
|
91
89
|
this._debounced = (0, _debounce.debounce)(this.update, this.props.debounce, {
|
|
92
90
|
leading: true,
|
|
93
91
|
trailing: true
|
|
94
92
|
});
|
|
95
|
-
this._prevWidth = (0,
|
|
93
|
+
this._prevWidth = (0, _uiDomUtils.getBoundingClientRect)(this.ref)?.width;
|
|
96
94
|
this._resizeListener = new ResizeObserver(entries => {
|
|
97
95
|
// requestAnimationFrame call is needed becuase some truncatetext test cases
|
|
98
96
|
// failed due to ResizeObserver was not able to deliver all observations within a single animation frame
|
|
@@ -152,7 +150,7 @@ let TruncateText = exports.TruncateText = (_dec = (0, _emotion.withStyleNew)(_st
|
|
|
152
150
|
if (prevProps.children !== this.props.children) {
|
|
153
151
|
// reset internal text variable if children change
|
|
154
152
|
this.checkChildren();
|
|
155
|
-
const txt = (0,
|
|
153
|
+
const txt = (0, _uiReactUtils.ensureSingleChild)(children);
|
|
156
154
|
this._text = txt ? txt : undefined;
|
|
157
155
|
}
|
|
158
156
|
// require the double render whenever props change
|
|
@@ -170,7 +168,7 @@ let TruncateText = exports.TruncateText = (_dec = (0, _emotion.withStyleNew)(_st
|
|
|
170
168
|
checkChildren() {
|
|
171
169
|
(0, _console.logError)(!(() => {
|
|
172
170
|
let isTooDeep = false;
|
|
173
|
-
const text = (0,
|
|
171
|
+
const text = (0, _uiReactUtils.ensureSingleChild)(this.props.children);
|
|
174
172
|
_react.Children.forEach(text.props.children, child => {
|
|
175
173
|
if (child.props) {
|
|
176
174
|
_react.Children.forEach(child.props.children, grandChild => {
|
|
@@ -194,7 +192,7 @@ let TruncateText = exports.TruncateText = (_dec = (0, _emotion.withStyleNew)(_st
|
|
|
194
192
|
if (!this.state.needsSecondRender) {
|
|
195
193
|
return;
|
|
196
194
|
}
|
|
197
|
-
if (
|
|
195
|
+
if (_uiDomUtils.canUseDOM) {
|
|
198
196
|
const result = (0, _truncate.default)(this._stage, {
|
|
199
197
|
...this.props,
|
|
200
198
|
parent: this.ref ? this.ref : undefined
|
|
@@ -231,7 +229,7 @@ let TruncateText = exports.TruncateText = (_dec = (0, _emotion.withStyleNew)(_st
|
|
|
231
229
|
const nodeText = item.join('');
|
|
232
230
|
if (element && element.props) {
|
|
233
231
|
// if node is an html element and not just a string
|
|
234
|
-
childElements.push((0,
|
|
232
|
+
childElements.push((0, _uiReactUtils.safeCloneElement)(element, element.props, nodeText));
|
|
235
233
|
} else {
|
|
236
234
|
childElements.push(nodeText);
|
|
237
235
|
}
|
|
@@ -248,7 +246,7 @@ let TruncateText = exports.TruncateText = (_dec = (0, _emotion.withStyleNew)(_st
|
|
|
248
246
|
}
|
|
249
247
|
}, "spacer"));
|
|
250
248
|
const children = _react.Children.map(childElements, child => child);
|
|
251
|
-
return this._text.props ? (0,
|
|
249
|
+
return this._text.props ? (0, _uiReactUtils.safeCloneElement)(this._text, this._text.props, children) : children;
|
|
252
250
|
}
|
|
253
251
|
render() {
|
|
254
252
|
const {
|
|
@@ -267,7 +265,7 @@ let TruncateText = exports.TruncateText = (_dec = (0, _emotion.withStyleNew)(_st
|
|
|
267
265
|
ref: el => {
|
|
268
266
|
this._stage = el;
|
|
269
267
|
},
|
|
270
|
-
children: (0,
|
|
268
|
+
children: (0, _uiReactUtils.ensureSingleChild)(children)
|
|
271
269
|
})), truncatedElement]
|
|
272
270
|
});
|
|
273
271
|
}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _uiUtils = require("@instructure/ui-utils");
|
|
8
8
|
/*
|
|
9
9
|
* The MIT License (MIT)
|
|
10
10
|
*
|
|
@@ -50,7 +50,7 @@ function cleanData(stringData, options, repeat = false) {
|
|
|
50
50
|
ignore,
|
|
51
51
|
ellipsis
|
|
52
52
|
} = options;
|
|
53
|
-
let newData = (0,
|
|
53
|
+
let newData = (0, _uiUtils.cloneArray)(stringData);
|
|
54
54
|
let ellipsisNode = -1;
|
|
55
55
|
let ellipsisIndex = -1;
|
|
56
56
|
const findEllipsis = () => {
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _uiDomUtils = require("@instructure/ui-dom-utils");
|
|
8
8
|
/*
|
|
9
9
|
* The MIT License (MIT)
|
|
10
10
|
*
|
|
@@ -48,7 +48,7 @@ function measureText(nodes, parentNode) {
|
|
|
48
48
|
return width;
|
|
49
49
|
}
|
|
50
50
|
function measure(string, domNode) {
|
|
51
|
-
const style = (0,
|
|
51
|
+
const style = (0, _uiDomUtils.getCSSStyleDeclaration)(domNode);
|
|
52
52
|
// we use a canvas in a doc fragment to prevent having to render the string full width in the DOM
|
|
53
53
|
const canvas = document.createElement('canvas');
|
|
54
54
|
document.createDocumentFragment().appendChild(canvas);
|
|
@@ -5,11 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var
|
|
8
|
+
var _uiUtils = require("@instructure/ui-utils");
|
|
9
9
|
var _console = require("@instructure/console");
|
|
10
|
-
var
|
|
11
|
-
var _getBoundingClientRect = require("@instructure/ui-dom-utils/lib/getBoundingClientRect.js");
|
|
12
|
-
var _isVisible = require("@instructure/ui-dom-utils/lib/isVisible.js");
|
|
10
|
+
var _uiDomUtils = require("@instructure/ui-dom-utils");
|
|
13
11
|
var _measureText = _interopRequireDefault(require("./measureText.js"));
|
|
14
12
|
var _cleanString = _interopRequireDefault(require("./cleanString.js"));
|
|
15
13
|
var _cleanData = _interopRequireDefault(require("./cleanData.js"));
|
|
@@ -102,7 +100,7 @@ class Truncator {
|
|
|
102
100
|
if (!this._stage) {
|
|
103
101
|
return;
|
|
104
102
|
}
|
|
105
|
-
const style = (0,
|
|
103
|
+
const style = (0, _uiDomUtils.getCSSStyleDeclaration)(this._parent);
|
|
106
104
|
if (!style) {
|
|
107
105
|
return;
|
|
108
106
|
}
|
|
@@ -128,9 +126,9 @@ class Truncator {
|
|
|
128
126
|
nodeDataIndexes.push(i);
|
|
129
127
|
}
|
|
130
128
|
}
|
|
131
|
-
this._defaultStringData = (0,
|
|
132
|
-
this._nodeDataIndexes = (0,
|
|
133
|
-
this._maxHeight = maxLines === 'auto' ? (0,
|
|
129
|
+
this._defaultStringData = (0, _uiUtils.cloneArray)(stringData);
|
|
130
|
+
this._nodeDataIndexes = (0, _uiUtils.cloneArray)(nodeDataIndexes);
|
|
131
|
+
this._maxHeight = maxLines === 'auto' ? (0, _uiDomUtils.getBoundingClientRect)(this._parent).height : maxLines * actualLineHeight;
|
|
134
132
|
this._maxWidth = (0, _measureText.default)(this._nodeMap.map(item => item.node), this._parent);
|
|
135
133
|
this._maxLines = maxLines === 'auto' ? Math.round(this._maxHeight / actualLineHeight) : maxLines;
|
|
136
134
|
}
|
|
@@ -144,7 +142,7 @@ class Truncator {
|
|
|
144
142
|
// parse child nodes and build a data map to associate each node with its data
|
|
145
143
|
nodes.forEach(node => {
|
|
146
144
|
if (node.nodeType === 1 || node.nodeType === 3) {
|
|
147
|
-
const shouldTruncate = shouldTruncateWhenInvisible ? true : (0,
|
|
145
|
+
const shouldTruncate = shouldTruncateWhenInvisible ? true : (0, _uiDomUtils.isVisible)(node, false);
|
|
148
146
|
const textContent = node.textContent + ' ';
|
|
149
147
|
map.push({
|
|
150
148
|
node,
|
|
@@ -191,7 +189,7 @@ class Truncator {
|
|
|
191
189
|
}
|
|
192
190
|
|
|
193
191
|
// allow a 0.5 px margin of error for browser calculation discrepancies
|
|
194
|
-
if ((0,
|
|
192
|
+
if ((0, _uiDomUtils.getBoundingClientRect)(node).height - this._maxHeight > 0.5) {
|
|
195
193
|
fits = false;
|
|
196
194
|
}
|
|
197
195
|
return fits;
|
|
@@ -228,7 +226,7 @@ class Truncator {
|
|
|
228
226
|
};
|
|
229
227
|
const truncateArray = (truncatedLength, originalArray, indexArray, middle) => {
|
|
230
228
|
let truncated = false;
|
|
231
|
-
const truncatedArray = (0,
|
|
229
|
+
const truncatedArray = (0, _uiUtils.cloneArray)(originalArray);
|
|
232
230
|
switch (truncatedLength) {
|
|
233
231
|
// truncate nothing
|
|
234
232
|
case 0:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-truncate-text",
|
|
3
|
-
"version": "11.7.9-snapshot-
|
|
3
|
+
"version": "11.7.9-snapshot-1",
|
|
4
4
|
"description": "A TruncateText component made by Instructure Inc.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -15,21 +15,21 @@
|
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@babel/runtime": "^7.29.7",
|
|
18
|
-
"@instructure/
|
|
19
|
-
"@instructure/debounce": "11.7.9-snapshot-
|
|
20
|
-
"@instructure/
|
|
21
|
-
"@instructure/ui-
|
|
22
|
-
"@instructure/
|
|
23
|
-
"@instructure/
|
|
24
|
-
"@instructure/ui-
|
|
25
|
-
"@instructure/ui-
|
|
18
|
+
"@instructure/console": "11.7.9-snapshot-1",
|
|
19
|
+
"@instructure/debounce": "11.7.9-snapshot-1",
|
|
20
|
+
"@instructure/shared-types": "11.7.9-snapshot-1",
|
|
21
|
+
"@instructure/ui-dom-utils": "11.7.9-snapshot-1",
|
|
22
|
+
"@instructure/emotion": "11.7.9-snapshot-1",
|
|
23
|
+
"@instructure/ui-react-utils": "11.7.9-snapshot-1",
|
|
24
|
+
"@instructure/ui-themes": "11.7.9-snapshot-1",
|
|
25
|
+
"@instructure/ui-utils": "11.7.9-snapshot-1"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"vitest": "^5.0.0",
|
|
29
|
-
"@instructure/ui-axe-check": "11.7.9-snapshot-
|
|
30
|
-
"@instructure/ui-
|
|
31
|
-
"@instructure/ui-
|
|
32
|
-
"@instructure/ui-
|
|
29
|
+
"@instructure/ui-axe-check": "11.7.9-snapshot-1",
|
|
30
|
+
"@instructure/ui-babel-preset": "11.7.9-snapshot-1",
|
|
31
|
+
"@instructure/ui-color-utils": "11.7.9-snapshot-1",
|
|
32
|
+
"@instructure/ui-text": "11.7.9-snapshot-1"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"react": ">=18 <=19"
|