@mlightcad/libredwg-web 0.6.1 → 0.6.2

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.
@@ -5834,12 +5834,12 @@ class LibreEntityConverter {
5834
5834
  countBoundaryPoints
5835
5835
  );
5836
5836
  const imagedef_ref = libredwg.dwg_dynapi_entity_value(entity, "imagedef").data;
5837
- const imageDefHandle = libredwg.dwg_ref_get_absref(imagedef_ref);
5837
+ const imageDefHandle = idToString(libredwg.dwg_ref_get_absref(imagedef_ref));
5838
5838
  const imagedefreactor_ref = libredwg.dwg_dynapi_entity_value(
5839
5839
  entity,
5840
5840
  "imagedefreactor"
5841
5841
  ).data;
5842
- const imageDefReactorHandle = libredwg.dwg_ref_get_absref(imagedefreactor_ref);
5842
+ const imageDefReactorHandle = idToString(libredwg.dwg_ref_get_absref(imagedefreactor_ref));
5843
5843
  return {
5844
5844
  type: "IMAGE",
5845
5845
  ...commonAttrs,
@@ -6530,6 +6530,20 @@ class LibreEntityConverter {
6530
6530
  col_widths_ptr,
6531
6531
  columnCount
6532
6532
  );
6533
+ const table_style_ref = libredwg.dwg_dynapi_entity_value(
6534
+ entity,
6535
+ "tablestyle"
6536
+ ).data;
6537
+ const tableStyleId = idToString(
6538
+ libredwg.dwg_ref_get_absref(table_style_ref)
6539
+ );
6540
+ const block_header_ref = libredwg.dwg_dynapi_entity_value(
6541
+ entity,
6542
+ "block_header"
6543
+ ).data;
6544
+ const blockRecordHandle = idToString(
6545
+ libredwg.dwg_ref_get_absref(block_header_ref)
6546
+ );
6533
6547
  const overrideFlag = libredwg.dwg_dynapi_entity_value(
6534
6548
  entity,
6535
6549
  "table_flag_override"
@@ -6565,10 +6579,8 @@ class LibreEntityConverter {
6565
6579
  borderVisibilityOverrideFlag,
6566
6580
  rowHeightArr,
6567
6581
  columnWidthArr,
6568
- tableStyleId: "",
6569
- // TODO: Set the correct value
6570
- blockRecordHandle: 0,
6571
- // TODO: Set the correct value
6582
+ tableStyleId,
6583
+ blockRecordHandle,
6572
6584
  cells: this.convertTableCells(cells),
6573
6585
  bmpPreview: ""
6574
6586
  };
@@ -7118,7 +7130,7 @@ class LibreDwgConverter {
7118
7130
  const explodability = libredwg.dwg_dynapi_entity_value(item, "explodable").data;
7119
7131
  const scalability = libredwg.dwg_dynapi_entity_value(item, "block_scaling").data;
7120
7132
  const layout_ptr = libredwg.dwg_dynapi_entity_value(item, "layout").data;
7121
- const layout = libredwg.dwg_ref_get_absref(layout_ptr);
7133
+ const layout = idToString(libredwg.dwg_ref_get_absref(layout_ptr));
7122
7134
  let bmpPreview = "";
7123
7135
  const uint8ArrayToHexString = (bytes) => {
7124
7136
  const hexChars = new Array(bytes.length);
@@ -5839,12 +5839,12 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
5839
5839
  countBoundaryPoints
5840
5840
  );
5841
5841
  const imagedef_ref = libredwg.dwg_dynapi_entity_value(entity, "imagedef").data;
5842
- const imageDefHandle = libredwg.dwg_ref_get_absref(imagedef_ref);
5842
+ const imageDefHandle = idToString(libredwg.dwg_ref_get_absref(imagedef_ref));
5843
5843
  const imagedefreactor_ref = libredwg.dwg_dynapi_entity_value(
5844
5844
  entity,
5845
5845
  "imagedefreactor"
5846
5846
  ).data;
5847
- const imageDefReactorHandle = libredwg.dwg_ref_get_absref(imagedefreactor_ref);
5847
+ const imageDefReactorHandle = idToString(libredwg.dwg_ref_get_absref(imagedefreactor_ref));
5848
5848
  return {
5849
5849
  type: "IMAGE",
5850
5850
  ...commonAttrs,
@@ -6535,6 +6535,20 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
6535
6535
  col_widths_ptr,
6536
6536
  columnCount
6537
6537
  );
6538
+ const table_style_ref = libredwg.dwg_dynapi_entity_value(
6539
+ entity,
6540
+ "tablestyle"
6541
+ ).data;
6542
+ const tableStyleId = idToString(
6543
+ libredwg.dwg_ref_get_absref(table_style_ref)
6544
+ );
6545
+ const block_header_ref = libredwg.dwg_dynapi_entity_value(
6546
+ entity,
6547
+ "block_header"
6548
+ ).data;
6549
+ const blockRecordHandle = idToString(
6550
+ libredwg.dwg_ref_get_absref(block_header_ref)
6551
+ );
6538
6552
  const overrideFlag = libredwg.dwg_dynapi_entity_value(
6539
6553
  entity,
6540
6554
  "table_flag_override"
@@ -6570,10 +6584,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
6570
6584
  borderVisibilityOverrideFlag,
6571
6585
  rowHeightArr,
6572
6586
  columnWidthArr,
6573
- tableStyleId: "",
6574
- // TODO: Set the correct value
6575
- blockRecordHandle: 0,
6576
- // TODO: Set the correct value
6587
+ tableStyleId,
6588
+ blockRecordHandle,
6577
6589
  cells: this.convertTableCells(cells),
6578
6590
  bmpPreview: ""
6579
6591
  };
@@ -7123,7 +7135,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
7123
7135
  const explodability = libredwg.dwg_dynapi_entity_value(item, "explodable").data;
7124
7136
  const scalability = libredwg.dwg_dynapi_entity_value(item, "block_scaling").data;
7125
7137
  const layout_ptr = libredwg.dwg_dynapi_entity_value(item, "layout").data;
7126
- const layout = libredwg.dwg_ref_get_absref(layout_ptr);
7138
+ const layout = idToString(libredwg.dwg_ref_get_absref(layout_ptr));
7127
7139
  let bmpPreview = "";
7128
7140
  const uint8ArrayToHexString = (bytes) => {
7129
7141
  const hexChars = new Array(bytes.length);
@@ -181,7 +181,7 @@ export class LibreDwgConverter {
181
181
  .data;
182
182
  const layout_ptr = libredwg.dwg_dynapi_entity_value(item, 'layout')
183
183
  .data;
184
- const layout = libredwg.dwg_ref_get_absref(layout_ptr);
184
+ const layout = idToString(libredwg.dwg_ref_get_absref(layout_ptr));
185
185
  let bmpPreview = '';
186
186
  const uint8ArrayToHexString = (bytes) => {
187
187
  const hexChars = new Array(bytes.length);
@@ -589,9 +589,9 @@ export class LibreEntityConverter {
589
589
  const clippingBoundaryPath = libredwg.dwg_ptr_to_point3d_array(clip_verts, countBoundaryPoints);
590
590
  const imagedef_ref = libredwg.dwg_dynapi_entity_value(entity, 'imagedef')
591
591
  .data;
592
- const imageDefHandle = libredwg.dwg_ref_get_absref(imagedef_ref);
592
+ const imageDefHandle = idToString(libredwg.dwg_ref_get_absref(imagedef_ref));
593
593
  const imagedefreactor_ref = libredwg.dwg_dynapi_entity_value(entity, 'imagedefreactor').data;
594
- const imageDefReactorHandle = libredwg.dwg_ref_get_absref(imagedefreactor_ref);
594
+ const imageDefReactorHandle = idToString(libredwg.dwg_ref_get_absref(imagedefreactor_ref));
595
595
  return {
596
596
  type: 'IMAGE',
597
597
  ...commonAttrs,
@@ -1192,6 +1192,10 @@ export class LibreEntityConverter {
1192
1192
  const rowHeightArr = libredwg.dwg_ptr_to_double_array(row_heights_ptr, rowCount);
1193
1193
  const col_widths_ptr = libredwg.dwg_dynapi_entity_value(entity, 'col_widths').data;
1194
1194
  const columnWidthArr = libredwg.dwg_ptr_to_double_array(col_widths_ptr, columnCount);
1195
+ const table_style_ref = libredwg.dwg_dynapi_entity_value(entity, 'tablestyle').data;
1196
+ const tableStyleId = idToString(libredwg.dwg_ref_get_absref(table_style_ref));
1197
+ const block_header_ref = libredwg.dwg_dynapi_entity_value(entity, 'block_header').data;
1198
+ const blockRecordHandle = idToString(libredwg.dwg_ref_get_absref(block_header_ref));
1195
1199
  const overrideFlag = libredwg.dwg_dynapi_entity_value(entity, 'table_flag_override').data;
1196
1200
  const borderColorOverrideFlag = libredwg.dwg_dynapi_entity_value(entity, 'border_color_overrides_flag').data;
1197
1201
  const borderLineWeightOverrideFlag = libredwg.dwg_dynapi_entity_value(entity, 'border_lineweight_overrides_flag').data;
@@ -1217,8 +1221,8 @@ export class LibreEntityConverter {
1217
1221
  borderVisibilityOverrideFlag: borderVisibilityOverrideFlag,
1218
1222
  rowHeightArr: rowHeightArr,
1219
1223
  columnWidthArr: columnWidthArr,
1220
- tableStyleId: '', // TODO: Set the correct value
1221
- blockRecordHandle: 0, // TODO: Set the correct value
1224
+ tableStyleId: tableStyleId,
1225
+ blockRecordHandle: blockRecordHandle,
1222
1226
  cells: this.convertTableCells(cells),
1223
1227
  bmpPreview: ''
1224
1228
  };
@@ -21,13 +21,13 @@ export interface DwgImageEntity extends DwgEntity {
21
21
  uPixel: DwgPoint3D;
22
22
  vPixel: DwgPoint3D;
23
23
  imageSize: DwgPoint2D;
24
- imageDefHandle: number;
24
+ imageDefHandle: string;
25
25
  flags: DwgImageFlags;
26
26
  clipping: number;
27
27
  brightness: number;
28
28
  contrast: number;
29
29
  fade: number;
30
- imageDefReactorHandle: number;
30
+ imageDefReactorHandle: string;
31
31
  clippingBoundaryType: DwgImageClippingBoundaryType;
32
32
  countBoundaryPoints: number;
33
33
  clippingBoundaryPath: DwgPoint3D[];
@@ -44,7 +44,7 @@ export interface DwgTableEntity extends DwgEntity {
44
44
  rowHeightArr: number[];
45
45
  columnWidthArr: number[];
46
46
  tableStyleId?: string;
47
- blockRecordHandle?: number;
47
+ blockRecordHandle?: string;
48
48
  cells: DwgTableCell[];
49
49
  bmpPreview: string;
50
50
  }
@@ -29,7 +29,7 @@ export interface DwgBlockRecordTableEntry extends DwgCommonTableEntry {
29
29
  /**
30
30
  * Hard-pointer ID/handle to associated LAYOUT object
31
31
  */
32
- layout: number;
32
+ layout: string;
33
33
  /**
34
34
  * Block insertion units.
35
35
  */
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "A DWG/DXF JavaScript parser based on libredwg",
4
4
  "license": "GPL-2.0-only",
5
5
  "private": false,
6
- "version": "0.6.1",
6
+ "version": "0.6.2",
7
7
  "author": "MLight Lee <mlight.lee@outlook.com>",
8
8
  "type": "module",
9
9
  "repository": {