datastake-daf 0.6.480 → 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.
@@ -13144,19 +13144,6 @@ const renderElement = item => {
13144
13144
  transformation: {
13145
13145
  width: data.percentageImageWidth || 60,
13146
13146
  height: data.percentageImageHeight || 20
13147
- },
13148
- floating: {
13149
- horizontalPosition: {
13150
- relative: docx__namespace.HorizontalPositionRelativeFrom.CHARACTER,
13151
- align: docx__namespace.HorizontalPositionAlign.LEFT
13152
- },
13153
- verticalPosition: {
13154
- relative: docx__namespace.VerticalPositionRelativeFrom.LINE,
13155
- offset: 142875 // 15px equivalent in EMUs (9525 EMUs per pixel)
13156
- },
13157
- wrap: {
13158
- type: docx__namespace.TextWrappingType.NONE
13159
- }
13160
13147
  }
13161
13148
  }));
13162
13149
  }
@@ -13199,18 +13186,33 @@ const renderElement = item => {
13199
13186
 
13200
13187
  // Add bullet points
13201
13188
  if (data.comments && Array.isArray(data.comments)) {
13202
- data.comments.forEach((comment, index) => {
13189
+ if (data.comments.length === 0) {
13190
+ // Add a single empty/placeholder bullet when array is empty
13203
13191
  sectionChildren.push(new docx__namespace.Paragraph({
13204
- text: comment,
13192
+ text: "",
13193
+ // or "No comments" or any placeholder text
13205
13194
  bullet: {
13206
13195
  level: 0
13207
13196
  },
13208
13197
  spacing: {
13209
- before: index === 0 ? 100 : 0,
13210
- after: index === data.comments.length - 1 ? 100 : 50
13198
+ before: 100,
13199
+ after: 100
13211
13200
  }
13212
13201
  }));
13213
- });
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
+ }
13214
13216
  }
13215
13217
 
13216
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.480",
3
+ "version": "0.6.482",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^5.2.5",
6
6
  "@antv/g2": "^5.1.1",
@@ -386,19 +386,6 @@ const renderElement = (item) => {
386
386
  width: data.percentageImageWidth || 60,
387
387
  height: data.percentageImageHeight || 20,
388
388
  },
389
- floating: {
390
- horizontalPosition: {
391
- relative: docx.HorizontalPositionRelativeFrom.CHARACTER,
392
- align: docx.HorizontalPositionAlign.LEFT,
393
- },
394
- verticalPosition: {
395
- relative: docx.VerticalPositionRelativeFrom.LINE,
396
- offset: 142875, // 15px equivalent in EMUs (9525 EMUs per pixel)
397
- },
398
- wrap: {
399
- type: docx.TextWrappingType.NONE,
400
- }
401
- }
402
389
  })
403
390
  );
404
391
  }
@@ -442,18 +429,32 @@ const renderElement = (item) => {
442
429
 
443
430
  // Add bullet points
444
431
  if (data.comments && Array.isArray(data.comments)) {
445
- data.comments.forEach((comment, index) => {
432
+ if (data.comments.length === 0) {
433
+ // Add a single empty/placeholder bullet when array is empty
446
434
  sectionChildren.push(
447
435
  new docx.Paragraph({
448
- text: comment,
436
+ text: "", // or "No comments" or any placeholder text
449
437
  bullet: { level: 0 },
450
438
  spacing: {
451
- before: index === 0 ? 100 : 0,
452
- after: index === data.comments.length - 1 ? 100 : 50
439
+ before: 100,
440
+ after: 100
453
441
  }
454
442
  })
455
443
  );
456
- });
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
+ }
457
458
  }
458
459
 
459
460
  // Wrap everything in a bordered table