sldeditor 0.20.1 → 0.21.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.
- package/dist/canvas/AnnotationDraftPreview.d.ts +1 -1
- package/dist/canvas/AnnotationDraftPreview.d.ts.map +1 -1
- package/dist/canvas/AnnotationHandles.d.ts +1 -1
- package/dist/canvas/AnnotationHandles.d.ts.map +1 -1
- package/dist/canvas/AnnotationLayer.d.ts.map +1 -1
- package/dist/canvas/BusLayer.d.ts.map +1 -1
- package/dist/canvas/ElementLayer.d.ts.map +1 -1
- package/dist/canvas/FreeAnnotationLayer.d.ts.map +1 -1
- package/dist/canvas/WireLayer.d.ts.map +1 -1
- package/dist/canvas/tools/EllipseTool.d.ts +3 -0
- package/dist/canvas/tools/EllipseTool.d.ts.map +1 -0
- package/dist/canvas/tools/index.d.ts.map +1 -1
- package/dist/canvas/useKeyboardShortcuts.d.ts.map +1 -1
- package/dist/compiler/compile.d.ts.map +1 -1
- package/dist/compiler/internal-model.d.ts +4 -0
- package/dist/compiler/internal-model.d.ts.map +1 -1
- package/dist/components/FloatingToolbar.d.ts.map +1 -1
- package/dist/components/PropertyPanel.d.ts.map +1 -1
- package/dist/components/RightPanel.d.ts.map +1 -1
- package/dist/i18n/locales/ar.d.ts +1 -1
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/de.d.ts +1 -1
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/es.d.ts +1 -1
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/fa.d.ts +1 -1
- package/dist/i18n/locales/fa.d.ts.map +1 -1
- package/dist/i18n/locales/fr.d.ts +1 -1
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/he.d.ts +1 -1
- package/dist/i18n/locales/he.d.ts.map +1 -1
- package/dist/i18n/locales/index.d.ts +9 -9
- package/dist/i18n/locales/ja.d.ts +1 -1
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/pt.d.ts +1 -1
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/ru.d.ts +1 -1
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/messages.d.ts +73 -9
- package/dist/i18n/messages.d.ts.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/lib/annotation-geom.d.ts +34 -3
- package/dist/lib/annotation-geom.d.ts.map +1 -1
- package/dist/lib/colors.d.ts +39 -0
- package/dist/lib/colors.d.ts.map +1 -0
- package/dist/lib/export-dxf.d.ts.map +1 -1
- package/dist/lib/export-image.d.ts.map +1 -1
- package/dist/model/index.d.ts +1 -1
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/types.d.ts +70 -5
- package/dist/model/types.d.ts.map +1 -1
- package/dist/sldeditor.cjs +57 -52
- package/dist/sldeditor.cjs.map +1 -1
- package/dist/sldeditor.js +4941 -4368
- package/dist/sldeditor.js.map +1 -1
- package/dist/store/store.d.ts +5 -5
- package/dist/store/store.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { DiagramColor } from '../model';
|
|
2
|
+
export interface ColorSpec {
|
|
3
|
+
/** Canvas + export ink on a light background. */
|
|
4
|
+
light: string;
|
|
5
|
+
/** Canvas ink on a dark background. */
|
|
6
|
+
dark: string;
|
|
7
|
+
/**
|
|
8
|
+
* AutoCAD Color Index. 7 is the "use the viewport's own foreground" entry,
|
|
9
|
+
* which is why `default` maps to it — a default-coloured drawing keeps
|
|
10
|
+
* behaving the way it always has when opened in CAD.
|
|
11
|
+
*/
|
|
12
|
+
aci: number;
|
|
13
|
+
}
|
|
14
|
+
export declare const NAMED_COLORS: Record<DiagramColor, ColorSpec>;
|
|
15
|
+
/** Palette order for pickers — `default` first, then warm → cool → neutral. */
|
|
16
|
+
export declare const COLOR_ORDER: DiagramColor[];
|
|
17
|
+
/**
|
|
18
|
+
* CSS class that paints an object in `c`, or `undefined` for the default.
|
|
19
|
+
*
|
|
20
|
+
* Returning `undefined` rather than a `ole-ink-default` class matters: the
|
|
21
|
+
* canvas already inherits theme ink through `currentColor`, so an uncoloured
|
|
22
|
+
* object keeps exactly the DOM it had before this feature — no extra class,
|
|
23
|
+
* no extra specificity fight with the selection recolor.
|
|
24
|
+
*/
|
|
25
|
+
export declare function inkClass(c: DiagramColor | undefined): string | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Ink for the SVG/PNG exporters. Always the LIGHT value: an export is a
|
|
28
|
+
* document headed for paper, a CAD seat or an email, none of which inherit the
|
|
29
|
+
* editor's theme. `default` resolves to the literal `black` the exporters
|
|
30
|
+
* emitted before colours existed.
|
|
31
|
+
*/
|
|
32
|
+
export declare function exportInk(c: DiagramColor | undefined): string;
|
|
33
|
+
/**
|
|
34
|
+
* ACI index for the DXF writer, or `undefined` when the entity should inherit
|
|
35
|
+
* its layer colour. Group code 62 is omitted entirely in that case, so an
|
|
36
|
+
* uncoloured diagram writes the same bytes it always did.
|
|
37
|
+
*/
|
|
38
|
+
export declare function dxfColor(c: DiagramColor | undefined): number | undefined;
|
|
39
|
+
//# sourceMappingURL=colors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/lib/colors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,MAAM,WAAW,SAAS;IACxB,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,GAAG,EAAE,MAAM,CAAC;CACb;AAED,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,SAAS,CAUxD,CAAC;AAEF,+EAA+E;AAC/E,eAAO,MAAM,WAAW,EAAE,YAAY,EAOrC,CAAC;AAMF;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,YAAY,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAExE;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,YAAY,GAAG,SAAS,GAAG,MAAM,CAE7D;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,YAAY,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAExE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"export-dxf.d.ts","sourceRoot":"","sources":["../../src/lib/export-dxf.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAEL,KAAK,aAAa,EAEnB,MAAM,aAAa,CAAC;AACrB,OAAO,EAEL,KAAK,UAAU,
|
|
1
|
+
{"version":3,"file":"export-dxf.d.ts","sourceRoot":"","sources":["../../src/lib/export-dxf.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAEL,KAAK,aAAa,EAEnB,MAAM,aAAa,CAAC;AACrB,OAAO,EAEL,KAAK,UAAU,EAEf,KAAK,SAAS,EAKf,MAAM,UAAU,CAAC;AAsBlB,MAAM,WAAW,gBAAgB;IAC/B,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qFAAqF;IACrF,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;iEAC6D;IAC7D,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;CAC5B;AAaD,wBAAgB,cAAc,CAC5B,KAAK,EAAE,aAAa,EACpB,IAAI,GAAE,gBAAqB,GAC1B,MAAM,CAmNR;AAED,wBAAsB,WAAW,CAC/B,KAAK,EAAE,aAAa,EACpB,QAAQ,SAAgB,EACxB,IAAI,CAAC,EAAE,gBAAgB,GACtB,OAAO,CAAC,IAAI,CAAC,CAUf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"export-image.d.ts","sourceRoot":"","sources":["../../src/lib/export-image.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAEL,KAAK,UAAU,
|
|
1
|
+
{"version":3,"file":"export-image.d.ts","sourceRoot":"","sources":["../../src/lib/export-image.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAEL,KAAK,UAAU,EAGf,KAAK,SAAS,EAKf,MAAM,UAAU,CAAC;AAqClB,MAAM,WAAW,aAAa;IAC5B,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uEAAuE;IACvE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qFAAqF;IACrF,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;iEAC6D;IAC7D,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;CAC5B;AAED,wBAAgB,cAAc,CAC5B,KAAK,EAAE,aAAa,EACpB,IAAI,GAAE,aAAkB,GACvB,MAAM,CAuJR;AAiSD,wBAAsB,WAAW,CAC/B,KAAK,EAAE,aAAa,EACpB,QAAQ,SAAgB,EACxB,IAAI,CAAC,EAAE,aAAa,GACnB,OAAO,CAAC,IAAI,CAAC,CAMf;AAED,wBAAsB,WAAW,CAC/B,KAAK,EAAE,aAAa,EACpB,QAAQ,SAAgB,EACxB,IAAI,CAAC,EAAE,aAAa,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GACxC,OAAO,CAAC,IAAI,CAAC,CA0Bf"}
|
package/dist/model/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { Annotation, AnnotationFill, AnnotationId, AnnotationKind, AnnotationPatch, AnnotationStroke, Bus, BusId, BusLayout, DiagramFile, DiagramMeta, DiagramVersion, Element, ElementId, Junction, JunctionId, JunctionLayout, LabelMode, LineAnnotation, LineArrow, NodeId, ParamValue, PinName, Placement, RectAnnotation, TableAnnotation, TerminalRef, TextAnnotation, Wire, WireEnd, WireId, } from './types';
|
|
1
|
+
export type { Annotation, AnnotationFill, AnnotationId, AnnotationKind, AnnotationPatch, AnnotationStroke, AnnotationStrokeWidth, BoxAnnotation, Bus, BusId, BusLayout, DiagramColor, DiagramFile, DiagramMeta, DiagramVersion, Element, ElementId, EllipseAnnotation, Junction, JunctionId, JunctionLayout, LabelMode, LineAnnotation, LineArrow, NodeId, ParamValue, PinName, Placement, RectAnnotation, TableAnnotation, TerminalRef, TextAnnotation, Wire, WireEnd, WireId, } from './types';
|
|
2
2
|
export { annotationKind, isTextAnnotation } from './types';
|
|
3
3
|
export type { LibraryEntry, LibraryTerminal, LibraryStretchable, LibraryStateField, LibraryParamField, LibraryLabelAnchor, LibrarySource, Orientation, } from './library';
|
|
4
4
|
export { normalizePath } from './wire-path';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,UAAU,EACV,cAAc,EACd,YAAY,EACZ,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,GAAG,EACH,KAAK,EACL,SAAS,EACT,WAAW,EACX,WAAW,EACX,cAAc,EACd,OAAO,EACP,SAAS,EACT,QAAQ,EACR,UAAU,EACV,cAAc,EACd,SAAS,EACT,cAAc,EACd,SAAS,EACT,MAAM,EACN,UAAU,EACV,OAAO,EACP,SAAS,EACT,cAAc,EACd,eAAe,EACf,WAAW,EACX,cAAc,EACd,IAAI,EACJ,OAAO,EACP,MAAM,GACP,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3D,YAAY,EACV,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,WAAW,GACZ,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,UAAU,EACV,cAAc,EACd,YAAY,EACZ,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,aAAa,EACb,GAAG,EACH,KAAK,EACL,SAAS,EACT,YAAY,EACZ,WAAW,EACX,WAAW,EACX,cAAc,EACd,OAAO,EACP,SAAS,EACT,iBAAiB,EACjB,QAAQ,EACR,UAAU,EACV,cAAc,EACd,SAAS,EACT,cAAc,EACd,SAAS,EACT,MAAM,EACN,UAAU,EACV,OAAO,EACP,SAAS,EACT,cAAc,EACd,eAAe,EACf,WAAW,EACX,cAAc,EACd,IAAI,EACJ,OAAO,EACP,MAAM,GACP,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3D,YAAY,EACV,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,WAAW,GACZ,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/model/types.d.ts
CHANGED
|
@@ -65,6 +65,11 @@ export interface Element {
|
|
|
65
65
|
note?: string;
|
|
66
66
|
params?: Record<string, ParamValue>;
|
|
67
67
|
state?: Record<string, ParamValue>;
|
|
68
|
+
/**
|
|
69
|
+
* Ink colour of the symbol. Purely presentational — it never reaches the
|
|
70
|
+
* compiler, connectivity or diagnostics. Absent = theme ink.
|
|
71
|
+
*/
|
|
72
|
+
color?: DiagramColor;
|
|
68
73
|
}
|
|
69
74
|
export interface Bus {
|
|
70
75
|
id: BusId;
|
|
@@ -73,6 +78,8 @@ export interface Bus {
|
|
|
73
78
|
params?: Record<string, ParamValue>;
|
|
74
79
|
/** If absent, auto-layout computes geometry. */
|
|
75
80
|
layout?: BusLayout;
|
|
81
|
+
/** Ink colour. Colour-coding busbars was the single most-asked-for use. */
|
|
82
|
+
color?: DiagramColor;
|
|
76
83
|
}
|
|
77
84
|
export interface BusLayout {
|
|
78
85
|
at: [number, number];
|
|
@@ -101,6 +108,8 @@ export interface Wire {
|
|
|
101
108
|
* effect on routing or connectivity.
|
|
102
109
|
*/
|
|
103
110
|
label?: string;
|
|
111
|
+
/** Ink colour. Presentational only — routing and connectivity ignore it. */
|
|
112
|
+
color?: DiagramColor;
|
|
104
113
|
}
|
|
105
114
|
export interface Placement {
|
|
106
115
|
at: [number, number];
|
|
@@ -108,8 +117,25 @@ export interface Placement {
|
|
|
108
117
|
mirror?: boolean;
|
|
109
118
|
}
|
|
110
119
|
export type AnnotationId = string;
|
|
111
|
-
/**
|
|
112
|
-
|
|
120
|
+
/**
|
|
121
|
+
* Ink colour for anything drawn on the canvas — devices, buses, wires and
|
|
122
|
+
* free annotations alike.
|
|
123
|
+
*
|
|
124
|
+
* A closed set of NAMES rather than free hex, because the canvas has a dark
|
|
125
|
+
* theme: a literal colour cannot follow it, so a user who picked black would
|
|
126
|
+
* watch their drawing disappear the moment they switched. Each name resolves
|
|
127
|
+
* to a light/dark pair (and a DXF ACI index) in `lib/colors.ts`, so the same
|
|
128
|
+
* choice reads correctly in both themes and survives export to CAD.
|
|
129
|
+
*
|
|
130
|
+
* `default` deliberately means "whatever ink the theme uses" — absent is the
|
|
131
|
+
* same as `default`, which is why every colour field is optional and why a
|
|
132
|
+
* diagram written before colours existed renders byte-identically.
|
|
133
|
+
*/
|
|
134
|
+
export type DiagramColor = 'default' | 'red' | 'blue' | 'green' | 'amber' | 'gray';
|
|
135
|
+
/** Stroke style shared by rect / ellipse / line annotations. */
|
|
136
|
+
export type AnnotationStroke = 'solid' | 'dashed' | 'dotted';
|
|
137
|
+
/** Stroke weight for shape annotations, in nominal canvas units. */
|
|
138
|
+
export type AnnotationStrokeWidth = 1 | 2 | 3;
|
|
113
139
|
/** Rect fill: `tint` is a faint foreground wash that never occludes content. */
|
|
114
140
|
export type AnnotationFill = 'none' | 'tint';
|
|
115
141
|
/** Arrowheads on a line annotation (leader / callout use). */
|
|
@@ -128,6 +154,7 @@ export interface TextAnnotation {
|
|
|
128
154
|
at: [number, number];
|
|
129
155
|
text: string;
|
|
130
156
|
fontSize?: number;
|
|
157
|
+
color?: DiagramColor;
|
|
131
158
|
}
|
|
132
159
|
/**
|
|
133
160
|
* Rectangle — plain box or a labeled group frame (dashed box around a
|
|
@@ -141,11 +168,39 @@ export interface RectAnnotation {
|
|
|
141
168
|
size: [number, number];
|
|
142
169
|
/** Default `dashed` — the group-frame convention. */
|
|
143
170
|
stroke?: AnnotationStroke;
|
|
171
|
+
/** Default 1. */
|
|
172
|
+
strokeWidth?: AnnotationStrokeWidth;
|
|
144
173
|
/** Default `none`. */
|
|
145
174
|
fill?: AnnotationFill;
|
|
175
|
+
/** Default `default` (theme ink). */
|
|
176
|
+
color?: DiagramColor;
|
|
146
177
|
/** Optional caption drawn inside the top-left corner. */
|
|
147
178
|
label?: string;
|
|
148
179
|
}
|
|
180
|
+
/**
|
|
181
|
+
* Ellipse / circle — the shape the rect tool could never stand in for.
|
|
182
|
+
*
|
|
183
|
+
* Anchored by its BOUNDING BOX (`at` = top-left, `size` = w×h) rather than
|
|
184
|
+
* centre+radii, so every box-shaped affordance already written for rects —
|
|
185
|
+
* the 8 resize grips, the drag-to-draw gesture, the bbox helpers, marquee
|
|
186
|
+
* hit-testing — applies unchanged. Shift while drawing constrains to a circle.
|
|
187
|
+
*/
|
|
188
|
+
export interface EllipseAnnotation {
|
|
189
|
+
id: AnnotationId;
|
|
190
|
+
type: 'ellipse';
|
|
191
|
+
at: [number, number];
|
|
192
|
+
size: [number, number];
|
|
193
|
+
/** Default `solid` — unlike a rect, an ellipse is a drawn shape, not a frame. */
|
|
194
|
+
stroke?: AnnotationStroke;
|
|
195
|
+
/** Default 1. */
|
|
196
|
+
strokeWidth?: AnnotationStrokeWidth;
|
|
197
|
+
/** Default `none`. */
|
|
198
|
+
fill?: AnnotationFill;
|
|
199
|
+
/** Default `default` (theme ink). */
|
|
200
|
+
color?: DiagramColor;
|
|
201
|
+
/** Optional caption drawn inside the top-left of the bounding box. */
|
|
202
|
+
label?: string;
|
|
203
|
+
}
|
|
149
204
|
/** Straight/poly line, optionally arrowed (leader lines, dividers). */
|
|
150
205
|
export interface LineAnnotation {
|
|
151
206
|
id: AnnotationId;
|
|
@@ -155,6 +210,10 @@ export interface LineAnnotation {
|
|
|
155
210
|
points: [number, number][];
|
|
156
211
|
/** Default `solid`. */
|
|
157
212
|
stroke?: AnnotationStroke;
|
|
213
|
+
/** Default 1. */
|
|
214
|
+
strokeWidth?: AnnotationStrokeWidth;
|
|
215
|
+
/** Default `default` (theme ink). */
|
|
216
|
+
color?: DiagramColor;
|
|
158
217
|
/** Default `none`. */
|
|
159
218
|
arrow?: LineArrow;
|
|
160
219
|
}
|
|
@@ -168,10 +227,16 @@ export interface TableAnnotation {
|
|
|
168
227
|
/** `cells[row][col]`, sized `rowHeights.length × colWidths.length`. */
|
|
169
228
|
cells: string[][];
|
|
170
229
|
fontSize?: number;
|
|
230
|
+
color?: DiagramColor;
|
|
171
231
|
}
|
|
172
|
-
export type Annotation = TextAnnotation | RectAnnotation | LineAnnotation | TableAnnotation;
|
|
232
|
+
export type Annotation = TextAnnotation | RectAnnotation | EllipseAnnotation | LineAnnotation | TableAnnotation;
|
|
173
233
|
/** `type` of an annotation with the text default applied. */
|
|
174
|
-
export type AnnotationKind = 'text' | 'rect' | 'line' | 'table';
|
|
234
|
+
export type AnnotationKind = 'text' | 'rect' | 'ellipse' | 'line' | 'table';
|
|
235
|
+
/**
|
|
236
|
+
* The box-anchored shapes. They share `at` + `size`, which is the whole reason
|
|
237
|
+
* the resize grips and bbox code can treat them as one thing.
|
|
238
|
+
*/
|
|
239
|
+
export type BoxAnnotation = RectAnnotation | EllipseAnnotation;
|
|
175
240
|
export declare function annotationKind(a: Annotation): AnnotationKind;
|
|
176
241
|
export declare function isTextAnnotation(a: Annotation): a is TextAnnotation;
|
|
177
242
|
/**
|
|
@@ -179,5 +244,5 @@ export declare function isTextAnnotation(a: Annotation): a is TextAnnotation;
|
|
|
179
244
|
* variant fields (minus identity). The store merge preserves the original
|
|
180
245
|
* `type`, so a patch can only touch fields meaningful to that variant.
|
|
181
246
|
*/
|
|
182
|
-
export type AnnotationPatch = Partial<Omit<TextAnnotation, 'id' | 'type'> & Omit<RectAnnotation, 'id' | 'type'> & Omit<LineAnnotation, 'id' | 'type'> & Omit<TableAnnotation, 'id' | 'type'>>;
|
|
247
|
+
export type AnnotationPatch = Partial<Omit<TextAnnotation, 'id' | 'type'> & Omit<RectAnnotation, 'id' | 'type'> & Omit<EllipseAnnotation, 'id' | 'type'> & Omit<LineAnnotation, 'id' | 'type'> & Omit<TableAnnotation, 'id' | 'type'>>;
|
|
183
248
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/model/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE9C,MAAM,MAAM,cAAc,GAAG,GAAG,CAAC;AACjC,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAC/B,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAC7B,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC;AAC5B,MAAM,MAAM,KAAK,GAAG,SAAS,CAAC;A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