datastake-daf 0.6.481 → 0.6.482

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.
@@ -13186,18 +13186,33 @@ const renderElement = item => {
13186
13186
 
13187
13187
  // Add bullet points
13188
13188
  if (data.comments && Array.isArray(data.comments)) {
13189
- data.comments.forEach((comment, index) => {
13189
+ if (data.comments.length === 0) {
13190
+ // Add a single empty/placeholder bullet when array is empty
13190
13191
  sectionChildren.push(new docx__namespace.Paragraph({
13191
- text: comment,
13192
+ text: "",
13193
+ // or "No comments" or any placeholder text
13192
13194
  bullet: {
13193
13195
  level: 0
13194
13196
  },
13195
13197
  spacing: {
13196
- before: index === 0 ? 100 : 0,
13197
- after: index === data.comments.length - 1 ? 100 : 50
13198
+ before: 100,
13199
+ after: 100
13198
13200
  }
13199
13201
  }));
13200
- });
13202
+ } else {
13203
+ data.comments.forEach((comment, index) => {
13204
+ sectionChildren.push(new docx__namespace.Paragraph({
13205
+ text: comment,
13206
+ bullet: {
13207
+ level: 0
13208
+ },
13209
+ spacing: {
13210
+ before: index === 0 ? 100 : 0,
13211
+ after: index === data.comments.length - 1 ? 100 : 50
13212
+ }
13213
+ }));
13214
+ });
13215
+ }
13201
13216
  }
13202
13217
 
13203
13218
  // Wrap everything in a bordered table
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datastake-daf",
3
- "version": "0.6.481",
3
+ "version": "0.6.482",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^5.2.5",
6
6
  "@antv/g2": "^5.1.1",
@@ -429,18 +429,32 @@ const renderElement = (item) => {
429
429
 
430
430
  // Add bullet points
431
431
  if (data.comments && Array.isArray(data.comments)) {
432
- data.comments.forEach((comment, index) => {
432
+ if (data.comments.length === 0) {
433
+ // Add a single empty/placeholder bullet when array is empty
433
434
  sectionChildren.push(
434
435
  new docx.Paragraph({
435
- text: comment,
436
+ text: "", // or "No comments" or any placeholder text
436
437
  bullet: { level: 0 },
437
438
  spacing: {
438
- before: index === 0 ? 100 : 0,
439
- after: index === data.comments.length - 1 ? 100 : 50
439
+ before: 100,
440
+ after: 100
440
441
  }
441
442
  })
442
443
  );
443
- });
444
+ } else {
445
+ data.comments.forEach((comment, index) => {
446
+ sectionChildren.push(
447
+ new docx.Paragraph({
448
+ text: comment,
449
+ bullet: { level: 0 },
450
+ spacing: {
451
+ before: index === 0 ? 100 : 0,
452
+ after: index === data.comments.length - 1 ? 100 : 50
453
+ }
454
+ })
455
+ );
456
+ });
457
+ }
444
458
  }
445
459
 
446
460
  // Wrap everything in a bordered table