@rnacanvas/draw.bonds.curved 1.0.0 → 1.0.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.
package/dist/D.d.ts ADDED
@@ -0,0 +1,39 @@
1
+ import { MoveToSegment } from './MoveToSegment';
2
+ import { TrailingSegment } from './TrailingSegment';
3
+ import type { FinitePoint } from '@rnacanvas/points.oopified';
4
+ /**
5
+ * Represents an SVG path definition for a curved bond.
6
+ */
7
+ export declare class D {
8
+ moveToSegment: MoveToSegment;
9
+ trailingSegments: [TrailingSegment, ...TrailingSegment[]];
10
+ static matching(d: string | undefined | unknown): D;
11
+ constructor(moveToSegment: MoveToSegment, trailingSegments: [TrailingSegment, ...TrailingSegment[]]);
12
+ get segments(): [MoveToSegment, TrailingSegment, ...TrailingSegment[]];
13
+ /**
14
+ * All points defining the SVG path definition.
15
+ */
16
+ get definingPoints(): FinitePoint[];
17
+ get startPoint(): FinitePoint;
18
+ /**
19
+ * All points defining the SVG path definition except for the start point and end point.
20
+ */
21
+ get interveningPoints(): FinitePoint[];
22
+ /**
23
+ * All control points in the SVG path definition.
24
+ */
25
+ get controlPoints(): FinitePoint[];
26
+ get endPoint(): FinitePoint;
27
+ toString(): string;
28
+ /**
29
+ * The `dragPoint` is the point at which dragging was initiated from
30
+ * (e.g., the point on the curve that was clicked on at the start of dragging).
31
+ */
32
+ drag(x: number, y: number, options: {
33
+ dragPoint: {
34
+ x: number;
35
+ y: number;
36
+ };
37
+ }): void;
38
+ }
39
+ //# sourceMappingURL=D.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"D.d.ts","sourceRoot":"","sources":["../src/D.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAQ9D;;GAEG;AACH,qBAAa,CAAC;IA2BO,aAAa,EAAE,aAAa;IAAS,gBAAgB,EAAE,CAAC,eAAe,EAAE,GAAG,eAAe,EAAE,CAAC;IA1BjH,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,CAAC;gBA0BhC,aAAa,EAAE,aAAa,EAAS,gBAAgB,EAAE,CAAC,eAAe,EAAE,GAAG,eAAe,EAAE,CAAC;IAEjH,IAAI,QAAQ,IAAI,CAAC,aAAa,EAAE,eAAe,EAAE,GAAG,eAAe,EAAE,CAAC,CAMrE;IAED;;OAEG;IACH,IAAI,cAAc,IAAI,WAAW,EAAE,CAKlC;IAED,IAAI,UAAU,IAAI,WAAW,CAE5B;IAED;;OAEG;IACH,IAAI,iBAAiB,IAAI,WAAW,EAAE,CAKrC;IAED;;OAEG;IACH,IAAI,aAAa,IAAI,WAAW,EAAE,CAEjC;IAED,IAAI,QAAQ,IAAI,WAAW,CAM1B;IAED,QAAQ,IAAI,MAAM;IAIlB;;;OAGG;IACH,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE;QAAE,SAAS,EAAE;YAAE,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,GAAG,IAAI;CAenF"}
@@ -0,0 +1,13 @@
1
+ import { FinitePoint } from '@rnacanvas/points.oopified';
2
+ import type { SVGCommand } from 'svg-pathdata';
3
+ export declare class MoveToSegment {
4
+ readonly startPoint: FinitePoint;
5
+ static from(command: SVGCommand): MoveToSegment | never;
6
+ constructor(startPoint: FinitePoint);
7
+ /**
8
+ * Same point object as the start point.
9
+ */
10
+ get endPoint(): FinitePoint;
11
+ toString(): string;
12
+ }
13
+ //# sourceMappingURL=MoveToSegment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MoveToSegment.d.ts","sourceRoot":"","sources":["../src/MoveToSegment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAIzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,qBAAa,aAAa;IAeZ,QAAQ,CAAC,UAAU,EAAE,WAAW;IAd5C,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,aAAa,GAAG,KAAK;gBAclC,UAAU,EAAE,WAAW;IAE5C;;OAEG;IACH,IAAI,QAAQ,IAAI,WAAW,CAE1B;IAED,QAAQ,IAAI,MAAM;CAGnB"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * A collection of points.
3
+ */
4
+ export declare class Points<P extends PointLike> {
5
+ #private;
6
+ constructor(points: P[]);
7
+ /**
8
+ * Returns the closest point to the specified point.
9
+ *
10
+ * Returns the same point object that's in the points collection
11
+ * (i.e., doesn't create any new point objects).
12
+ */
13
+ closest(p: PointLike): P;
14
+ }
15
+ type PointLike = {
16
+ x: number;
17
+ y: number;
18
+ };
19
+ export {};
20
+ //# sourceMappingURL=Points.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Points.d.ts","sourceRoot":"","sources":["../src/Points.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,qBAAa,MAAM,CAAC,CAAC,SAAS,SAAS;;gBAGzB,MAAM,EAAE,CAAC,EAAE;IAIvB;;;;;OAKG;IACH,OAAO,CAAC,CAAC,EAAE,SAAS,GAAG,CAAC;CAYzB;AAED,KAAK,SAAS,GAAG;IACf,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { SVGCommand } from 'svg-pathdata';
2
+ import { FinitePoint } from '@rnacanvas/points.oopified';
3
+ /**
4
+ * A segment that comes after at least one previous segment in an SVG path definition (for a curved bond).
5
+ */
6
+ export declare class TrailingSegment {
7
+ controlPoints: FinitePoint[];
8
+ readonly endPoint: FinitePoint;
9
+ static from(command: SVGCommand): TrailingSegment | never;
10
+ constructor(controlPoints: FinitePoint[], endPoint: FinitePoint);
11
+ toString(): string;
12
+ }
13
+ //# sourceMappingURL=TrailingSegment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TrailingSegment.d.ts","sourceRoot":"","sources":["../src/TrailingSegment.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD;;GAEG;AACH,qBAAa,eAAe;IAyBP,aAAa,EAAE,WAAW,EAAE;IAAE,QAAQ,CAAC,QAAQ,EAAE,WAAW;IAxB/E,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,eAAe,GAAG,KAAK;gBAwBtC,aAAa,EAAE,WAAW,EAAE,EAAW,QAAQ,EAAE,WAAW;IAE/E,QAAQ,IAAI,MAAM;CAoBnB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rnacanvas/draw.bonds.curved",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Draw curved bonds",
5
5
  "repository": {
6
6
  "type": "git",
@@ -29,7 +29,11 @@
29
29
  "webpack-cli": "^7.0.0"
30
30
  },
31
31
  "dependencies": {
32
+ "@rnacanvas/points": "^1.12.0",
33
+ "@rnacanvas/points.oopified": "^2.6.0",
34
+ "@rnacanvas/utilities": "^8.0.0",
32
35
  "jquery": "^4.0.0",
36
+ "svg-pathdata": "^9.0.0",
33
37
  "uuid": "^13.0.0"
34
38
  }
35
39
  }