@instructure/ui-truncate-text 11.6.0 → 11.6.1-snapshot-129

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 (100) hide show
  1. package/CHANGELOG.md +29 -277
  2. package/es/TruncateText/{index.js → v1/index.js} +1 -1
  3. package/es/TruncateText/v2/index.js +264 -0
  4. package/es/TruncateText/v2/props.js +26 -0
  5. package/es/TruncateText/v2/styles.js +58 -0
  6. package/es/TruncateText/v2/utils/cleanData.js +158 -0
  7. package/es/TruncateText/v2/utils/cleanString.js +53 -0
  8. package/es/TruncateText/v2/utils/measureText.js +74 -0
  9. package/es/TruncateText/v2/utils/truncate.js +341 -0
  10. package/es/{index.js → exports/a.js} +1 -1
  11. package/{src/index.ts → es/exports/b.js} +1 -2
  12. package/lib/TruncateText/{index.js → v1/index.js} +1 -1
  13. package/lib/TruncateText/v2/index.js +271 -0
  14. package/lib/TruncateText/v2/props.js +31 -0
  15. package/lib/TruncateText/v2/styles.js +64 -0
  16. package/lib/TruncateText/v2/utils/cleanData.js +164 -0
  17. package/lib/TruncateText/v2/utils/cleanString.js +59 -0
  18. package/lib/TruncateText/v2/utils/measureText.js +79 -0
  19. package/lib/TruncateText/v2/utils/truncate.js +350 -0
  20. package/lib/{index.js → exports/a.js} +2 -2
  21. package/lib/exports/b.js +12 -0
  22. package/package.json +42 -20
  23. package/src/TruncateText/{index.tsx → v1/index.tsx} +1 -1
  24. package/src/TruncateText/v2/README.md +230 -0
  25. package/src/TruncateText/v2/index.tsx +314 -0
  26. package/src/TruncateText/v2/props.ts +113 -0
  27. package/src/TruncateText/v2/styles.ts +60 -0
  28. package/src/TruncateText/v2/utils/cleanData.ts +178 -0
  29. package/src/TruncateText/v2/utils/cleanString.ts +61 -0
  30. package/src/TruncateText/v2/utils/measureText.ts +86 -0
  31. package/src/TruncateText/v2/utils/truncate.ts +451 -0
  32. package/src/exports/a.ts +25 -0
  33. package/src/exports/b.ts +25 -0
  34. package/tsconfig.build.tsbuildinfo +1 -1
  35. package/types/TruncateText/v1/index.d.ts.map +1 -0
  36. package/types/TruncateText/v1/props.d.ts.map +1 -0
  37. package/types/TruncateText/v1/styles.d.ts.map +1 -0
  38. package/types/TruncateText/v1/theme.d.ts.map +1 -0
  39. package/types/TruncateText/v1/utils/cleanData.d.ts.map +1 -0
  40. package/types/TruncateText/v1/utils/cleanString.d.ts.map +1 -0
  41. package/types/TruncateText/v1/utils/measureText.d.ts.map +1 -0
  42. package/types/TruncateText/v1/utils/truncate.d.ts.map +1 -0
  43. package/types/TruncateText/v2/index.d.ts +47 -0
  44. package/types/TruncateText/v2/index.d.ts.map +1 -0
  45. package/types/TruncateText/v2/props.d.ts +61 -0
  46. package/types/TruncateText/v2/props.d.ts.map +1 -0
  47. package/types/TruncateText/v2/styles.d.ts +15 -0
  48. package/types/TruncateText/v2/styles.d.ts.map +1 -0
  49. package/types/TruncateText/v2/utils/cleanData.d.ts +19 -0
  50. package/types/TruncateText/v2/utils/cleanData.d.ts.map +1 -0
  51. package/types/TruncateText/v2/utils/cleanString.d.ts +16 -0
  52. package/types/TruncateText/v2/utils/cleanString.d.ts.map +1 -0
  53. package/types/TruncateText/v2/utils/measureText.d.ts +13 -0
  54. package/types/TruncateText/v2/utils/measureText.d.ts.map +1 -0
  55. package/types/TruncateText/v2/utils/truncate.d.ts +35 -0
  56. package/types/TruncateText/v2/utils/truncate.d.ts.map +1 -0
  57. package/types/exports/a.d.ts +3 -0
  58. package/types/exports/a.d.ts.map +1 -0
  59. package/types/exports/b.d.ts +3 -0
  60. package/types/exports/b.d.ts.map +1 -0
  61. package/types/TruncateText/index.d.ts.map +0 -1
  62. package/types/TruncateText/props.d.ts.map +0 -1
  63. package/types/TruncateText/styles.d.ts.map +0 -1
  64. package/types/TruncateText/theme.d.ts.map +0 -1
  65. package/types/TruncateText/utils/cleanData.d.ts.map +0 -1
  66. package/types/TruncateText/utils/cleanString.d.ts.map +0 -1
  67. package/types/TruncateText/utils/measureText.d.ts.map +0 -1
  68. package/types/TruncateText/utils/truncate.d.ts.map +0 -1
  69. package/types/index.d.ts +0 -3
  70. package/types/index.d.ts.map +0 -1
  71. /package/es/TruncateText/{props.js → v1/props.js} +0 -0
  72. /package/es/TruncateText/{styles.js → v1/styles.js} +0 -0
  73. /package/es/TruncateText/{theme.js → v1/theme.js} +0 -0
  74. /package/es/TruncateText/{utils → v1/utils}/cleanData.js +0 -0
  75. /package/es/TruncateText/{utils → v1/utils}/cleanString.js +0 -0
  76. /package/es/TruncateText/{utils → v1/utils}/measureText.js +0 -0
  77. /package/es/TruncateText/{utils → v1/utils}/truncate.js +0 -0
  78. /package/lib/TruncateText/{props.js → v1/props.js} +0 -0
  79. /package/lib/TruncateText/{styles.js → v1/styles.js} +0 -0
  80. /package/lib/TruncateText/{theme.js → v1/theme.js} +0 -0
  81. /package/lib/TruncateText/{utils → v1/utils}/cleanData.js +0 -0
  82. /package/lib/TruncateText/{utils → v1/utils}/cleanString.js +0 -0
  83. /package/lib/TruncateText/{utils → v1/utils}/measureText.js +0 -0
  84. /package/lib/TruncateText/{utils → v1/utils}/truncate.js +0 -0
  85. /package/src/TruncateText/{README.md → v1/README.md} +0 -0
  86. /package/src/TruncateText/{props.ts → v1/props.ts} +0 -0
  87. /package/src/TruncateText/{styles.ts → v1/styles.ts} +0 -0
  88. /package/src/TruncateText/{theme.ts → v1/theme.ts} +0 -0
  89. /package/src/TruncateText/{utils → v1/utils}/cleanData.ts +0 -0
  90. /package/src/TruncateText/{utils → v1/utils}/cleanString.ts +0 -0
  91. /package/src/TruncateText/{utils → v1/utils}/measureText.ts +0 -0
  92. /package/src/TruncateText/{utils → v1/utils}/truncate.ts +0 -0
  93. /package/types/TruncateText/{index.d.ts → v1/index.d.ts} +0 -0
  94. /package/types/TruncateText/{props.d.ts → v1/props.d.ts} +0 -0
  95. /package/types/TruncateText/{styles.d.ts → v1/styles.d.ts} +0 -0
  96. /package/types/TruncateText/{theme.d.ts → v1/theme.d.ts} +0 -0
  97. /package/types/TruncateText/{utils → v1/utils}/cleanData.d.ts +0 -0
  98. /package/types/TruncateText/{utils → v1/utils}/cleanString.d.ts +0 -0
  99. /package/types/TruncateText/{utils → v1/utils}/measureText.d.ts +0 -0
  100. /package/types/TruncateText/{utils → v1/utils}/truncate.d.ts +0 -0
@@ -0,0 +1,350 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _escapeHtml = _interopRequireDefault(require("escape-html"));
9
+ var _cloneArray = require("@instructure/ui-utils/lib/cloneArray.js");
10
+ var _console = require("@instructure/console");
11
+ var _getCSSStyleDeclaration = require("@instructure/ui-dom-utils/lib/getCSSStyleDeclaration.js");
12
+ var _getBoundingClientRect = require("@instructure/ui-dom-utils/lib/getBoundingClientRect.js");
13
+ var _isVisible = require("@instructure/ui-dom-utils/lib/isVisible.js");
14
+ var _measureText = _interopRequireDefault(require("./measureText"));
15
+ var _cleanString = _interopRequireDefault(require("./cleanString"));
16
+ var _cleanData = _interopRequireDefault(require("./cleanData"));
17
+ /*
18
+ * The MIT License (MIT)
19
+ *
20
+ * Copyright (c) 2015 - present Instructure, Inc.
21
+ *
22
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
23
+ * of this software and associated documentation files (the "Software"), to deal
24
+ * in the Software without restriction, including without limitation the rights
25
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
26
+ * copies of the Software, and to permit persons to whom the Software is
27
+ * furnished to do so, subject to the following conditions:
28
+ *
29
+ * The above copyright notice and this permission notice shall be included in all
30
+ * copies or substantial portions of the Software.
31
+ *
32
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
33
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
34
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
35
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
36
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
37
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
38
+ * SOFTWARE.
39
+ */
40
+
41
+ /**
42
+ * ---
43
+ * parent: TruncateText
44
+ * private: true
45
+ * ---
46
+ * Truncate the text content of an HTML element and its children.
47
+ *
48
+ * @param {DOMNode} element A single element containing the content to be truncated.
49
+ * @param {Object} options={} The options object.
50
+ * @param {DOMNode} options.parent An optional parent element to use for calculations.
51
+ * @param {number|string} options.maxLines Number of lines to allow before truncating.
52
+ * @param {string} options.position=end Where to place the ellipsis within the string.
53
+ * @param {string} options.truncate=character Add ellipsis after words or after any character.
54
+ * @param {string} options.ellipsis=\u2026 Where to place the ellipsis within the string.
55
+ * @param {string[]} options.ignore Characters to ignore at truncated end of string.
56
+ * @param {number} options.lineHeight=1.2 Unitless multiplier to use in case element can have
57
+ * 'normal' lineHeight. Adjust this to better match your font if needed.
58
+ */
59
+ function truncate(element, options) {
60
+ const truncator = new Truncator(element, options);
61
+ if (truncator) {
62
+ return truncator.truncate();
63
+ }
64
+ return;
65
+ }
66
+ class Truncator {
67
+ constructor(element, options = {}) {
68
+ this._options = void 0;
69
+ this._stage = void 0;
70
+ this._parent = void 0;
71
+ this._nodeMap = void 0;
72
+ this._defaultStringData = void 0;
73
+ this._nodeDataIndexes = void 0;
74
+ this._maxHeight = void 0;
75
+ this._maxWidth = void 0;
76
+ this._maxLines = void 0;
77
+ const parentElement = element !== null && element !== void 0 && element.parentElement ? element === null || element === void 0 ? void 0 : element.parentElement : void 0;
78
+ this._options = {
79
+ parent: options.parent || parentElement,
80
+ maxLines: options.maxLines || 1,
81
+ position: options.position || 'end',
82
+ truncate: options.truncate || 'character',
83
+ ellipsis: options.ellipsis || '\u2026',
84
+ ignore: options.ignore || [' ', '.', ','],
85
+ lineHeight: options.lineHeight || 1.2,
86
+ shouldTruncateWhenInvisible: !!options.shouldTruncateWhenInvisible
87
+ };
88
+ if (!element) {
89
+ (0, _console.logError)(false, '[Truncator] No element to truncate.');
90
+ return;
91
+ }
92
+ this._stage = element;
93
+ if (options.parent) {
94
+ this._parent = this._options.parent;
95
+ } else {
96
+ const parentEl = this._stage.parentElement ? this._stage.parentElement : void 0;
97
+ this._parent = this._options.maxLines === 'auto' ? parentEl : this._stage;
98
+ }
99
+ this.setup();
100
+ }
101
+ setup() {
102
+ if (!this._stage) {
103
+ return;
104
+ }
105
+ const style = (0, _getCSSStyleDeclaration.getCSSStyleDeclaration)(this._parent);
106
+ if (!style) {
107
+ return;
108
+ }
109
+ const _this$_options = this._options,
110
+ maxLines = _this$_options.maxLines,
111
+ truncate = _this$_options.truncate,
112
+ lineHeight = _this$_options.lineHeight;
113
+ // if no explicit lineHeight is inherited, use lineHeight multiplier for calculations
114
+ const actualLineHeight = style.lineHeight === 'normal' ? lineHeight * parseFloat(style.fontSize) : parseFloat(style.lineHeight);
115
+ const node = this._stage.firstChild.children ? this._stage.firstChild : this._stage;
116
+ const nodeDataIndexes = [];
117
+ const stringData = [];
118
+ this._nodeMap = this.getNodeMap(node);
119
+ for (let i = 0; i < this._nodeMap.length; i++) {
120
+ const item = this._nodeMap[i];
121
+ if (truncate === 'word' && item.data[item.data.length - 1] === ' ') {
122
+ // remove random whitespace data between nodes
123
+ item.data.length -= 1;
124
+ }
125
+ stringData[i] = item.data;
126
+ for (let j = 0; j < item.data.length; j++) {
127
+ // map each word or character datum index to its corresponding node
128
+ nodeDataIndexes.push(i);
129
+ }
130
+ }
131
+ this._defaultStringData = (0, _cloneArray.cloneArray)(stringData);
132
+ this._nodeDataIndexes = (0, _cloneArray.cloneArray)(nodeDataIndexes);
133
+ this._maxHeight = maxLines === 'auto' ? (0, _getBoundingClientRect.getBoundingClientRect)(this._parent).height : maxLines * actualLineHeight;
134
+ this._maxWidth = (0, _measureText.default)(this._nodeMap.map(item => item.node), this._parent);
135
+ this._maxLines = maxLines === 'auto' ? Math.round(this._maxHeight / actualLineHeight) : maxLines;
136
+ }
137
+ getNodeMap(rootNode) {
138
+ const _this$_options2 = this._options,
139
+ shouldTruncateWhenInvisible = _this$_options2.shouldTruncateWhenInvisible,
140
+ truncate = _this$_options2.truncate;
141
+ const nodes = Array.from(rootNode.childNodes);
142
+ const map = [];
143
+ // parse child nodes and build a data map to associate each node with its data
144
+ nodes.forEach(node => {
145
+ if (node.nodeType === 1 || node.nodeType === 3) {
146
+ const shouldTruncate = shouldTruncateWhenInvisible ? true : (0, _isVisible.isVisible)(node, false);
147
+ const textContent = node.textContent + ' ';
148
+ map.push({
149
+ node,
150
+ data: truncate === 'word' ? shouldTruncate ?
151
+ // eslint-disable-next-line no-useless-escape
152
+ textContent.match(/.*?[\.\s\/]+?/g) : [''] : shouldTruncate ? node.textContent.split('') : []
153
+ });
154
+ }
155
+ });
156
+ return map;
157
+ }
158
+ getNodeIndexes(data) {
159
+ const nodeDataIndexes = [];
160
+ for (let i = 0; i < data.length; i++) {
161
+ for (let j = 0; j < data[i].length; j++) {
162
+ nodeDataIndexes.push([i, j]);
163
+ }
164
+ }
165
+ return nodeDataIndexes;
166
+ }
167
+ domString(data) {
168
+ let html = '';
169
+ for (let i = 0; i < data.length; i++) {
170
+ const mapItem = this._nodeMap[i];
171
+ const text = data[i].join('');
172
+ const safeText = (0, _escapeHtml.default)(text);
173
+ if (mapItem.node.nodeType === Node.ELEMENT_NODE) {
174
+ const name = mapItem.node.nodeName;
175
+ const attr = mapItem.node.attributes;
176
+ let attributes = '';
177
+ for (let j = 0; j < attr.length; j++) {
178
+ const att = attr[j];
179
+ attributes += ` ${att.nodeName}="${att.nodeValue}"`;
180
+ }
181
+ html += `<${name}${attributes}>${safeText}</${name}>`;
182
+ } else if (mapItem.node.nodeType === 3) {
183
+ html += safeText;
184
+ }
185
+ }
186
+ return html;
187
+ }
188
+ checkFit(data) {
189
+ const html = this.domString(data);
190
+ const node = this._options.maxLines === 'auto' ? this._stage : this._parent;
191
+ let fits = true;
192
+ this._stage.innerHTML = html;
193
+ // allow a 0.5 px margin of error for browser calculation discrepancies
194
+ if ((0, _getBoundingClientRect.getBoundingClientRect)(node).height - this._maxHeight > 0.5) {
195
+ fits = false;
196
+ }
197
+ return fits;
198
+ }
199
+ truncate() {
200
+ const _this$_options3 = this._options,
201
+ ellipsis = _this$_options3.ellipsis,
202
+ ignore = _this$_options3.ignore,
203
+ position = _this$_options3.position;
204
+ const middle = position === 'middle';
205
+ let truncated = false;
206
+ let truncatedText = '';
207
+ let stringData = null;
208
+ if (!this._stage) {
209
+ return;
210
+ }
211
+ const binarySearch = (_low, _high, ev, middle,
212
+ // in case we can not find the result
213
+ _default = null) => {
214
+ let low = _low;
215
+ let high = _high;
216
+ let bestResult = _default;
217
+ while (low <= high) {
218
+ const tryNumber = Math.floor((low + high) / 2);
219
+ if (ev(tryNumber, middle)) {
220
+ high = tryNumber - 1;
221
+ bestResult = tryNumber;
222
+ } else {
223
+ low = tryNumber + 1;
224
+ }
225
+ }
226
+ return bestResult;
227
+ };
228
+ const truncateArray = (truncatedLength, originalArray, indexArray, middle) => {
229
+ let truncated = false;
230
+ const truncatedArray = (0, _cloneArray.cloneArray)(originalArray);
231
+ switch (truncatedLength) {
232
+ // truncate nothing
233
+ case 0:
234
+ break;
235
+
236
+ // truncate all
237
+ case indexArray.length:
238
+ truncated = true;
239
+ for (let i = 0; i < truncatedArray.length; i++) {
240
+ truncatedArray[i] = [];
241
+ }
242
+ truncatedArray[0].push(ellipsis);
243
+ break;
244
+
245
+ // truncate a positive amount of elements
246
+ default:
247
+ truncated = true;
248
+ if (middle) {
249
+ const dataHalves = Array(2);
250
+ // calculate the indexes for two parts
251
+ dataHalves[0] = Math.floor((indexArray.length - truncatedLength - 1) / 2);
252
+ dataHalves[1] = dataHalves[0] + truncatedLength + 1;
253
+ const nodeHalves = dataHalves.map(index => indexArray[index]);
254
+ const sliceAmounts = Array(2);
255
+ sliceAmounts[0] = dataHalves[0] + 1;
256
+ sliceAmounts[1] = indexArray.length - truncatedLength - sliceAmounts[0];
257
+
258
+ // keep the first part
259
+ for (let i = 0; i <= nodeHalves[0]; i++) {
260
+ switch (true) {
261
+ case i < nodeHalves[0]:
262
+ sliceAmounts[0] -= truncatedArray[i].length;
263
+ break;
264
+ case i === nodeHalves[0]:
265
+ truncatedArray[i] = originalArray[i].slice(0, sliceAmounts[0]);
266
+ truncatedArray[i].push(ellipsis);
267
+ break;
268
+ }
269
+ }
270
+
271
+ // and the second part
272
+ for (let i = originalArray.length - 1; i >= nodeHalves[1]; i--) {
273
+ switch (true) {
274
+ case i > nodeHalves[1]:
275
+ sliceAmounts[1] -= originalArray[i].length;
276
+ break;
277
+ case i === nodeHalves[1]:
278
+ if (nodeHalves[1] > nodeHalves[0]) truncatedArray[i] = originalArray[i].slice(-sliceAmounts[1]);
279
+ if (nodeHalves[1] === nodeHalves[0]) truncatedArray[i] = truncatedArray[i].concat(originalArray[i].slice(-sliceAmounts[1]));
280
+ break;
281
+ }
282
+ }
283
+
284
+ // delete the middle
285
+ for (let i = nodeHalves[0] + 1; i < nodeHalves[1]; i++) {
286
+ truncatedArray[i] = [];
287
+ }
288
+ } else {
289
+ // the right most index to keep from truncating
290
+ const indexToTry = indexArray.length - truncatedLength - 1;
291
+ const nodeIndex = indexArray[indexToTry];
292
+ let sliceAmount = indexToTry + 1;
293
+ for (let i = 0; i < originalArray.length; i++) {
294
+ switch (true) {
295
+ case i < nodeIndex:
296
+ sliceAmount -= truncatedArray[i].length;
297
+ break;
298
+ case i === nodeIndex:
299
+ truncatedArray[i] = truncatedArray[i].slice(0, sliceAmount);
300
+ truncatedArray[i].push(ellipsis);
301
+ break;
302
+ case i > nodeIndex:
303
+ truncatedArray[i] = [];
304
+ break;
305
+ }
306
+ }
307
+ }
308
+ break;
309
+ }
310
+ return {
311
+ truncated,
312
+ truncatedArray
313
+ };
314
+ };
315
+ const truncateEvaluate = (truncatedLength, middle) => {
316
+ const _truncateArray = truncateArray(truncatedLength, this._defaultStringData, this._nodeDataIndexes, middle),
317
+ truncatedArray = _truncateArray.truncatedArray;
318
+ return this.checkFit(truncatedArray);
319
+ };
320
+
321
+ // find the best number of element to truncate
322
+ const finestMatch = binarySearch(0, this._nodeDataIndexes.length, truncateEvaluate, middle, this._nodeDataIndexes.length);
323
+ var _truncateArray2 = truncateArray(finestMatch, this._defaultStringData, this._nodeDataIndexes, middle);
324
+ truncated = _truncateArray2.truncated;
325
+ stringData = _truncateArray2.truncatedArray;
326
+ stringData = (0, _cleanData.default)(stringData, this._options, true);
327
+ for (let i = 0; i < stringData.length; i++) {
328
+ const data = stringData[i];
329
+ truncatedText += data.join('');
330
+ }
331
+ if (truncated && !middle) {
332
+ truncatedText = (0, _cleanString.default)(truncatedText.split(ellipsis)[0], ignore, false, true, true);
333
+ truncatedText += ellipsis;
334
+ } else if (truncated && middle) {
335
+ const halves = truncatedText.split(ellipsis);
336
+ truncatedText = (0, _cleanString.default)(halves[0], ignore, false, true, true) + ellipsis + (0, _cleanString.default)(halves[1], ignore, true, false, true);
337
+ }
338
+ return {
339
+ isTruncated: truncated,
340
+ text: truncatedText,
341
+ data: stringData,
342
+ constraints: {
343
+ width: this._maxWidth,
344
+ height: this._maxHeight,
345
+ lines: this._maxLines
346
+ }
347
+ };
348
+ }
349
+ }
350
+ var _default2 = exports.default = truncate;
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  Object.defineProperty(exports, "TruncateText", {
7
7
  enumerable: true,
8
8
  get: function () {
9
- return _TruncateText.TruncateText;
9
+ return _v.TruncateText;
10
10
  }
11
11
  });
12
- var _TruncateText = require("./TruncateText");
12
+ var _v = require("../TruncateText/v1");
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "TruncateText", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _v.TruncateText;
10
+ }
11
+ });
12
+ var _v = require("../TruncateText/v2");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-truncate-text",
3
- "version": "11.6.0",
3
+ "version": "11.6.1-snapshot-129",
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",
@@ -16,24 +16,24 @@
16
16
  "dependencies": {
17
17
  "@babel/runtime": "^7.27.6",
18
18
  "escape-html": "^1.0.3",
19
- "@instructure/console": "11.6.0",
20
- "@instructure/debounce": "11.6.0",
21
- "@instructure/ui-dom-utils": "11.6.0",
22
- "@instructure/emotion": "11.6.0",
23
- "@instructure/shared-types": "11.6.0",
24
- "@instructure/ui-react-utils": "11.6.0",
25
- "@instructure/ui-utils": "11.6.0"
19
+ "@instructure/console": "11.6.1-snapshot-129",
20
+ "@instructure/debounce": "11.6.1-snapshot-129",
21
+ "@instructure/emotion": "11.6.1-snapshot-129",
22
+ "@instructure/shared-types": "11.6.1-snapshot-129",
23
+ "@instructure/ui-dom-utils": "11.6.1-snapshot-129",
24
+ "@instructure/ui-utils": "11.6.1-snapshot-129",
25
+ "@instructure/ui-react-utils": "11.6.1-snapshot-129"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@testing-library/jest-dom": "^6.6.3",
29
29
  "@testing-library/react": "15.0.7",
30
30
  "@types/escape-html": "^1.0.4",
31
31
  "vitest": "^3.2.2",
32
- "@instructure/ui-axe-check": "11.6.0",
33
- "@instructure/ui-babel-preset": "11.6.0",
34
- "@instructure/ui-color-utils": "11.6.0",
35
- "@instructure/ui-text": "11.6.0",
36
- "@instructure/ui-themes": "11.6.0"
32
+ "@instructure/ui-babel-preset": "11.6.1-snapshot-129",
33
+ "@instructure/ui-color-utils": "11.6.1-snapshot-129",
34
+ "@instructure/ui-themes": "11.6.1-snapshot-129",
35
+ "@instructure/ui-axe-check": "11.6.1-snapshot-129",
36
+ "@instructure/ui-text": "11.6.1-snapshot-129"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "react": ">=18 <=19"
@@ -43,17 +43,39 @@
43
43
  },
44
44
  "sideEffects": false,
45
45
  "exports": {
46
- ".": {
47
- "types": "./types/index.d.ts",
48
- "import": "./es/index.js",
49
- "require": "./lib/index.js",
50
- "default": "./es/index.js"
51
- },
52
46
  "./lib/*": "./lib/*",
53
47
  "./es/*": "./es/*",
54
48
  "./types/*": "./types/*",
55
49
  "./package.json": "./package.json",
56
- "./src/*": "./src/*"
50
+ "./src/*": "./src/*",
51
+ ".": {
52
+ "src": "./src/exports/a.ts",
53
+ "types": "./types/exports/a.d.ts",
54
+ "import": "./es/exports/a.js",
55
+ "require": "./lib/exports/a.js",
56
+ "default": "./es/exports/a.js"
57
+ },
58
+ "./v11_6": {
59
+ "src": "./src/exports/a.ts",
60
+ "types": "./types/exports/a.d.ts",
61
+ "import": "./es/exports/a.js",
62
+ "require": "./lib/exports/a.js",
63
+ "default": "./es/exports/a.js"
64
+ },
65
+ "./v11_7": {
66
+ "src": "./src/exports/b.ts",
67
+ "types": "./types/exports/b.d.ts",
68
+ "import": "./es/exports/b.js",
69
+ "require": "./lib/exports/b.js",
70
+ "default": "./es/exports/b.js"
71
+ },
72
+ "./latest": {
73
+ "src": "./src/exports/b.ts",
74
+ "types": "./types/exports/b.d.ts",
75
+ "import": "./es/exports/b.js",
76
+ "require": "./lib/exports/b.js",
77
+ "default": "./es/exports/b.js"
78
+ }
57
79
  },
58
80
  "scripts": {
59
81
  "lint": "ui-scripts lint",
@@ -32,7 +32,7 @@ import {
32
32
  ensureSingleChild
33
33
  } from '@instructure/ui-react-utils'
34
34
  import { logError as error } from '@instructure/console'
35
- import { withStyle } from '@instructure/emotion'
35
+ import { withStyleLegacy as withStyle } from '@instructure/emotion'
36
36
 
37
37
  import generateStyle from './styles'
38
38
  import generateComponentTheme from './theme'