capibara 1.3.83 → 1.3.85

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "capibara",
3
- "version": "1.3.83",
3
+ "version": "1.3.85",
4
4
  "main": "dist/index.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -777,7 +777,15 @@ export class Capibara{
777
777
  */
778
778
  mouseMoveOnFlexBoxContainer(evt){
779
779
  let position = utils.eventToPosition(this.config, evt, this.$elements.$table);
780
- this.refreshDetailDayPosition(position);
780
+ let last = this.lastDetailDayPosition;
781
+ let isSameCell = last &&
782
+ !this.$elements.$detailDay.classList.contains("dd-hide") &&
783
+ last.position.top === position.top &&
784
+ last.position.left === position.left &&
785
+ last.scrollTop === utils.tablePositions.scrollTop;
786
+ if(!isSameCell){
787
+ this.refreshDetailDayPosition(position);
788
+ }
781
789
  evt.preventDefault();
782
790
  }
783
791
 
@@ -788,8 +796,22 @@ export class Capibara{
788
796
  * @param {Object} evt - Evento de mouseleave
789
797
  */
790
798
  mouseLeaveOnFloatBoxContainer(evt){
791
- this.hideDetailDay();
792
799
  evt.preventDefault();
800
+ let $detailDay = this.$elements.$detailDay;
801
+ if(evt.relatedTarget && $detailDay.contains(evt.relatedTarget)) return;
802
+ // margen para cruzar hasta el panel y poder hacer scroll en él
803
+ clearTimeout(this.hideDetailDayTimer);
804
+ this.hideDetailDayTimer = setTimeout(() => this.hideDetailDay(), 200);
805
+ }
806
+
807
+ mouseEnterDetailDay(){
808
+ clearTimeout(this.hideDetailDayTimer);
809
+ }
810
+
811
+ mouseLeaveDetailDay(evt){
812
+ let related = evt.relatedTarget;
813
+ if(related && this.$elements.$floatBoxContainer.contains(related)) return;
814
+ this.hideDetailDay();
793
815
  }
794
816
 
795
817
  /**
@@ -1268,6 +1290,7 @@ export class Capibara{
1268
1290
  * oculta detailDay en el dom, usando la clase dd-hide
1269
1291
  */
1270
1292
  hideDetailDay(){
1293
+ clearTimeout(this.hideDetailDayTimer);
1271
1294
  this.$elements.$detailDay.classList.add("dd-hide");
1272
1295
  };
1273
1296
 
@@ -1354,32 +1377,82 @@ export class Capibara{
1354
1377
  *
1355
1378
  * @param {Object} evt - evento de mousemove, para posiciones en pantalla
1356
1379
  */
1357
- refreshDetailDayPosition(position){
1380
+ refreshDetailDayPosition(position, scrollTarget = {}){
1381
+ let $detailDay = this.$elements.$detailDay;
1382
+ let $container = this.$elements.$container;
1358
1383
  let dayWidth = parseFloat(utils.getCSSVariable(this.config, "--day-width"));
1359
1384
  let itemHeight = parseFloat(utils.getCSSVariable(this.config, "--item-height"));
1385
+ let headerHeight = parseFloat(utils.getCSSVariable(this.config, "--header-height"));
1386
+ let margin = 8;
1387
+ let arrowSpace = 20;
1360
1388
 
1361
- this.$elements.$detailDay.style.top = position.top + "px";
1362
- this.$elements.$detailDay.style.left = position.left + dayWidth + "px";
1389
+ let xPositionClass = position.xPercent > 30 ? "has-right-arrow" : "";
1363
1390
 
1364
- let yPositionClass = "has-top-arrow";
1365
- let xPositionClass = "";
1366
-
1367
- //condicion para primeras 3 filas
1368
- if(position.topClient <= itemHeight *3 ){
1369
- yPositionClass = "has-ceil-arrow";
1370
- }else if( position.yPercent > 20 &&
1371
- position.yPercent <= 70){ //entre 20 y 50 %
1372
- yPositionClass = "has-middle-arrow";
1373
- }else if(position.yPercent > 70){
1374
- yPositionClass = "has-bottom-arrow";
1391
+ //quita dd-hide, sobreescribiendo todas las clases
1392
+ $detailDay.className = "detail-day has-fitted-position " + xPositionClass;
1393
+ $detailDay.style.left = position.left + dayWidth + "px";
1394
+
1395
+ // En mobile el contenedor hace scroll suave hasta la celda: se calcula con
1396
+ // el scroll de destino, no con el actual.
1397
+ let scrollTop = scrollTarget.top != null ? scrollTarget.top : utils.tablePositions.scrollTop;
1398
+ let scrollLeft = scrollTarget.left != null ? scrollTarget.left : utils.tablePositions.scrollLeft;
1399
+ let visTop = scrollTop + margin;
1400
+ let visBottom = scrollTop + $container.clientHeight - headerHeight - margin;
1401
+
1402
+ // Ancho libre entre la celda y el borde del contenedor, del lado donde se
1403
+ // abre el panel (puede cubrir la columna de nombres).
1404
+ let navWidth = this.$elements.$navLeft ? this.$elements.$navLeft.clientWidth : 0;
1405
+ let cellLeftClient = position.left - scrollLeft + navWidth;
1406
+ let available = Math.max(xPositionClass
1407
+ ? cellLeftClient - arrowSpace - margin
1408
+ : $container.clientWidth - (cellLeftClient + dayWidth) - arrowSpace - margin, 200);
1409
+
1410
+ $detailDay.style.width = "";
1411
+ $detailDay.style.maxWidth = this.isMobile ? available + "px" : "";
1412
+ // min-width del CSS ganaría a este max-width en pantallas angostas
1413
+ $detailDay.style.minWidth = this.isMobile ? "0" : "";
1414
+ $detailDay.style.maxHeight = Math.max(visBottom - visTop, itemHeight * 3) + "px";
1415
+
1416
+ // Si el contenido no cabe en alto, primero se ensancha el panel de a una
1417
+ // columna (el grid agrega columnas solo) mientras haya espacio al costado;
1418
+ // si aun así no cabe, se prueba con una densidad más compacta. Con poco
1419
+ // contenido queda el tamaño y el espaciado normal.
1420
+ let $body = $detailDay.querySelector(".detail-day__body");
1421
+ if($body){
1422
+ let baseClass = $detailDay.className;
1423
+ let overflows = () => $body.scrollHeight > $body.clientHeight + 1;
1424
+ let maxDensity = this.isMobile ? 2 : 3;
1425
+ let applyDensity = (density) => {
1426
+ $detailDay.className = density ? baseClass + " dd-density-" + density : baseClass;
1427
+ $detailDay.style.width = "";
1428
+ $detailDay.style.maxWidth = this.isMobile ? available + "px" : "";
1429
+ let width = $detailDay.offsetWidth;
1430
+ while(overflows() && width < available){
1431
+ width = Math.min(width + 160, available);
1432
+ $detailDay.style.maxWidth = available + "px";
1433
+ $detailDay.style.width = width + "px";
1434
+ }
1435
+ return !overflows();
1436
+ };
1437
+ let fits = false;
1438
+ for(let density = 0; density <= maxDensity && !fits; density++){
1439
+ fits = applyDensity(density);
1440
+ }
1441
+ // En el teléfono, si ni compactando cabe, igual habrá scroll: se
1442
+ // prefiere letra legible a ahorrar unas líneas.
1443
+ if(!fits && this.isMobile) applyDensity(1);
1375
1444
  }
1376
1445
 
1377
- if(position.xPercent > 30 ){
1378
- xPositionClass = "has-right-arrow";
1379
- }
1446
+ // Centra el panel en la celda y lo desplaza lo justo para no salir del
1447
+ // área visible; la flecha sigue apuntando a la celda.
1448
+ let height = $detailDay.offsetHeight;
1449
+ let cellCenter = position.top + itemHeight / 2;
1450
+ let top = Math.max(Math.min(cellCenter - height / 2, visBottom - height), visTop);
1451
+ let arrowTop = Math.max(6, Math.min(cellCenter - top - 10, height - 26));
1380
1452
 
1381
- //quita dd-hide, sobreescribiendo todas las clases
1382
- this.$elements.$detailDay.className = "detail-day "+ yPositionClass + " " + xPositionClass;
1453
+ $detailDay.style.top = top + "px";
1454
+ $detailDay.style.setProperty("--dd-arrow-top", arrowTop + "px");
1455
+ this.lastDetailDayPosition = { position, scrollTarget, scrollTop };
1383
1456
  }
1384
1457
 
1385
1458
 
@@ -1410,6 +1483,7 @@ export class Capibara{
1410
1483
  * usada para mostrar detalle de dia/item del floatbox
1411
1484
  */
1412
1485
  mouseOverFloatBox(evt, force){
1486
+ clearTimeout(this.hideDetailDayTimer);
1413
1487
  let item = evt.detail.item;
1414
1488
  let dataDay = evt.detail.data;
1415
1489
 
@@ -1421,6 +1495,11 @@ export class Capibara{
1421
1495
  this.$elements.$detailDay.innerHTML = newDDContentString;
1422
1496
  }
1423
1497
  this.lastDataDay = dataDay;
1498
+ // el alto cambió con el contenido: recalcular sobre la misma celda
1499
+ let last = this.lastDetailDayPosition;
1500
+ if(last && !this.$elements.$detailDay.classList.contains("dd-hide")){
1501
+ this.refreshDetailDayPosition(last.position, last.scrollTarget);
1502
+ }
1424
1503
  }
1425
1504
  }
1426
1505
 
@@ -1622,12 +1701,16 @@ export class Capibara{
1622
1701
  let top = pos.top - 0.5 * itemHeight;
1623
1702
 
1624
1703
  let position = utils.eventToPosition(this.config, evt, this.$elements.$table);
1704
+ let $container = this.$elements.$container;
1705
+ let maxTop = Math.max($container.scrollHeight - $container.clientHeight, 0);
1706
+ let maxLeft = Math.max($container.scrollWidth - $container.clientWidth, 0);
1707
+ top = Math.min(Math.max(top, 0), maxTop);
1708
+ left = Math.min(Math.max(left, 0), maxLeft);
1625
1709
  this.refreshDetailDayPosition({
1626
1710
  ...position,
1627
- topClient : position.yInnerPercent >= 70 ? position.topClient : 0, // fuerza posicion de arrow en detailday
1628
1711
  xPercent : position.x < 4 ? 0: 100 // fuerza arrow right
1629
- });
1630
- this.$elements.$container.scroll({
1712
+ }, { top, left });
1713
+ $container.scroll({
1631
1714
  top, left,
1632
1715
  behavior: 'smooth'
1633
1716
  });
@@ -1680,6 +1763,13 @@ export class Capibara{
1680
1763
  this.$elements.$floatBoxContainer.addEventListener("mouseleave", this.mouseLeaveOnFloatBoxContainer.bind(this));
1681
1764
  this.$elements.$floatBoxContainer.addEventListener("contextmenu", this.rightClickOnFloatBox.bind(this));
1682
1765
 
1766
+ this.$elements.$detailDay.addEventListener("mouseenter", this.mouseEnterDetailDay.bind(this));
1767
+ this.$elements.$detailDay.addEventListener("mouseleave", this.mouseLeaveDetailDay.bind(this));
1768
+ // el panel vive dentro de $table: sin esto un click en él selecciona el día de abajo
1769
+ ["click", "mousemove", "contextmenu"].forEach((name) => {
1770
+ this.$elements.$detailDay.addEventListener(name, (e) => e.stopPropagation());
1771
+ });
1772
+
1683
1773
  this.$elements.$table.addEventListener("mousemove", this.mouseMoveOnTable.bind(this) );
1684
1774
  this.$elements.$table.addEventListener("click", this.clickOnTable.bind(this));
1685
1775
  this.$elements.$table.addEventListener("contextmenu", this.rightClickOnTable.bind(this));
@@ -4,48 +4,79 @@
4
4
 
5
5
  .capibara {
6
6
  .detail-day {
7
- .fert-detail {
8
- min-width: 0;
9
- padding-block: 0.375rem;
7
+ // Fertilización: una fila por producto para que varios productos no
8
+ // multipliquen el alto del panel.
9
+ .item-detail--wide {
10
+ grid-column: 1 / -1;
10
11
 
11
- & + .fert-detail {
12
- border-top: 1px solid currentColor;
13
- margin-top: 0.375rem;
12
+ .item-description {
13
+ display: block;
14
14
  }
15
15
  }
16
16
 
17
- .fert-detail__product {
18
- font-weight: 600;
19
- margin-bottom: 0.25rem;
20
- overflow-wrap: anywhere;
21
- }
22
-
23
- .fert-detail__table {
17
+ .fert-table {
24
18
  width: 100%;
25
19
  border-collapse: collapse;
26
- table-layout: fixed;
27
20
  font-size: inherit;
21
+ font-variant-numeric: tabular-nums;
28
22
 
29
- tbody tr:nth-child(even) {
30
- background-color: color-mix(in srgb, currentColor 4%, transparent);
23
+ th,
24
+ td {
25
+ padding: 0.25rem 0 0.25rem 0.75rem;
26
+ vertical-align: baseline;
27
+ text-align: right;
28
+ white-space: nowrap;
29
+ overflow-wrap: normal;
30
+ word-break: normal;
31
31
  }
32
32
 
33
- th, td {
34
- padding: 0.2rem 0;
35
- vertical-align: top;
36
- overflow-wrap: anywhere;
33
+ th:first-child,
34
+ td:first-child {
35
+ padding-left: 0;
36
+ text-align: left;
37
37
  }
38
38
 
39
- th {
40
- width: 46%;
41
- padding-right: 0.5rem;
39
+ thead th {
40
+ font-size: 0.8em;
41
+ font-weight: 400;
42
+ opacity: 0.7;
43
+ padding-top: 0;
44
+ }
45
+
46
+ tbody tr {
47
+ border-top: 1px solid color-mix(in srgb, currentColor 12%, transparent);
48
+ }
49
+
50
+ tbody th {
42
51
  text-align: left;
52
+ font-weight: 600;
53
+ white-space: normal;
54
+ overflow-wrap: anywhere;
55
+ width: 100%;
56
+ }
57
+
58
+ .fert-table__unit {
59
+ margin-left: 0.2em;
60
+ font-size: 0.85em;
61
+ opacity: 0.75;
62
+ }
63
+
64
+ .fert-table__note {
65
+ display: block;
66
+ font-size: 0.8em;
43
67
  font-weight: 400;
68
+ opacity: 0.7;
44
69
  }
45
70
 
46
- td {
47
- text-align: right;
48
- font-variant-numeric: tabular-nums;
71
+ @media screen and (max-width: 600px) {
72
+ td {
73
+ line-height: 1.15;
74
+ }
75
+
76
+ .fert-table__unit {
77
+ display: block;
78
+ margin-left: 0;
79
+ }
49
80
  }
50
81
  }
51
82
 
@@ -59,7 +90,7 @@
59
90
  min-width: min(18rem, calc(100vw - 2rem));
60
91
  max-width: min(42rem, calc(100vw - 2rem));
61
92
  border: 1px solid grey;
62
- padding: 0.75em;
93
+ padding: 0;
63
94
  display: flex;
64
95
  flex-flow: column nowrap;
65
96
  margin: 0 0 0 1em;
@@ -99,6 +130,99 @@
99
130
  display: none;
100
131
  }
101
132
 
133
+ .detail-day__body {
134
+ flex: 1 1 auto;
135
+ min-height: 0;
136
+ padding: 0.75em;
137
+ display: flex;
138
+ flex-flow: column nowrap;
139
+ overflow-y: auto;
140
+ overscroll-behavior: contain;
141
+ border-radius: inherit;
142
+ }
143
+
144
+ // Posición calculada en JS (top y --dd-arrow-top) para que el panel no
145
+ // salga del área visible. max-height no se anima: JS mide el alto final.
146
+ &.has-fitted-position {
147
+ transform: none;
148
+ transition: top 0.2s ease, left 0.2s ease, opacity 0.2s ease;
149
+
150
+ &:after {
151
+ top: var(--dd-arrow-top, 6px);
152
+ }
153
+
154
+ &.has-right-arrow {
155
+ transform: translateX(calc(-100% - 20px - var(--day-width)));
156
+ }
157
+ }
158
+
159
+ // Densidad: JS agrega dd-density-N solo cuando el contenido no cabe en el
160
+ // área visible ni ensanchando el panel. Con poco contenido no se aplica.
161
+ &.dd-density-1,
162
+ &.dd-density-2,
163
+ &.dd-density-3 {
164
+ .detail-day__body {
165
+ padding: 0.5em 0.625em;
166
+ }
167
+ // compensa el padding del body para quedar a ras del borde
168
+ .msj-container {
169
+ margin: 0 -0.625em -0.5em -0.625em;
170
+ }
171
+ .header-detail {
172
+ .title {
173
+ font-size: 1.125em;
174
+ margin-bottom: 0;
175
+ }
176
+ .subtitle {
177
+ margin-bottom: 4px;
178
+ }
179
+ }
180
+ .list-detail.detail-grid {
181
+ gap: 0.25rem 0.75rem;
182
+ .item-detail {
183
+ padding: 0.375rem 0.5rem 0.375rem 0.75rem;
184
+ .name {
185
+ margin-bottom: 0.2rem;
186
+ }
187
+ .item-description {
188
+ gap: 0.125rem 0.75rem;
189
+ }
190
+ }
191
+ }
192
+ .fert-table {
193
+ th,
194
+ td {
195
+ padding-top: 0.125rem;
196
+ padding-bottom: 0.125rem;
197
+ }
198
+ }
199
+ }
200
+
201
+ &.dd-density-2,
202
+ &.dd-density-3 {
203
+ font-size: 0.875em;
204
+ line-height: 1.25;
205
+ .list-detail.detail-grid {
206
+ grid-template-columns: repeat(auto-fit, minmax(min(100%, 10.5rem), 1fr));
207
+ }
208
+ // la nota del producto va en la misma línea que el nombre
209
+ .fert-table .fert-table__note {
210
+ display: inline;
211
+ margin-left: 0.5em;
212
+ }
213
+ }
214
+
215
+ &.dd-density-3 {
216
+ font-size: 0.8em;
217
+ line-height: 1.15;
218
+ .list-detail.detail-grid {
219
+ grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
220
+ .item-detail {
221
+ padding: 0.25rem 0.375rem 0.25rem 0.5rem;
222
+ }
223
+ }
224
+ }
225
+
102
226
  &.has-right-arrow {
103
227
  margin: 0px 16px 0px 0px;
104
228
  transform: translateX(calc(-100% - 20px - var(--day-width)))
@@ -289,6 +413,9 @@
289
413
  &.detail-grid {
290
414
  display: grid;
291
415
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
416
+ // Las cápsulas chicas rellenan los huecos que deja una ancha
417
+ // (ej. Fertilización) en vez de dejar celdas vacías.
418
+ grid-auto-flow: row dense;
292
419
  gap: 0.5rem 1rem;
293
420
 
294
421
  // Una sola cápsula debe ocupar todo el ancho disponible.
@@ -327,7 +454,8 @@
327
454
  margin: 0;
328
455
  padding-inline: 0.125rem;
329
456
 
330
- &.is-measurement {
457
+ // el número no se corta; un sufijo largo puede pasar a otra línea
458
+ &.is-measurement .value {
331
459
  white-space: nowrap;
332
460
  }
333
461
 
@@ -448,6 +576,9 @@
448
576
  // texto que contiene la explicación de la alerta.
449
577
  width: 100%;
450
578
  box-sizing: border-box;
579
+ // el ícono es absoluto: sin esto un aviso de una línea lo deja asomar
580
+ // bajo su caja y el mensaje siguiente lo tapa
581
+ min-height: 3em;
451
582
  min-width: 0;
452
583
  max-width: 100%;
453
584
  overflow-wrap: anywhere;
@@ -500,6 +631,12 @@
500
631
  }
501
632
  }
502
633
 
634
+ // Los títulos con color hex de la configuración suelen ser oscuros
635
+ // (ej. #1a237e) y no se leen sobre el fondo del tema oscuro.
636
+ &.dark-theme .detail-day .item-detail.has-hex-color .name {
637
+ color: color-mix(in oklab, var(--local-color-font) 45%, white);
638
+ }
639
+
503
640
  @each $nameTheme, $theme in $themes {
504
641
  &#{$nameTheme} {
505
642
  .detail-day {
@@ -1317,7 +1317,7 @@ export default {
1317
1317
  if (c.isHidden) return;
1318
1318
  initialNavList += `<div class="child-initial-nav-item ${
1319
1319
  d.isClosed ? "hide" : ""
1320
- } ${c.rowClass || ""}" child="${d.id || -1}">`;
1320
+ } ${c.rowClass || ""}" child="${d.id || -1}" child-type="${d.type || ""}">`;
1321
1321
 
1322
1322
  if (c.withNav !== false) {
1323
1323
  config.timeline.nav.left.initial.vars.forEach((v) => {
@@ -1483,7 +1483,7 @@ export default {
1483
1483
  if (c.isHidden) return;
1484
1484
  exNavList += `<div class="child-ex-nav-item ${
1485
1485
  d.isClosed ? "hide" : ""
1486
- } ${c.rowClass || ""}" child="${d.id || -1}">`;
1486
+ } ${c.rowClass || ""}" child="${d.id || -1}" child-type="${d.type || ""}">`;
1487
1487
 
1488
1488
  if (c.withNav !== false) {
1489
1489
  config.timeline.nav.left.extend.vars.forEach((v) => {
@@ -1632,7 +1632,7 @@ export default {
1632
1632
  //buttons
1633
1633
  btnNavList += `<div class="cap-btn-child-nav-item parent ${
1634
1634
  d.isClosed ? "hide" : ""
1635
- } ${c.rowClass || ""}" child="${d.id || -1}">
1635
+ } ${c.rowClass || ""}" child="${d.id || -1}" child-type="${d.type || ""}">
1636
1636
  <div class="cap-btn-nav-item-content">`;
1637
1637
 
1638
1638
  if (
@@ -1951,6 +1951,19 @@ export default {
1951
1951
  itemsToHide.forEach((i) => i.classList.add("hide"));
1952
1952
  if (dataConfig) dataConfig.isClosed = true;
1953
1953
  }
1954
+
1955
+ // Las filas de nietos en las columnas del sidebar (initial/extend/botones)
1956
+ // son hermanas planas, no descendientes del hijo: sincronizarlas con el
1957
+ // estado del padre y del propio hijo.
1958
+ if ($navLeft && dataConfig && Array.isArray(dataConfig.children)) {
1959
+ dataConfig.children.forEach((c) => {
1960
+ if (!c || !Array.isArray(c.children) || !c.children.length) return;
1961
+ const hidden = dataConfig.isClosed || c.isClosed;
1962
+ $navLeft
1963
+ .querySelectorAll("[child='" + (c.id || -1) + "'][child-type='" + (c.type || "") + "']")
1964
+ .forEach(($row) => $row.classList[hidden ? "add" : "remove"]("hide"));
1965
+ });
1966
+ }
1954
1967
  }
1955
1968
 
1956
1969
  i.dispatchEvent(
@@ -2951,6 +2964,7 @@ export default {
2951
2964
  if (utils.isHexColor(cap.color)) {
2952
2965
  colorStyle = `--local-color: ${cap.color};`;
2953
2966
  colorStyle += `--local-color-font: ${cap.color};`;
2967
+ colorClass = "has-hex-color";
2954
2968
  } else {
2955
2969
  colorClass = cap.color;
2956
2970
  }
@@ -2958,7 +2972,7 @@ export default {
2958
2972
  if (hasValues && !hideIf) {
2959
2973
  visibleItemsCount++; // Incrementar contador de elementos visibles
2960
2974
  str += `
2961
- <div class="item-detail ${colorClass}" style="${colorStyle}">
2975
+ <div class="item-detail ${colorClass} ${cap.className || ""}" style="${colorStyle}">
2962
2976
 
2963
2977
  <div class="left-icon ${cap.shape || ""} "></div>
2964
2978
 
@@ -3134,6 +3148,9 @@ export default {
3134
3148
  </div>`;
3135
3149
  }
3136
3150
 
3151
+ // El cuerpo hace scroll y el contenedor no: así la flecha (:after) no se recorta.
3152
+ str = `<div class="detail-day__body">${str}</div>`;
3153
+
3137
3154
  let strContainer = `<div class="detail-day dd-hide"> ${str} </div>`;
3138
3155
 
3139
3156
  if (onlyStringContent) return str;