sldeditor 0.25.0 → 0.25.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"AnnotationLayer.d.ts","sourceRoot":"","sources":["../../src/canvas/AnnotationLayer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAkBH,wBAAgB,eAAe,4CAmI9B"}
1
+ {"version":3,"file":"AnnotationLayer.d.ts","sourceRoot":"","sources":["../../src/canvas/AnnotationLayer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAkBH,wBAAgB,eAAe,4CAoI9B"}
@@ -1,6 +1,32 @@
1
1
  import { ViewportApi } from './useViewport';
2
2
  /**
3
- * Fit all rendered elements to the viewport with padding. Falls back to a
3
+ * Everything that is *drawn*, as opposed to editor chrome (selection halos,
4
+ * handles, previews, ghosts): devices, buses, junctions and terminals (all
5
+ * tagged `data-element-id`), wires, element label blocks, wire labels and
6
+ * free annotations (title blocks, frames, legends, tables).
7
+ *
8
+ * The fit used to match `[data-element-id]` alone, so a drawing whose
9
+ * annotations reach far past its devices was framed at a fraction of its
10
+ * extent — and the canvas disagreed with the export frame, which has always
11
+ * counted labels and annotations (`computeContentBbox` in export-image.ts).
12
+ * A layer that adds a new kind of drawn object must tag it with one of these
13
+ * attributes (or extend this list) for Fit view to see it.
14
+ */
15
+ export declare const FIT_CONTENT_SELECTOR: string;
16
+ export interface ScreenBounds {
17
+ left: number;
18
+ top: number;
19
+ right: number;
20
+ bottom: number;
21
+ }
22
+ /**
23
+ * Union of client rects, skipping degenerate (0×0) ones — unmeasured or
24
+ * empty nodes. A horizontal wire is 0 tall but still counts. Null when
25
+ * nothing measurable remains.
26
+ */
27
+ export declare function unionRects(rects: Iterable<Pick<DOMRect, 'left' | 'top' | 'right' | 'bottom' | 'width' | 'height'>>): ScreenBounds | null;
28
+ /**
29
+ * Fit the whole rendered drawing to the viewport with padding. Falls back to a
4
30
  * centered 100% reset when the canvas is empty. Returns false if the
5
31
  * viewport / canvas isn't ready yet.
6
32
  */
@@ -1 +1 @@
1
- {"version":3,"file":"fit-to-content.d.ts","sourceRoot":"","sources":["../../src/canvas/fit-to-content.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAejD;;;;GAIG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAKtC;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO,CAyC7E;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAOvC"}
1
+ {"version":3,"file":"fit-to-content.d.ts","sourceRoot":"","sources":["../../src/canvas/fit-to-content.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAOjD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,oBAAoB,QAMrB,CAAC;AAEb,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC,CAAC,GACvF,YAAY,GAAG,IAAI,CAarB;AAUD;;;;GAIG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAKtC;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO,CAiC7E;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAOvC"}
@@ -100,7 +100,7 @@ declare const base: {
100
100
  readonly 'view.zoomIn': "放大";
101
101
  readonly 'view.zoomInHint': "按预设档位放大;也可滚轮 ↑ 或 ⌘+";
102
102
  readonly 'view.fit': "适配视图";
103
- readonly 'view.fitHint': "自动缩放并居中所有元件";
103
+ readonly 'view.fitHint': "自动缩放并居中,显示整张图纸";
104
104
  readonly 'view.gridHide': "隐藏网格";
105
105
  readonly 'view.gridShow': "显示网格";
106
106
  readonly 'view.gridHotkey': "G";
@@ -353,7 +353,7 @@ declare const base: {
353
353
  readonly 'view.zoomIn': "Zoom in";
354
354
  readonly 'view.zoomInHint': "Step zoom in; also wheel ↑ or ⌘+";
355
355
  readonly 'view.fit': "Fit view";
356
- readonly 'view.fitHint': "Auto-zoom and center all elements";
356
+ readonly 'view.fitHint': "Auto-zoom and center the whole drawing";
357
357
  readonly 'view.gridHide': "Hide grid";
358
358
  readonly 'view.gridShow': "Show grid";
359
359
  readonly 'view.gridHotkey': "G";
@@ -617,7 +617,7 @@ export declare const messages: {
617
617
  readonly 'view.zoomIn': "放大";
618
618
  readonly 'view.zoomInHint': "按预设档位放大;也可滚轮 ↑ 或 ⌘+";
619
619
  readonly 'view.fit': "适配视图";
620
- readonly 'view.fitHint': "自动缩放并居中所有元件";
620
+ readonly 'view.fitHint': "自动缩放并居中,显示整张图纸";
621
621
  readonly 'view.gridHide': "隐藏网格";
622
622
  readonly 'view.gridShow': "显示网格";
623
623
  readonly 'view.gridHotkey': "G";
@@ -870,7 +870,7 @@ export declare const messages: {
870
870
  readonly 'view.zoomIn': "Zoom in";
871
871
  readonly 'view.zoomInHint': "Step zoom in; also wheel ↑ or ⌘+";
872
872
  readonly 'view.fit': "Fit view";
873
- readonly 'view.fitHint': "Auto-zoom and center all elements";
873
+ readonly 'view.fitHint': "Auto-zoom and center the whole drawing";
874
874
  readonly 'view.gridHide': "Hide grid";
875
875
  readonly 'view.gridShow': "Show grid";
876
876
  readonly 'view.gridHotkey': "G";