@design-core/core 0.0.7 → 51.1.0

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 (117) hide show
  1. package/.github/workflows/DesignCoreQA.yml +3 -0
  2. package/core/designCore.js +1 -1
  3. package/core/dimensions/alignedDimension.js +7 -7
  4. package/core/dimensions/angularDimension.js +32 -32
  5. package/core/dimensions/{baseCircularDimension.js → circularDimensionBase.js} +19 -19
  6. package/core/dimensions/diametricDimension.js +10 -10
  7. package/core/dimensions/dimension.js +42 -42
  8. package/core/dimensions/{baseDimension.js → dimensionBase.js} +17 -17
  9. package/core/dimensions/{baseLinearDimension.js → linearDimensionBase.js} +9 -9
  10. package/core/dimensions/radialDimension.js +8 -8
  11. package/core/dimensions/rotatedDimension.js +8 -8
  12. package/core/entities/arc.js +22 -22
  13. package/core/entities/arctext.js +13 -13
  14. package/core/entities/circle.js +7 -7
  15. package/core/entities/hatch.js +210 -40
  16. package/core/entities/insert.js +11 -6
  17. package/core/entities/point.js +19 -19
  18. package/core/entities/polyline.js +3 -3
  19. package/core/entities/{basePolyline.js → polylineBase.js} +18 -18
  20. package/core/entities/text.js +4 -4
  21. package/core/lib/boundingBox.js +11 -11
  22. package/core/lib/canvas.js +13 -6
  23. package/core/lib/clipboard.js +2 -2
  24. package/core/lib/dxf/dxf.js +11 -11
  25. package/core/lib/dxf/dxfIterator.js +2 -2
  26. package/core/lib/entityManager.js +19 -19
  27. package/core/lib/inputManager.js +1 -1
  28. package/core/lib/matrix.js +1 -1
  29. package/core/lib/patterns.js +1 -1
  30. package/core/lib/polylineUtils.js +9 -9
  31. package/core/lib/renderers/cairoRenderer.js +5 -5
  32. package/core/lib/renderers/canvasRenderer.js +4 -4
  33. package/core/lib/renderers/pdfRenderer.js +7 -7
  34. package/core/lib/renderers/rendererBase.js +1 -1
  35. package/core/lib/scene.js +1 -1
  36. package/core/lib/selectionManager.js +18 -18
  37. package/core/lib/utils.js +5 -5
  38. package/core/properties/entityProperties.js +2 -1
  39. package/core/properties/flags.js +12 -0
  40. package/core/properties/property.js +8 -3
  41. package/core/properties/propertyManager.js +52 -37
  42. package/core/tables/block.js +50 -46
  43. package/core/tables/dimStyle.js +5 -5
  44. package/core/tables/ltypeManager.js +1 -1
  45. package/core/tables/vport.js +2 -2
  46. package/core/tools/chamfer.js +6 -6
  47. package/core/tools/chamferFilletBase.js +4 -4
  48. package/core/tools/copy.js +8 -8
  49. package/core/tools/copybase.js +3 -3
  50. package/core/tools/copyclip.js +3 -3
  51. package/core/tools/cornerEntity.js +2 -2
  52. package/core/tools/cutclip.js +3 -3
  53. package/core/tools/explode.js +6 -6
  54. package/core/tools/extend.js +13 -13
  55. package/core/tools/fillet.js +6 -6
  56. package/core/tools/matchProp.js +1 -1
  57. package/core/tools/mirror.js +11 -11
  58. package/core/tools/move.js +5 -5
  59. package/core/tools/offset.js +29 -29
  60. package/core/tools/purge.js +10 -10
  61. package/core/tools/rotate.js +16 -16
  62. package/core/tools/scale.js +6 -6
  63. package/core/tools/trim.js +15 -15
  64. package/cspell.json +323 -0
  65. package/package.json +1 -1
  66. package/test/dimensions/alignedDimension.test.js +3 -3
  67. package/test/dimensions/angularDimension.test.js +7 -7
  68. package/test/dimensions/diametricDimension.test.js +9 -9
  69. package/test/dimensions/dimension.test.js +12 -12
  70. package/test/dimensions/{baseDimension.test.js → dimensionBase.test.js} +12 -12
  71. package/test/dimensions/{baseLinearDimension.test.js → linearDimensionBase.test.js} +7 -7
  72. package/test/dimensions/radialDimension.test.js +9 -9
  73. package/test/dimensions/rotatedDimension.test.js +4 -4
  74. package/test/entities/arc.test.js +10 -10
  75. package/test/entities/arctext.test.js +6 -6
  76. package/test/entities/circle.test.js +18 -18
  77. package/test/entities/hatch.test.js +362 -39
  78. package/test/entities/insert.test.js +9 -9
  79. package/test/entities/point.test.js +3 -3
  80. package/test/entities/{basePolyline.test.js → polylineBase.test.js} +131 -62
  81. package/test/entities/text.test.js +19 -19
  82. package/test/integration/exportIntegration.test.js +3 -3
  83. package/test/integration/userInputIntegration.test.js +5 -5
  84. package/test/lib/boundingBox.test.js +3 -3
  85. package/test/lib/canvas.test.js +9 -9
  86. package/test/lib/clipboard.test.js +73 -0
  87. package/test/lib/inputManager.test.js +4 -4
  88. package/test/lib/scene.test.js +9 -9
  89. package/test/lib/selectionManager.test.js +3 -3
  90. package/test/lib/snapping.test.js +1 -1
  91. package/test/properties/flags.test.js +24 -0
  92. package/test/properties/propertyManager.test.js +93 -22
  93. package/test/renderers/pdfRenderer.test.js +2 -2
  94. package/test/tables/block.test.js +63 -14
  95. package/test/tables/layerManager.test.js +2 -2
  96. package/test/test-helpers/hatchGridRenderer.js +3 -3
  97. package/test/test-helpers/test-helpers.js +6 -6
  98. package/test/tools/chamfer.test.js +60 -60
  99. package/test/tools/chamferFilletBase.test.js +36 -36
  100. package/test/tools/copy.test.js +6 -6
  101. package/test/tools/copybase.test.js +2 -2
  102. package/test/tools/copyclip.test.js +2 -2
  103. package/test/tools/cornerEntity.test.js +8 -8
  104. package/test/tools/cutclip.test.js +2 -2
  105. package/test/tools/erase.test.js +6 -6
  106. package/test/tools/explode.test.js +2 -2
  107. package/test/tools/extend.test.js +84 -84
  108. package/test/tools/fillet.test.js +62 -62
  109. package/test/tools/matchProp.test.js +6 -6
  110. package/test/tools/mirror.test.js +26 -26
  111. package/test/tools/move.test.js +7 -7
  112. package/test/tools/offset.test.js +65 -65
  113. package/test/tools/purge.test.js +4 -4
  114. package/test/tools/rotate.test.js +10 -10
  115. package/test/tools/scale.test.js +28 -28
  116. package/test/tools/trim.test.js +109 -109
  117. package/test/tools/zoom.test.js +15 -17
@@ -17,8 +17,8 @@ test('Fillet.register returns correct command object', () => {
17
17
 
18
18
  test('Fillet.execute selects two entities and calls executeCommand', async () => {
19
19
  core.scene.clear();
20
- core.scene.addItem('Line', { points: [new Point(0, 0), new Point(10, 0)] });
21
- core.scene.addItem('Line', { points: [new Point(5, -5), new Point(5, 5)] });
20
+ core.scene.addEntity('Line', { points: [new Point(0, 0), new Point(10, 0)] });
21
+ core.scene.addEntity('Line', { points: [new Point(5, -5), new Point(5, 5)] });
22
22
 
23
23
  const executeCommandSpy = jest.fn();
24
24
 
@@ -45,7 +45,7 @@ test('Fillet.execute returns early when first input is undefined', async () => {
45
45
 
46
46
  test('Fillet.action does nothing when entities are not set', () => {
47
47
  core.scene.clear();
48
- core.scene.addItem('Line', { points: [new Point(0, 0), new Point(10, 0)] });
48
+ core.scene.addEntity('Line', { points: [new Point(0, 0), new Point(10, 0)] });
49
49
  const entityCountBefore = core.scene.entities.count();
50
50
 
51
51
  const fillet = new Fillet();
@@ -56,8 +56,8 @@ test('Fillet.action does nothing when entities are not set', () => {
56
56
 
57
57
  test('Fillet.action notifies when entity type is not supported', () => {
58
58
  core.scene.clear();
59
- core.scene.addItem('Circle', { points: [new Point(0, 0), new Point(5, 0)] });
60
- core.scene.addItem('Line', { points: [new Point(0, 0), new Point(10, 0)] });
59
+ core.scene.addEntity('Circle', { points: [new Point(0, 0), new Point(5, 0)] });
60
+ core.scene.addEntity('Line', { points: [new Point(0, 0), new Point(10, 0)] });
61
61
 
62
62
  const notifySpy = jest.spyOn(core, 'notify');
63
63
 
@@ -75,8 +75,8 @@ test('Fillet.action notifies when entity type is not supported', () => {
75
75
  test('Fillet.action notifies for parallel lines', () => {
76
76
  core.scene.clear();
77
77
  // Two horizontal parallel lines
78
- core.scene.addItem('Line', { points: [new Point(0, 0), new Point(10, 0)] });
79
- core.scene.addItem('Line', { points: [new Point(0, 5), new Point(10, 5)] });
78
+ core.scene.addEntity('Line', { points: [new Point(0, 0), new Point(10, 0)] });
79
+ core.scene.addEntity('Line', { points: [new Point(0, 5), new Point(10, 5)] });
80
80
 
81
81
  const notifySpy = jest.spyOn(core, 'notify');
82
82
 
@@ -98,8 +98,8 @@ test('Fillet.action radius=0 trimMode=true trims both lines to intersection', ()
98
98
  // Horizontal: (0,0)→(8,0), Vertical: (10,-10)→(10,-2)
99
99
  // Their infinite extensions meet at (10, 0).
100
100
  core.scene.clear();
101
- core.scene.addItem('Line', { points: [new Point(0, 0), new Point(8, 0)] });
102
- core.scene.addItem('Line', { points: [new Point(10, -10), new Point(10, -2)] });
101
+ core.scene.addEntity('Line', { points: [new Point(0, 0), new Point(8, 0)] });
102
+ core.scene.addEntity('Line', { points: [new Point(10, -10), new Point(10, -2)] });
103
103
 
104
104
  core.scene.headers.filletRadius = 0;
105
105
  core.scene.headers.trimMode = true;
@@ -129,8 +129,8 @@ test('Fillet.action radius=0 trimMode=true trims both lines to intersection', ()
129
129
 
130
130
  test('Fillet.action radius=0 trimMode=false makes no changes', () => {
131
131
  core.scene.clear();
132
- core.scene.addItem('Line', { points: [new Point(0, 0), new Point(8, 0)] });
133
- core.scene.addItem('Line', { points: [new Point(10, -10), new Point(10, -2)] });
132
+ core.scene.addEntity('Line', { points: [new Point(0, 0), new Point(8, 0)] });
133
+ core.scene.addEntity('Line', { points: [new Point(10, -10), new Point(10, -2)] });
134
134
 
135
135
  core.scene.headers.filletRadius = 0;
136
136
  core.scene.headers.trimMode = false;
@@ -153,8 +153,8 @@ test('Fillet.action radius>0 trimMode=true adds arc and trims lines', () => {
153
153
  // Horizontal: (-10,0)→(0,0) Vertical: (0,0)→(0,10)
154
154
  // With radius 2, tangent points are at (-2,0) and (0,2)
155
155
  core.scene.clear();
156
- core.scene.addItem('Line', { points: [new Point(-10, 0), new Point(0, 0)] });
157
- core.scene.addItem('Line', { points: [new Point(0, 0), new Point(0, 10)] });
156
+ core.scene.addEntity('Line', { points: [new Point(-10, 0), new Point(0, 0)] });
157
+ core.scene.addEntity('Line', { points: [new Point(0, 0), new Point(0, 10)] });
158
158
 
159
159
  core.scene.headers.filletRadius = 2;
160
160
  core.scene.headers.trimMode = true;
@@ -190,8 +190,8 @@ test('Fillet.action radius>0 trimMode=true adds arc and trims lines', () => {
190
190
 
191
191
  test('Fillet.action radius>0 trimMode=false adds arc only, lines unchanged', () => {
192
192
  core.scene.clear();
193
- core.scene.addItem('Line', { points: [new Point(-10, 0), new Point(0, 0)] });
194
- core.scene.addItem('Line', { points: [new Point(0, 0), new Point(0, 10)] });
193
+ core.scene.addEntity('Line', { points: [new Point(-10, 0), new Point(0, 0)] });
194
+ core.scene.addEntity('Line', { points: [new Point(0, 0), new Point(0, 10)] });
195
195
 
196
196
  core.scene.headers.filletRadius = 2;
197
197
  core.scene.headers.trimMode = false;
@@ -217,8 +217,8 @@ test('Fillet.action radius>0 trimMode=false adds arc only, lines unchanged', ()
217
217
  test('Fillet.action notifies when radius is too large for the segments', () => {
218
218
  // Lines only 5 units long from intersection — radius 10 won't fit
219
219
  core.scene.clear();
220
- core.scene.addItem('Line', { points: [new Point(-5, 0), new Point(0, 0)] });
221
- core.scene.addItem('Line', { points: [new Point(0, 0), new Point(0, 5)] });
220
+ core.scene.addEntity('Line', { points: [new Point(-5, 0), new Point(0, 0)] });
221
+ core.scene.addEntity('Line', { points: [new Point(0, 0), new Point(0, 5)] });
222
222
 
223
223
  core.scene.headers.filletRadius = 10;
224
224
  core.scene.headers.trimMode = true;
@@ -241,8 +241,8 @@ test('Fillet.action notifies when radius is too large for the segments', () => {
241
241
  test('Fillet.action arc centre is at correct position for 90° corner', () => {
242
242
  // 90° corner at origin, radius 3 → arc centre at (-3, 3)
243
243
  core.scene.clear();
244
- core.scene.addItem('Line', { points: [new Point(-10, 0), new Point(0, 0)] });
245
- core.scene.addItem('Line', { points: [new Point(0, 0), new Point(0, 10)] });
244
+ core.scene.addEntity('Line', { points: [new Point(-10, 0), new Point(0, 0)] });
245
+ core.scene.addEntity('Line', { points: [new Point(0, 0), new Point(0, 10)] });
246
246
 
247
247
  core.scene.headers.filletRadius = 3;
248
248
  core.scene.headers.trimMode = false;
@@ -272,8 +272,8 @@ test('Fillet.action selects correct corner when lines form a cross', () => {
272
272
  // Full cross: horizontal (-10,0)→(10,0), vertical (0,-10)→(0,10)
273
273
  // Click on the top-right quadrant → fillet should be in that quadrant
274
274
  core.scene.clear();
275
- core.scene.addItem('Line', { points: [new Point(-10, 0), new Point(10, 0)] });
276
- core.scene.addItem('Line', { points: [new Point(0, -10), new Point(0, 10)] });
275
+ core.scene.addEntity('Line', { points: [new Point(-10, 0), new Point(10, 0)] });
276
+ core.scene.addEntity('Line', { points: [new Point(0, -10), new Point(0, 10)] });
277
277
 
278
278
  core.scene.headers.filletRadius = 2;
279
279
  core.scene.headers.trimMode = false;
@@ -297,8 +297,8 @@ test('Fillet.action selects correct corner when lines form a cross', () => {
297
297
 
298
298
  test('Fillet.action notifies when second entity type is not supported', () => {
299
299
  core.scene.clear();
300
- core.scene.addItem('Line', { points: [new Point(0, 0), new Point(10, 0)] });
301
- core.scene.addItem('Circle', { points: [new Point(0, 0), new Point(5, 0)] });
300
+ core.scene.addEntity('Line', { points: [new Point(0, 0), new Point(10, 0)] });
301
+ core.scene.addEntity('Circle', { points: [new Point(0, 0), new Point(5, 0)] });
302
302
 
303
303
  const notifySpy = jest.spyOn(core, 'notify');
304
304
 
@@ -319,8 +319,8 @@ test('Fillet.action notifies when click coincides with intersection', () => {
319
319
  // L-corner at origin. Clicking firstClickPoint exactly at (0,0) makes
320
320
  // firstClickDistance = 0, triggering the invalid-selection guard.
321
321
  core.scene.clear();
322
- core.scene.addItem('Line', { points: [new Point(-10, 0), new Point(0, 0)] });
323
- core.scene.addItem('Line', { points: [new Point(0, 0), new Point(0, 10)] });
322
+ core.scene.addEntity('Line', { points: [new Point(-10, 0), new Point(0, 0)] });
323
+ core.scene.addEntity('Line', { points: [new Point(0, 0), new Point(0, 10)] });
324
324
 
325
325
  core.scene.headers.filletRadius = 2;
326
326
  core.scene.headers.trimMode = true;
@@ -343,8 +343,8 @@ test('Fillet.action radius=0 notifies and makes no changes when click coincides
343
343
  // Click at exactly the intersection point — clickDistance = 0.
344
344
  // The guard must fire before applySharpTrim() runs.
345
345
  core.scene.clear();
346
- core.scene.addItem('Line', { points: [new Point(-10, 0), new Point(0, 0)] });
347
- core.scene.addItem('Line', { points: [new Point(0, 0), new Point(0, 10)] });
346
+ core.scene.addEntity('Line', { points: [new Point(-10, 0), new Point(0, 0)] });
347
+ core.scene.addEntity('Line', { points: [new Point(0, 0), new Point(0, 10)] });
348
348
 
349
349
  core.scene.headers.filletRadius = 0;
350
350
  core.scene.headers.trimMode = true;
@@ -415,7 +415,7 @@ test('Fillet.execute sets trimMode to false when No trim option is selected', as
415
415
 
416
416
  test('Fillet.execute re-prompts and notifies when first selected entity is not a Line', async () => {
417
417
  core.scene.clear();
418
- core.scene.addItem('Circle', { points: [new Point(0, 0), new Point(5, 0)] });
418
+ core.scene.addEntity('Circle', { points: [new Point(0, 0), new Point(5, 0)] });
419
419
 
420
420
  const notifySpy = jest.spyOn(core, 'notify');
421
421
 
@@ -434,8 +434,8 @@ test('Fillet.execute re-prompts and notifies when first selected entity is not a
434
434
 
435
435
  test('Fillet.execute re-prompts and notifies when second selected entity is not a Line', async () => {
436
436
  core.scene.clear();
437
- core.scene.addItem('Line', { points: [new Point(-10, 0), new Point(10, 0)] });
438
- core.scene.addItem('Circle', { points: [new Point(0, 0), new Point(5, 0)] });
437
+ core.scene.addEntity('Line', { points: [new Point(-10, 0), new Point(10, 0)] });
438
+ core.scene.addEntity('Circle', { points: [new Point(0, 0), new Point(5, 0)] });
439
439
 
440
440
  const notifySpy = jest.spyOn(core, 'notify');
441
441
 
@@ -466,8 +466,8 @@ test('Fillet.execute re-prompts and notifies when second selected entity is not
466
466
  test('Fillet.action radius>0 trimMode=true Line first + Lwpolyline second keepStart: arc embedded as bulge', () => {
467
467
  // Click polyline near (-15,0) → segment 1. keepStart keeps the start portion.
468
468
  core.scene.clear();
469
- core.scene.addItem('Line', { points: [new Point(0, 0), new Point(0, 10)] });
470
- core.scene.addItem('Lwpolyline', { points: [new Point(-20, 0), new Point(-10, 0), new Point(0, 0), new Point(10, 0)] });
469
+ core.scene.addEntity('Line', { points: [new Point(0, 0), new Point(0, 10)] });
470
+ core.scene.addEntity('Lwpolyline', { points: [new Point(-20, 0), new Point(-10, 0), new Point(0, 0), new Point(10, 0)] });
471
471
 
472
472
  core.scene.headers.filletRadius = 2;
473
473
  core.scene.headers.trimMode = true;
@@ -507,8 +507,8 @@ test('Fillet.action radius>0 trimMode=true Line first + Lwpolyline second keepSt
507
507
  test('Fillet.action radius>0 trimMode=true Lwpolyline first + Line second keepStart: arc direction correct', () => {
508
508
  // Same geometry but entity order reversed — tests the polyToLineDir arc direction fix.
509
509
  core.scene.clear();
510
- core.scene.addItem('Lwpolyline', { points: [new Point(-20, 0), new Point(-10, 0), new Point(0, 0), new Point(10, 0)] });
511
- core.scene.addItem('Line', { points: [new Point(0, 0), new Point(0, 10)] });
510
+ core.scene.addEntity('Lwpolyline', { points: [new Point(-20, 0), new Point(-10, 0), new Point(0, 0), new Point(10, 0)] });
511
+ core.scene.addEntity('Line', { points: [new Point(0, 0), new Point(0, 10)] });
512
512
 
513
513
  core.scene.headers.filletRadius = 2;
514
514
  core.scene.headers.trimMode = true;
@@ -548,8 +548,8 @@ test('Fillet.action radius>0 trimMode=true Line + Lwpolyline keepEnd: keeps end
548
548
  // Click polyline near (8,0) → segment 3 (right of intersection). keepEnd.
549
549
  // arc centre = (2,2), polyTangent = (2,0), lineTangent = (0,2).
550
550
  core.scene.clear();
551
- core.scene.addItem('Line', { points: [new Point(0, 0), new Point(0, 10)] });
552
- core.scene.addItem('Lwpolyline', { points: [new Point(-20, 0), new Point(-10, 0), new Point(0, 0), new Point(10, 0)] });
551
+ core.scene.addEntity('Line', { points: [new Point(0, 0), new Point(0, 10)] });
552
+ core.scene.addEntity('Lwpolyline', { points: [new Point(-20, 0), new Point(-10, 0), new Point(0, 0), new Point(10, 0)] });
553
553
 
554
554
  core.scene.headers.filletRadius = 2;
555
555
  core.scene.headers.trimMode = true;
@@ -589,8 +589,8 @@ test('Fillet.action radius>0 trimMode=true Line + Lwpolyline keepEnd: keeps end
589
589
  test('Fillet.action radius=0 trimMode=true Line + Lwpolyline keepStart: line consumed to sharp corner', () => {
590
590
  // radius=0 → sharp intersection at (0,0), no arc.
591
591
  core.scene.clear();
592
- core.scene.addItem('Line', { points: [new Point(0, 0), new Point(0, 10)] });
593
- core.scene.addItem('Lwpolyline', { points: [new Point(-20, 0), new Point(-10, 0), new Point(0, 0), new Point(10, 0)] });
592
+ core.scene.addEntity('Line', { points: [new Point(0, 0), new Point(0, 10)] });
593
+ core.scene.addEntity('Lwpolyline', { points: [new Point(-20, 0), new Point(-10, 0), new Point(0, 0), new Point(10, 0)] });
594
594
 
595
595
  core.scene.headers.filletRadius = 0;
596
596
  core.scene.headers.trimMode = true;
@@ -629,7 +629,7 @@ test('Fillet.action radius>0 trimMode=true same Lwpolyline consecutive segments:
629
629
  // Segment 1: (-10,0)→(0,0), Segment 2: (0,0)→(0,10). Corner at (0,0).
630
630
  // radius=2 → arc centre (-2,2), tangents at (-2,0) and (0,2).
631
631
  core.scene.clear();
632
- core.scene.addItem('Lwpolyline', { points: [new Point(-10, 0), new Point(0, 0), new Point(0, 10)] });
632
+ core.scene.addEntity('Lwpolyline', { points: [new Point(-10, 0), new Point(0, 0), new Point(0, 10)] });
633
633
 
634
634
  core.scene.headers.filletRadius = 2;
635
635
  core.scene.headers.trimMode = true;
@@ -671,7 +671,7 @@ test('Fillet.action radius>0 trimMode=true same Lwpolyline open ends: separate A
671
671
  // radius=2, clicks at (-3,0) and (1,3):
672
672
  // arc centre = (-1,2), firstTangent = (-1,0), secondTangent = (1,2).
673
673
  core.scene.clear();
674
- core.scene.addItem('Lwpolyline', { points: [new Point(-5, 0), new Point(0, 0), new Point(1, 0), new Point(1, 5)] });
674
+ core.scene.addEntity('Lwpolyline', { points: [new Point(-5, 0), new Point(0, 0), new Point(1, 0), new Point(1, 5)] });
675
675
 
676
676
  core.scene.headers.filletRadius = 2;
677
677
  core.scene.headers.trimMode = true;
@@ -713,7 +713,7 @@ test('Fillet.action radius>0 trimMode=true closed Lwpolyline seg3+closing-seg: c
713
713
  // Closing segment (idx=4) goes (0,10)→(0,0); seg 3 goes (10,10)→(0,10).
714
714
  // Corner at (0,10) — radius=2 replaces the shared vertex with arc bulge points.
715
715
  core.scene.clear();
716
- core.scene.addItem('Lwpolyline', { points: [new Point(0, 0), new Point(10, 0), new Point(10, 10), new Point(0, 10)] });
716
+ core.scene.addEntity('Lwpolyline', { points: [new Point(0, 0), new Point(10, 0), new Point(10, 10), new Point(0, 10)] });
717
717
  const polyEntity = core.scene.entities.get(0);
718
718
  polyEntity.flags.setFlagValue(1);
719
719
 
@@ -745,7 +745,7 @@ test('Fillet.action radius>0 trimMode=true closed Lwpolyline closing-wrap (seg4+
745
745
  // Corner at (0,0) shared by closing seg (idx=4) and seg 1.
746
746
  // Bug: without the closed-poly guard, this was treated as open-ends → wrong path.
747
747
  core.scene.clear();
748
- core.scene.addItem('Lwpolyline', { points: [new Point(0, 0), new Point(10, 0), new Point(10, 10), new Point(0, 10)] });
748
+ core.scene.addEntity('Lwpolyline', { points: [new Point(0, 0), new Point(10, 0), new Point(10, 10), new Point(0, 10)] });
749
749
  const polyEntity = core.scene.entities.get(0);
750
750
  polyEntity.flags.setFlagValue(1);
751
751
 
@@ -777,7 +777,7 @@ test('Fillet.action radius>0 trimMode=true closed Lwpolyline closing-wrap (seg4+
777
777
  test('Fillet.action radius>0 trimMode=false closed Lwpolyline closing-wrap: standalone Arc only', () => {
778
778
  // trimMode=false: no polyline mutation; only Arc entity added.
779
779
  core.scene.clear();
780
- core.scene.addItem('Lwpolyline', { points: [new Point(0, 0), new Point(10, 0), new Point(10, 10), new Point(0, 10)] });
780
+ core.scene.addEntity('Lwpolyline', { points: [new Point(0, 0), new Point(10, 0), new Point(10, 10), new Point(0, 10)] });
781
781
  const polyEntity = core.scene.entities.get(0);
782
782
  polyEntity.flags.setFlagValue(1);
783
783
 
@@ -803,8 +803,8 @@ test('Fillet.action radius>0 trimMode=false closed Lwpolyline closing-wrap: stan
803
803
 
804
804
  test('Fillet.action radius>0 trimMode=false Line + Lwpolyline: standalone arc added, entities unchanged', () => {
805
805
  core.scene.clear();
806
- core.scene.addItem('Line', { points: [new Point(0, 0), new Point(0, 10)] });
807
- core.scene.addItem('Lwpolyline', { points: [new Point(-20, 0), new Point(-10, 0), new Point(0, 0), new Point(10, 0)] });
806
+ core.scene.addEntity('Line', { points: [new Point(0, 0), new Point(0, 10)] });
807
+ core.scene.addEntity('Lwpolyline', { points: [new Point(-20, 0), new Point(-10, 0), new Point(0, 0), new Point(10, 0)] });
808
808
 
809
809
  core.scene.headers.filletRadius = 2;
810
810
  core.scene.headers.trimMode = false;
@@ -843,14 +843,14 @@ test('Fillet.action radius>0 trimMode=false Line + Lwpolyline: standalone arc ad
843
843
  // – lowerTangent = (0,2) on the closing segment (left edge, y=2)
844
844
  // – upperTangent = (2,0) on segment 1 (bottom edge, x=2)
845
845
  // – bulge on lowerTangent must be POSITIVE (CCW arc from (0,2) to (2,0) through ≈(0.59,0.59))
846
- // (BasePolyline convention: –ve bulge = CW, +ve bulge = CCW)
846
+ // (PolylineBase convention: –ve bulge = CW, +ve bulge = CCW)
847
847
  //
848
848
  // Before the fix the lowerTangent/upperTangent assignment was inverted, producing
849
849
  // an arc that traversed the exterior of the square.
850
850
 
851
851
  test('Fillet.action closing-wrap: lowerTangent is on closing segment (left edge)', () => {
852
852
  core.scene.clear();
853
- core.scene.addItem('Lwpolyline', { points: [new Point(0, 0), new Point(10, 0), new Point(10, 10), new Point(0, 10)] });
853
+ core.scene.addEntity('Lwpolyline', { points: [new Point(0, 0), new Point(10, 0), new Point(10, 10), new Point(0, 10)] });
854
854
  const polyEntity = core.scene.entities.get(0);
855
855
  polyEntity.flags.setFlagValue(1);
856
856
 
@@ -889,7 +889,7 @@ test('Fillet.action closing-wrap: arc bulge sign is positive (CCW, fillet inside
889
889
  // Before the fix the lowerTangent/upperTangent were swapped, producing an arc
890
890
  // that traversed the exterior of the square.
891
891
  core.scene.clear();
892
- core.scene.addItem('Lwpolyline', { points: [new Point(0, 0), new Point(10, 0), new Point(10, 10), new Point(0, 10)] });
892
+ core.scene.addEntity('Lwpolyline', { points: [new Point(0, 0), new Point(10, 0), new Point(10, 10), new Point(0, 10)] });
893
893
  const polyEntity = core.scene.entities.get(0);
894
894
  polyEntity.flags.setFlagValue(1);
895
895
 
@@ -915,7 +915,7 @@ test('Fillet.action closing-wrap: arc bulge sign is positive (CCW, fillet inside
915
915
  test('Fillet.action closing-wrap reversed pick order: arc bulge sign and tangent positions are correct', () => {
916
916
  // Swap firstPick/secondPick — should produce the same geometry.
917
917
  core.scene.clear();
918
- core.scene.addItem('Lwpolyline', { points: [new Point(0, 0), new Point(10, 0), new Point(10, 10), new Point(0, 10)] });
918
+ core.scene.addEntity('Lwpolyline', { points: [new Point(0, 0), new Point(10, 0), new Point(10, 10), new Point(0, 10)] });
919
919
  const polyEntity = core.scene.entities.get(0);
920
920
  polyEntity.flags.setFlagValue(1);
921
921
 
@@ -951,8 +951,8 @@ test('Fillet.action closing-wrap reversed pick order: arc bulge sign and tangent
951
951
  test('Fillet.action arc inherits layer, lineWidth, lineType from first entity', () => {
952
952
  // Perpendicular L-corner at origin; first entity on a non-default layer.
953
953
  core.scene.clear();
954
- core.scene.addItem('Line', { points: [new Point(-10, 0), new Point(0, 0)], layer: 'walls', lineWidth: 5, lineType: 'DASHED' });
955
- core.scene.addItem('Line', { points: [new Point(0, 0), new Point(0, 10)] });
954
+ core.scene.addEntity('Line', { points: [new Point(-10, 0), new Point(0, 0)], layer: 'walls', lineWidth: 5, lineType: 'DASHED' });
955
+ core.scene.addEntity('Line', { points: [new Point(0, 0), new Point(0, 10)] });
956
956
 
957
957
  core.scene.headers.filletRadius = 2;
958
958
  core.scene.headers.trimMode = false;
@@ -979,7 +979,7 @@ test('Fillet.preview does not throw', () => {
979
979
 
980
980
  test('Fillet.preview returns early when findClosestItem returns undefined', () => {
981
981
  core.scene.clear();
982
- core.scene.addItem('Line', { points: [new Point(-10, 0), new Point(0, 0)] });
982
+ core.scene.addEntity('Line', { points: [new Point(-10, 0), new Point(0, 0)] });
983
983
  DesignCore.Scene.previewEntities.clear();
984
984
 
985
985
  const fillet = new Fillet();
@@ -996,8 +996,8 @@ test('Fillet.preview returns early when findClosestItem returns undefined', () =
996
996
 
997
997
  test('Fillet.preview adds fillet arc to previewEntities in no-trim mode', () => {
998
998
  core.scene.clear();
999
- core.scene.addItem('Line', { points: [new Point(-10, 0), new Point(0, 0)] });
1000
- core.scene.addItem('Line', { points: [new Point(0, 0), new Point(0, 10)] });
999
+ core.scene.addEntity('Line', { points: [new Point(-10, 0), new Point(0, 0)] });
1000
+ core.scene.addEntity('Line', { points: [new Point(0, 0), new Point(0, 10)] });
1001
1001
  DesignCore.Scene.previewEntities.clear();
1002
1002
 
1003
1003
  core.scene.headers.filletRadius = 2;
@@ -1017,8 +1017,8 @@ test('Fillet.preview adds fillet arc to previewEntities in no-trim mode', () =>
1017
1017
 
1018
1018
  test('Fillet.preview adds dulled segments and arc to previewEntities in trim mode', () => {
1019
1019
  core.scene.clear();
1020
- core.scene.addItem('Line', { points: [new Point(-10, 0), new Point(0, 0)] });
1021
- core.scene.addItem('Line', { points: [new Point(0, 0), new Point(0, 10)] });
1020
+ core.scene.addEntity('Line', { points: [new Point(-10, 0), new Point(0, 0)] });
1021
+ core.scene.addEntity('Line', { points: [new Point(0, 0), new Point(0, 10)] });
1022
1022
  DesignCore.Scene.previewEntities.clear();
1023
1023
 
1024
1024
  core.scene.headers.filletRadius = 2;
@@ -1039,8 +1039,8 @@ test('Fillet.preview adds dulled segments and arc to previewEntities in trim mod
1039
1039
 
1040
1040
  test('Fillet.execute returns early when second-entity input is undefined (inner loop)', async () => {
1041
1041
  core.scene.clear();
1042
- core.scene.addItem('Line', { points: [new Point(-10, 0), new Point(0, 0)] });
1043
- core.scene.addItem('Line', { points: [new Point(0, 0), new Point(0, 10)] });
1042
+ core.scene.addEntity('Line', { points: [new Point(-10, 0), new Point(0, 0)] });
1043
+ core.scene.addEntity('Line', { points: [new Point(0, 0), new Point(0, 10)] });
1044
1044
 
1045
1045
  const executeCommandSpy = jest.fn();
1046
1046
  // Only one input: the first selection. Second requestInput returns undefined → inner loop returns.
@@ -1060,7 +1060,7 @@ test('Fillet.execute notifies NONCONSECUTIVESEGMENTS for non-adjacent polyline s
1060
1060
  // 5-point polyline → 4 segments. Pick segment 1 (near -15,0) then segment 3 (near 5,0).
1061
1061
  // Neither consecutive nor open-ends → NONCONSECUTIVESEGMENTS, then undefined to exit.
1062
1062
  core.scene.clear();
1063
- core.scene.addItem('Lwpolyline', { points: [new Point(-20, 0), new Point(-10, 0), new Point(0, 0), new Point(10, 0), new Point(20, 0)] });
1063
+ core.scene.addEntity('Lwpolyline', { points: [new Point(-20, 0), new Point(-10, 0), new Point(0, 0), new Point(10, 0), new Point(20, 0)] });
1064
1064
 
1065
1065
  const notifySpy = jest.spyOn(core, 'notify');
1066
1066
  await withMockInput(
@@ -1100,9 +1100,9 @@ test('Fillet.action two fillets on the same line: trimmed endpoints have bulge =
1100
1100
  // arc.toPolylinePoints() sets bulge on the start point;
1101
1101
  // that value must not bleed onto the Line endpoints.
1102
1102
  core.scene.clear();
1103
- core.scene.addItem('Line', { points: [new Point(-10, 0), new Point(10, 0)] });
1104
- core.scene.addItem('Line', { points: [new Point(-10, 2), new Point(-10, -2)] });
1105
- core.scene.addItem('Line', { points: [new Point(10, 2), new Point(10, -2)] });
1103
+ core.scene.addEntity('Line', { points: [new Point(-10, 0), new Point(10, 0)] });
1104
+ core.scene.addEntity('Line', { points: [new Point(-10, 2), new Point(-10, -2)] });
1105
+ core.scene.addEntity('Line', { points: [new Point(10, 2), new Point(10, -2)] });
1106
1106
 
1107
1107
  core.scene.headers.filletRadius = 1;
1108
1108
  core.scene.headers.trimMode = true;
@@ -8,12 +8,12 @@ import { jest } from '@jest/globals';
8
8
  const core = new Core();
9
9
 
10
10
  // Add items to scene
11
- DesignCore.Scene.addItem('Line', { points: [new Point(10, 0), new Point(20, 0)], layer: 'test' });
12
- DesignCore.Scene.addItem('Circle', { points: [new Point(10, 0), new Point(20, 0)] });
13
- DesignCore.Scene.addItem('Polyline', { points: [new Point(10, 0), new Point(20, 0)] });
14
- DesignCore.Scene.addItem('Arc', { points: [new Point(10, 0), new Point(10, 10), new Point(0, 10)] });
15
- DesignCore.Scene.addItem('Rectangle', { points: [new Point(10, 0), new Point(0, 10)] });
16
- DesignCore.Scene.addItem('Text', { points: [new Point(10, 0), new Point(0, 10)], height: 10, rotation: 0, string: 'text test' });
11
+ DesignCore.Scene.addEntity('Line', { points: [new Point(10, 0), new Point(20, 0)], layer: 'test' });
12
+ DesignCore.Scene.addEntity('Circle', { points: [new Point(10, 0), new Point(20, 0)] });
13
+ DesignCore.Scene.addEntity('Polyline', { points: [new Point(10, 0), new Point(20, 0)] });
14
+ DesignCore.Scene.addEntity('Arc', { points: [new Point(10, 0), new Point(10, 10), new Point(0, 10)] });
15
+ DesignCore.Scene.addEntity('Rectangle', { points: [new Point(10, 0), new Point(0, 10)] });
16
+ DesignCore.Scene.addEntity('Text', { points: [new Point(10, 0), new Point(0, 10)], height: 10, rotation: 0, string: 'text test' });
17
17
 
18
18
  test('Test MatchProp.execute requests source and targets and completes', async () => {
19
19
  const match = new MatchProp();
@@ -40,7 +40,7 @@ test.each(inputScenarios)('Mirror.execute handles $desc', async (scenario) => {
40
40
  core.scene.clear();
41
41
  core.scene.selectionManager.reset();
42
42
 
43
- core.scene.addItem('Line', { points });
43
+ core.scene.addEntity('Line', { points });
44
44
  core.scene.selectionManager.addToSelectionSet(0);
45
45
 
46
46
  const origInputManager = core.scene.inputManager;
@@ -72,7 +72,7 @@ test('Mirror.execute - cancel at first point does not mirror', async () => {
72
72
  core.scene.clear();
73
73
  core.scene.selectionManager.reset();
74
74
 
75
- core.scene.addItem('Line', { points: [new Point(0, 5), new Point(10, 5)] });
75
+ core.scene.addEntity('Line', { points: [new Point(0, 5), new Point(10, 5)] });
76
76
  core.scene.selectionManager.addToSelectionSet(0);
77
77
 
78
78
  const origInputManager = core.scene.inputManager;
@@ -95,7 +95,7 @@ test('Mirror.execute - cancel at second point does not mirror', async () => {
95
95
  core.scene.clear();
96
96
  core.scene.selectionManager.reset();
97
97
 
98
- core.scene.addItem('Line', { points: [new Point(0, 5), new Point(10, 5)] });
98
+ core.scene.addEntity('Line', { points: [new Point(0, 5), new Point(10, 5)] });
99
99
  core.scene.selectionManager.addToSelectionSet(0);
100
100
 
101
101
  const origInputManager = core.scene.inputManager;
@@ -124,7 +124,7 @@ test('Mirror.execute - undefined erase prompt defaults to keeping source', async
124
124
  core.scene.clear();
125
125
  core.scene.selectionManager.reset();
126
126
 
127
- core.scene.addItem('Line', { points: [new Point(0, 5), new Point(10, 5)] });
127
+ core.scene.addEntity('Line', { points: [new Point(0, 5), new Point(10, 5)] });
128
128
  core.scene.selectionManager.addToSelectionSet(0);
129
129
 
130
130
  const origInputManager = core.scene.inputManager;
@@ -156,8 +156,8 @@ test('Mirror.execute - entity count unchanged when keeping source', async () =>
156
156
  core.scene.clear();
157
157
  core.scene.selectionManager.reset();
158
158
 
159
- core.scene.addItem('Line', { points: [new Point(0, 5), new Point(10, 5)] });
160
- core.scene.addItem('Circle', { points: [new Point(0, 5), new Point(10, 5)] });
159
+ core.scene.addEntity('Line', { points: [new Point(0, 5), new Point(10, 5)] });
160
+ core.scene.addEntity('Circle', { points: [new Point(0, 5), new Point(10, 5)] });
161
161
 
162
162
  const entityCount = core.scene.entities.count();
163
163
 
@@ -192,11 +192,11 @@ test('Test Mirror.action - keep source (default)', () => {
192
192
  core.scene.selectionManager.reset();
193
193
 
194
194
  // Add entities
195
- core.scene.addItem('Line', { points: [new Point(0, 5), new Point(10, 5)] });
196
- core.scene.addItem('Circle', { points: [new Point(0, 5), new Point(10, 5)] });
197
- core.scene.addItem('Polyline', { points: [new Point(0, 5), new Point(10, 5)] });
198
- core.scene.addItem('Arc', { points: [new Point(0, 5), new Point(10, 5), new Point(5, 10)] });
199
- core.scene.addItem('Rectangle', { points: [new Point(0, 5), new Point(10, 5)] });
195
+ core.scene.addEntity('Line', { points: [new Point(0, 5), new Point(10, 5)] });
196
+ core.scene.addEntity('Circle', { points: [new Point(0, 5), new Point(10, 5)] });
197
+ core.scene.addEntity('Polyline', { points: [new Point(0, 5), new Point(10, 5)] });
198
+ core.scene.addEntity('Arc', { points: [new Point(0, 5), new Point(10, 5), new Point(5, 10)] });
199
+ core.scene.addEntity('Rectangle', { points: [new Point(0, 5), new Point(10, 5)] });
200
200
 
201
201
  const entityCount = core.scene.entities.count();
202
202
 
@@ -240,8 +240,8 @@ test('Test Mirror.action - erase source', () => {
240
240
  core.scene.clear();
241
241
  core.scene.selectionManager.reset();
242
242
 
243
- core.scene.addItem('Line', { points: [new Point(0, 5), new Point(10, 5)] });
244
- core.scene.addItem('Circle', { points: [new Point(0, 5), new Point(10, 5)] });
243
+ core.scene.addEntity('Line', { points: [new Point(0, 5), new Point(10, 5)] });
244
+ core.scene.addEntity('Circle', { points: [new Point(0, 5), new Point(10, 5)] });
245
245
 
246
246
  const entityCount = core.scene.entities.count();
247
247
 
@@ -271,7 +271,7 @@ test('Test Mirror.action - mirror across Y axis', () => {
271
271
  core.scene.clear();
272
272
  core.scene.selectionManager.reset();
273
273
 
274
- core.scene.addItem('Line', { points: [new Point(5, 0), new Point(5, 10)] });
274
+ core.scene.addEntity('Line', { points: [new Point(5, 0), new Point(5, 10)] });
275
275
 
276
276
  core.scene.selectionManager.addToSelectionSet(0);
277
277
 
@@ -294,7 +294,7 @@ test('Test Mirror.action - arc direction is reversed', () => {
294
294
  core.scene.selectionManager.reset();
295
295
 
296
296
  // CCW arc (direction = 1)
297
- core.scene.addItem('Arc', { points: [new Point(0, 5), new Point(10, 5), new Point(5, 10)], direction: 1 });
297
+ core.scene.addEntity('Arc', { points: [new Point(0, 5), new Point(10, 5), new Point(5, 10)], direction: 1 });
298
298
 
299
299
  core.scene.selectionManager.addToSelectionSet(0);
300
300
 
@@ -333,7 +333,7 @@ test('Mirror.action - zero-length mirror line does not modify entities', () => {
333
333
  core.scene.clear();
334
334
  core.scene.selectionManager.reset();
335
335
 
336
- core.scene.addItem('Line', { points: [new Point(0, 5), new Point(10, 5)] });
336
+ core.scene.addEntity('Line', { points: [new Point(0, 5), new Point(10, 5)] });
337
337
  core.scene.selectionManager.addToSelectionSet(0);
338
338
 
339
339
  const mirror = new Mirror();
@@ -353,7 +353,7 @@ test('Mirror.execute - requests selection set when none pre-selected', async ()
353
353
  core.scene.clear();
354
354
  core.scene.selectionManager.reset();
355
355
 
356
- core.scene.addItem('Line', { points: [new Point(0, 5), new Point(10, 5)] });
356
+ core.scene.addEntity('Line', { points: [new Point(0, 5), new Point(10, 5)] });
357
357
  // Intentionally do NOT add to selection set — triggers the SELECTIONSET prompt
358
358
 
359
359
  const origInputManager = core.scene.inputManager;
@@ -388,7 +388,7 @@ test('Mirror.preview - no points set, adds no temp entities', () => {
388
388
  core.scene.clear();
389
389
  core.scene.selectionManager.reset();
390
390
 
391
- core.scene.addItem('Line', { points: [new Point(0, 5), new Point(10, 5)] });
391
+ core.scene.addEntity('Line', { points: [new Point(0, 5), new Point(10, 5)] });
392
392
  core.scene.selectionManager.addToSelectionSet(0);
393
393
 
394
394
  const mirror = new Mirror();
@@ -402,7 +402,7 @@ test('Mirror.preview - one point set, draws temp mirror line using mouse positio
402
402
  core.scene.clear();
403
403
  core.scene.selectionManager.reset();
404
404
 
405
- core.scene.addItem('Line', { points: [new Point(0, 5), new Point(10, 5)] });
405
+ core.scene.addEntity('Line', { points: [new Point(0, 5), new Point(10, 5)] });
406
406
  core.scene.selectionManager.addToSelectionSet(0);
407
407
 
408
408
  const mirror = new Mirror();
@@ -417,7 +417,7 @@ test('Mirror.preview - two distinct points, draws mirror line and mirrors select
417
417
  core.scene.clear();
418
418
  core.scene.selectionManager.reset();
419
419
 
420
- core.scene.addItem('Line', { points: [new Point(0, 5), new Point(10, 5)] });
420
+ core.scene.addEntity('Line', { points: [new Point(0, 5), new Point(10, 5)] });
421
421
  core.scene.selectionManager.addToSelectionSet(0);
422
422
 
423
423
  const mirror = new Mirror();
@@ -428,8 +428,8 @@ test('Mirror.preview - two distinct points, draws mirror line and mirrors select
428
428
  // Rubber-band mirror line should exist
429
429
  expect(core.scene.auxiliaryEntities.count()).toBeGreaterThanOrEqual(1);
430
430
 
431
- // The selectedItems copy should have its points mirrored (y negated)
432
- const previewItem = core.scene.selectionManager.selectedItems[0];
431
+ // The selectedEntities copy should have its points mirrored (y negated)
432
+ const previewItem = core.scene.selectionManager.selectedEntities[0];
433
433
  expect(previewItem.points[0].y).toBeCloseTo(-5);
434
434
  });
435
435
 
@@ -437,7 +437,7 @@ test('Mirror.preview - identical points, draws line but skips mirroring selected
437
437
  core.scene.clear();
438
438
  core.scene.selectionManager.reset();
439
439
 
440
- core.scene.addItem('Line', { points: [new Point(0, 5), new Point(10, 5)] });
440
+ core.scene.addEntity('Line', { points: [new Point(0, 5), new Point(10, 5)] });
441
441
  core.scene.selectionManager.addToSelectionSet(0);
442
442
 
443
443
  const mirror = new Mirror();
@@ -449,7 +449,7 @@ test('Mirror.preview - identical points, draws line but skips mirroring selected
449
449
  expect(core.scene.auxiliaryEntities.count()).toBeGreaterThanOrEqual(1);
450
450
 
451
451
  // Selected item points should be unchanged (mirroring skipped)
452
- const previewItem = core.scene.selectionManager.selectedItems[0];
452
+ const previewItem = core.scene.selectionManager.selectedEntities[0];
453
453
  expect(previewItem.points[0].y).toBeCloseTo(5);
454
454
  });
455
455
 
@@ -458,7 +458,7 @@ test('Mirror.preview - reverses direction for entities with a direction property
458
458
  core.scene.selectionManager.reset();
459
459
 
460
460
  // Arc with CCW direction
461
- core.scene.addItem('Arc', { points: [new Point(0, 5), new Point(10, 5), new Point(5, 10)], direction: 1 });
461
+ core.scene.addEntity('Arc', { points: [new Point(0, 5), new Point(10, 5), new Point(5, 10)], direction: 1 });
462
462
  core.scene.selectionManager.addToSelectionSet(0);
463
463
 
464
464
  const mirror = new Mirror();
@@ -470,6 +470,6 @@ test('Mirror.preview - reverses direction for entities with a direction property
470
470
  expect(core.scene.entities.get(0).getProperty('direction')).toBe(1);
471
471
 
472
472
  // Preview copy has direction reversed
473
- const previewItem = core.scene.selectionManager.selectedItems[0];
473
+ const previewItem = core.scene.selectionManager.selectedEntities[0];
474
474
  expect(previewItem.getProperty('direction')).toBe(-1);
475
475
  });
@@ -40,7 +40,7 @@ test.each(inputScenarios)('Move.execute handles $desc', async (scenario) => {
40
40
  // create line
41
41
  const pointOne = new Point(10, 0);
42
42
  const pointTwo = new Point(20, 0);
43
- core.scene.addItem('Line', { points: [pointOne, pointTwo] });
43
+ core.scene.addEntity('Line', { points: [pointOne, pointTwo] });
44
44
 
45
45
  // select line
46
46
  core.scene.selectionManager.addToSelectionSet(0);
@@ -62,12 +62,12 @@ test.each(inputScenarios)('Move.execute handles $desc', async (scenario) => {
62
62
  test('Test Move.action', () => {
63
63
  // Add items to scene
64
64
  core.scene.clear();
65
- core.scene.addItem('Line', { points: [new Point(), new Point(0, 10)] });
66
- core.scene.addItem('Circle', { points: [new Point(), new Point(0, 10)] });
67
- core.scene.addItem('Polyline', { points: [new Point(), new Point(0, 10)] });
68
- core.scene.addItem('Arc', { points: [new Point(), new Point(0, 10), new Point(10, 0)] });
69
- core.scene.addItem('Rectangle', { points: [new Point(), new Point(0, 10)] });
70
- core.scene.addItem('Text', { points: [new Point(), new Point(0, 10)], height: 10, rotation: 0, string: 'text test' });
65
+ core.scene.addEntity('Line', { points: [new Point(), new Point(0, 10)] });
66
+ core.scene.addEntity('Circle', { points: [new Point(), new Point(0, 10)] });
67
+ core.scene.addEntity('Polyline', { points: [new Point(), new Point(0, 10)] });
68
+ core.scene.addEntity('Arc', { points: [new Point(), new Point(0, 10), new Point(10, 0)] });
69
+ core.scene.addEntity('Rectangle', { points: [new Point(), new Point(0, 10)] });
70
+ core.scene.addEntity('Text', { points: [new Point(), new Point(0, 10)], height: 10, rotation: 0, string: 'text test' });
71
71
 
72
72
  // Add items to selection set
73
73
  for (let i = 0; i < core.scene.entities.count(); i++) {