@contrail/documents 1.19.0-alpha.75be757 → 1.19.0-alpha.93befdf

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/CHANGELOG.md CHANGED
@@ -19,11 +19,6 @@ Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
19
19
  are excluded.
20
20
  - `SECTION_ELEMENT_TYPE`, `FRAME_ELEMENT_TYPE` and `SHAPE_ELEMENT_TYPES` in
21
21
  `document-element-constants`, so the rule above has one definition rather than one per app.
22
- - `DocumentElementFactory.getBoundingClientRectScaled` — the space an element covers on the canvas,
23
- with `scale` applied. `getBoundingClientRect` keeps returning the element's own box before scale,
24
- which is what layout works in: `@contrail/document-table` places table members from it, and
25
- scaling it moves a scaled member into a different cell. Anything deciding what an element overlaps
26
- or sits on wants the scaled one.
27
22
 
28
23
  ### Deprecated
29
24
 
@@ -47,9 +42,9 @@ Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
47
42
 
48
43
  ### Changed
49
44
 
50
- - Container membership measures a scaled element from its scaled box, through the new
51
- `getBoundingClientRectScaled` below. A scaled element previously measured at its unscaled size
52
- and could resolve to the wrong container.
45
+ - `DocumentElementFactory.getBoundingClientRect` multiplies the measured size by the element's
46
+ `scale`. Scale grows an element from its top-left, so it widens the box and moves the centre; a
47
+ scaled element previously measured at its unscaled size and could resolve to the wrong container.
53
48
 
54
49
  ## [1.18.0] - 2026-09-10
55
50
 
@@ -63,7 +63,7 @@ class DocumentContainerService {
63
63
  try {
64
64
  const start = ((_a = documentElement.start) === null || _a === void 0 ? void 0 : _a.id) ? documentElementsById.get(documentElement.start.id) : undefined;
65
65
  const end = ((_b = documentElement.end) === null || _b === void 0 ? void 0 : _b.id) ? documentElementsById.get(documentElement.end.id) : undefined;
66
- const { x, y, width, height } = document_element_factory_1.DocumentElementFactory.getBoundingClientRectScaled(documentElement, start, end);
66
+ const { x, y, width, height } = document_element_factory_1.DocumentElementFactory.getBoundingClientRect(documentElement, start, end);
67
67
  return (0, document_container_1.toCoordinateBox)(x, y, width, height);
68
68
  }
69
69
  catch (_c) {
@@ -22,12 +22,6 @@ export declare class DocumentElementFactory {
22
22
  width: any;
23
23
  height: any;
24
24
  };
25
- static getBoundingClientRectScaled(documentElement: DocumentElement, startElement?: DocumentElement, endElement?: DocumentElement): {
26
- x: any;
27
- y: any;
28
- width: any;
29
- height: any;
30
- };
31
25
  private static getPosition;
32
26
  private static getSize;
33
27
  private static getComponentSize;
@@ -207,18 +207,9 @@ class DocumentElementFactory {
207
207
  return ['rectangle', 'circle'].indexOf(element === null || element === void 0 ? void 0 : element.type) !== -1 && ((_a = element === null || element === void 0 ? void 0 : element.elementIds) === null || _a === void 0 ? void 0 : _a.length) > 0;
208
208
  }
209
209
  static getBoundingClientRect(documentElement, startElement, endElement) {
210
+ var _a, _b, _c, _d;
210
211
  const { x, y } = this.getPosition(documentElement, startElement, endElement);
211
212
  const { width, height } = this.getSize(documentElement, startElement, endElement);
212
- return {
213
- x,
214
- y,
215
- width,
216
- height,
217
- };
218
- }
219
- static getBoundingClientRectScaled(documentElement, startElement, endElement) {
220
- var _a, _b, _c, _d;
221
- const { x, y, width, height } = this.getBoundingClientRect(documentElement, startElement, endElement);
222
213
  return {
223
214
  x,
224
215
  y,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/documents",
3
- "version": "1.19.0-alpha.75be757",
3
+ "version": "1.19.0-alpha.93befdf",
4
4
  "description": "Documents library for contrail platform",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",