terra-draw 0.0.1-alpha.9 → 1.0.0-beta.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.
Files changed (122) hide show
  1. package/.devcontainer/Dockerfile +8 -0
  2. package/.devcontainer/devcontainer.json +27 -0
  3. package/.devcontainer/post-create.sh +16 -0
  4. package/README.md +23 -13
  5. package/dist/adapters/arcgis-maps-sdk.adapter.d.ts +106 -0
  6. package/dist/adapters/google-maps.adapter.d.ts +90 -39
  7. package/dist/adapters/leaflet.adapter.d.ts +99 -33
  8. package/dist/adapters/mapbox-gl.adapter.d.ts +91 -37
  9. package/dist/adapters/maplibre-gl.adapter.d.ts +72 -0
  10. package/dist/adapters/openlayers.adapter.d.ts +120 -0
  11. package/dist/common.d.ts +118 -98
  12. package/dist/geometry/boolean/is-valid-coordinate.d.ts +4 -0
  13. package/dist/geometry/boolean/point-in-polygon.d.ts +2 -2
  14. package/dist/geometry/boolean/self-intersects.d.ts +2 -2
  15. package/dist/geometry/calculate-relative-angle.d.ts +17 -0
  16. package/dist/geometry/centroid.d.ts +2 -2
  17. package/dist/geometry/coordinates-identical.d.ts +2 -2
  18. package/dist/geometry/determine-halfplane.d.ts +10 -0
  19. package/dist/geometry/get-coordinates-as-points.d.ts +6 -6
  20. package/dist/geometry/get-midpoints.d.ts +14 -7
  21. package/dist/geometry/helpers.d.ts +4 -4
  22. package/dist/geometry/limit-decimal-precision.d.ts +1 -1
  23. package/dist/geometry/measure/area.d.ts +2 -0
  24. package/dist/geometry/measure/bearing.d.ts +9 -0
  25. package/dist/geometry/measure/destination.d.ts +9 -0
  26. package/dist/geometry/measure/haversine-distance.d.ts +2 -2
  27. package/dist/geometry/measure/pixel-distance-to-line.d.ts +10 -10
  28. package/dist/geometry/measure/pixel-distance.d.ts +7 -7
  29. package/dist/geometry/measure/rhumb-bearing.d.ts +2 -2
  30. package/dist/geometry/measure/rhumb-destination.d.ts +2 -2
  31. package/dist/geometry/measure/rhumb-distance.d.ts +2 -2
  32. package/dist/geometry/measure/slice-along.d.ts +2 -0
  33. package/dist/geometry/midpoint-coordinate.d.ts +4 -2
  34. package/dist/geometry/project/web-mercator.d.ts +20 -0
  35. package/dist/geometry/shape/create-bbox.d.ts +10 -0
  36. package/dist/geometry/shape/create-circle.d.ts +13 -7
  37. package/dist/geometry/shape/great-circle-coordinates.d.ts +2 -0
  38. package/dist/geometry/shape/web-mercator-distortion.d.ts +2 -0
  39. package/dist/geometry/transform/rotate.d.ts +9 -2
  40. package/dist/geometry/transform/scale.d.ts +9 -2
  41. package/dist/geometry/web-mercator-centroid.d.ts +11 -0
  42. package/dist/modes/angled-rectangle/angled-rectangle.mode.d.ts +62 -0
  43. package/dist/modes/base.behavior.d.ts +21 -19
  44. package/dist/modes/base.mode.d.ts +66 -33
  45. package/dist/modes/circle/circle.mode.d.ts +66 -37
  46. package/dist/modes/click-bounding-box.behavior.d.ts +6 -7
  47. package/dist/modes/freehand/freehand.mode.d.ts +63 -43
  48. package/dist/modes/insert-coordinates.behavior.d.ts +9 -0
  49. package/dist/modes/linestring/linestring.mode.d.ts +78 -47
  50. package/dist/modes/pixel-distance.behavior.d.ts +7 -7
  51. package/dist/modes/point/point.mode.d.ts +44 -26
  52. package/dist/modes/polygon/behaviors/closing-points.behavior.d.ts +19 -19
  53. package/dist/modes/polygon/polygon.mode.d.ts +69 -51
  54. package/dist/modes/rectangle/rectangle.mode.d.ts +55 -0
  55. package/dist/modes/render/render.mode.d.ts +52 -23
  56. package/dist/modes/select/behaviors/drag-coordinate-resize.behavior.d.ts +62 -0
  57. package/dist/modes/select/behaviors/drag-coordinate.behavior.d.ts +20 -13
  58. package/dist/modes/select/behaviors/drag-feature.behavior.d.ts +20 -17
  59. package/dist/modes/select/behaviors/{features-at-mouse-event.behavior.d.ts → feature-at-pointer-event.behavior.d.ts} +15 -15
  60. package/dist/modes/select/behaviors/midpoint.behavior.d.ts +19 -18
  61. package/dist/modes/select/behaviors/rotate-feature.behavior.d.ts +14 -13
  62. package/dist/modes/select/behaviors/scale-feature.behavior.d.ts +14 -13
  63. package/dist/modes/select/behaviors/selection-point.behavior.d.ts +19 -18
  64. package/dist/modes/select/select.mode.d.ts +119 -78
  65. package/dist/modes/snapping.behavior.d.ts +16 -13
  66. package/dist/modes/static/static.mode.d.ts +32 -30
  67. package/dist/store/spatial-index/quickselect.d.ts +2 -2
  68. package/dist/store/spatial-index/rbush.d.ts +35 -35
  69. package/dist/store/spatial-index/spatial-index.d.ts +18 -18
  70. package/dist/store/store-feature-validation.d.ts +16 -0
  71. package/dist/store/store.d.ts +59 -48
  72. package/dist/terra-draw.cjs +1 -1
  73. package/dist/terra-draw.cjs.map +1 -1
  74. package/dist/terra-draw.d.ts +223 -48
  75. package/dist/terra-draw.modern.js +1 -1
  76. package/dist/terra-draw.modern.js.map +1 -1
  77. package/dist/terra-draw.module.js +1 -1
  78. package/dist/terra-draw.module.js.map +1 -1
  79. package/dist/terra-draw.umd.js +1 -1
  80. package/dist/terra-draw.umd.js.map +1 -1
  81. package/dist/util/geoms.d.ts +3 -3
  82. package/dist/util/id.d.ts +1 -1
  83. package/dist/util/styling.d.ts +2 -2
  84. package/dist/validations/linestring.validation.d.ts +2 -0
  85. package/dist/validations/max-size.validation.d.ts +2 -0
  86. package/dist/validations/min-size.validation.d.ts +2 -0
  87. package/dist/validations/not-self-intersecting.validation.d.ts +2 -0
  88. package/dist/validations/point.validation.d.ts +2 -0
  89. package/dist/validations/polygon.validation.d.ts +3 -0
  90. package/e2e/README.md +29 -0
  91. package/e2e/package-lock.json +4274 -0
  92. package/e2e/package.json +26 -0
  93. package/e2e/playwright.config.ts +77 -0
  94. package/e2e/public/favicon.ico +0 -0
  95. package/e2e/public/index.html +53 -0
  96. package/e2e/tests/leaflet.spec.ts +739 -0
  97. package/e2e/tests/setup.ts +198 -0
  98. package/e2e/webpack.config.js +36 -0
  99. package/jest.nocheck.config.ts +17 -0
  100. package/package.json +158 -87
  101. package/readme.gif +0 -0
  102. package/tsconfig.json +25 -12
  103. package/CODE_OF_CONDUCT.md +0 -36
  104. package/CONTRIBUTING.md +0 -17
  105. package/DEVELOPMENT.md +0 -77
  106. package/dist/bundle.js +0 -6
  107. package/dist/bundle.js.LICENSE.txt +0 -4
  108. package/dist/geometry/create-circle.d.ts +0 -6
  109. package/dist/geometry/get-pixel-distance-to-line.d.ts +0 -10
  110. package/dist/geometry/get-pixel-distance.d.ts +0 -7
  111. package/dist/geometry/haversine-distance.d.ts +0 -1
  112. package/dist/geometry/point-in-polygon.d.ts +0 -1
  113. package/dist/geometry/self-intersects.d.ts +0 -2
  114. package/dist/modes/circle.mode.d.ts +0 -18
  115. package/dist/modes/freehand.mode.d.ts +0 -20
  116. package/dist/modes/line-string.mode.d.ts +0 -21
  117. package/dist/modes/point.mode.d.ts +0 -14
  118. package/dist/modes/polygon/behaviors/start-end-point.behavior.d.ts +0 -11
  119. package/dist/modes/polygon.mode.d.ts +0 -21
  120. package/dist/modes/select.mode.d.ts +0 -21
  121. package/dist/modes/static.mode.d.ts +0 -10
  122. package/jest.config.ts +0 -27
@@ -0,0 +1,198 @@
1
+ import { Page, expect } from "@playwright/test";
2
+
3
+ export const pageUrl = "http://localhost:3000/";
4
+
5
+ export type TestConfigOptions =
6
+ | "validationSuccess"
7
+ | "validationFailure"
8
+ | "insertCoordinates"
9
+ | "insertCoordinatesGlobe"
10
+ | "globeCircle"
11
+ | "globeSelect";
12
+
13
+ export const setupMap = async ({
14
+ page,
15
+ configQueryParam,
16
+ }: {
17
+ page: Page;
18
+ configQueryParam?: TestConfigOptions[];
19
+ }): Promise<{
20
+ x: number;
21
+ y: number;
22
+ width: number;
23
+ height: number;
24
+ }> => {
25
+ if (configQueryParam) {
26
+ if (configQueryParam.length > 1) {
27
+ await page.goto(
28
+ pageUrl +
29
+ "?config=" +
30
+ configQueryParam.map((config) => config).join(","),
31
+ );
32
+ } else {
33
+ await page.goto(pageUrl + "?config=" + configQueryParam);
34
+ }
35
+ } else {
36
+ await page.goto(pageUrl);
37
+ }
38
+
39
+ const mapDiv = await page.getByRole("application");
40
+
41
+ // Get the bounding box of the div
42
+ const mapBoundingBox = await mapDiv.boundingBox();
43
+
44
+ if (!mapBoundingBox) {
45
+ throw new Error();
46
+ }
47
+
48
+ return mapBoundingBox;
49
+ };
50
+
51
+ export const changeMode = async ({
52
+ page,
53
+ mode,
54
+ }: {
55
+ page: Page;
56
+ mode:
57
+ | "point"
58
+ | "polygon"
59
+ | "linestring"
60
+ | "select"
61
+ | "rectangle"
62
+ | "circle"
63
+ | "angled-rectangle";
64
+ }) => {
65
+ let modeText = mode.charAt(0).toUpperCase() + mode.slice(1);
66
+
67
+ if (mode.includes("-")) {
68
+ modeText = mode
69
+ .split("-")
70
+ .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
71
+ .join(" ");
72
+ } else {
73
+ modeText = mode.charAt(0).toUpperCase() + mode.slice(1);
74
+ }
75
+
76
+ const buttons = page.getByTestId("buttons");
77
+ const button = buttons.getByText(modeText, { exact: true });
78
+
79
+ // Click the mode button
80
+ await button.click();
81
+
82
+ // Ensure it has been clickde and updatedc correctly
83
+ const color = await button.evaluate((el) =>
84
+ window.getComputedStyle(el).getPropertyValue("color"),
85
+ );
86
+ expect(color).toBe("rgb(39, 204, 255)"); // We set hex but it gets computed to rgb
87
+ };
88
+
89
+ export const expectPaths = async ({
90
+ page,
91
+ count,
92
+ }: {
93
+ page: Page;
94
+ count: number;
95
+ }) => {
96
+ const selector = "svg > g > path";
97
+
98
+ if (count > 0) {
99
+ await page.waitForSelector(selector);
100
+ expect(await page.locator(selector).count()).toBe(count);
101
+ } else {
102
+ await expect(await page.locator(selector).count()).toBe(0);
103
+ }
104
+ };
105
+
106
+ export const expectPathDimensions = async ({
107
+ page,
108
+ width,
109
+ height,
110
+ }: {
111
+ page: Page;
112
+ width: number;
113
+ height: number;
114
+ }) => {
115
+ const selector = "svg > g > path";
116
+
117
+ const boundingBox = await page.locator(selector).boundingBox();
118
+
119
+ expect(boundingBox?.width).toBe(width);
120
+ expect(boundingBox?.height).toBe(height);
121
+ };
122
+
123
+ export const expectGroupPosition = async ({
124
+ page,
125
+ x,
126
+ y,
127
+ }: {
128
+ page: Page;
129
+ x: number;
130
+ y: number;
131
+ }) => {
132
+ const selector = "svg > g > path";
133
+
134
+ const boundingBox = await page.locator(selector).boundingBox();
135
+
136
+ expect(boundingBox?.x).toBe(x);
137
+ expect(boundingBox?.y).toBe(y);
138
+ };
139
+
140
+ export const drawRectangularPolygon = async ({
141
+ mapDiv,
142
+ page,
143
+ size = "regular",
144
+ }: {
145
+ mapDiv: {
146
+ x: number;
147
+ y: number;
148
+ width: number;
149
+ height: number;
150
+ };
151
+ page: Page;
152
+ size?: "regular" | "small";
153
+ }) => {
154
+ // Draw a rectangle
155
+ const sideLength = size === "regular" ? 100 : 70;
156
+ const halfLength = sideLength / 2;
157
+ const centerX = mapDiv.width / 2;
158
+ const centerY = mapDiv.height / 2;
159
+ const topLeft = { x: centerX - halfLength, y: centerY - halfLength };
160
+ const topRight = { x: centerX + halfLength, y: centerY - halfLength };
161
+ const bottomLeft = { x: centerX - halfLength, y: centerY + halfLength };
162
+ const bottomRight = { x: centerX + halfLength, y: centerY + halfLength };
163
+ await page.mouse.click(topLeft.x, topLeft.y);
164
+ await page.mouse.click(topRight.x, topRight.y);
165
+ await page.mouse.click(bottomRight.x, bottomRight.y);
166
+ await page.mouse.click(bottomLeft.x, bottomLeft.y);
167
+ await page.mouse.click(bottomLeft.x, bottomLeft.y); // Closed
168
+
169
+ return { topLeft, topRight, bottomRight, bottomLeft };
170
+ };
171
+
172
+ export const drawTwoClickShape = async ({
173
+ mapDiv,
174
+ page,
175
+ }: {
176
+ mapDiv: {
177
+ x: number;
178
+ y: number;
179
+ width: number;
180
+ height: number;
181
+ };
182
+ page: Page;
183
+ }) => {
184
+ // Draw a rectangle
185
+ const sideLength = 100;
186
+ const halfLength = sideLength / 2;
187
+ const centerX = mapDiv.width / 2;
188
+ const centerY = mapDiv.height / 2;
189
+ const topLeft = { x: centerX - halfLength, y: centerY - halfLength };
190
+ const topRight = { x: centerX + halfLength, y: centerY - halfLength };
191
+ const bottomLeft = { x: centerX - halfLength, y: centerY + halfLength };
192
+ const bottomRight = { x: centerX + halfLength, y: centerY + halfLength };
193
+ await page.mouse.click(topLeft.x, topLeft.y);
194
+
195
+ await page.mouse.click(bottomRight.x, bottomRight.y); // Closed
196
+
197
+ return { topLeft, topRight, bottomRight, bottomLeft };
198
+ };
@@ -0,0 +1,36 @@
1
+ const path = require("path");
2
+ const Dotenv = require("dotenv-webpack");
3
+
4
+ module.exports = {
5
+ mode: "development",
6
+ entry: "./src/index.ts",
7
+ devtool: "inline-source-map",
8
+ plugins: [new Dotenv()],
9
+ module: {
10
+ rules: [
11
+ {
12
+ test: /\.tsx?$/,
13
+ use: "ts-loader",
14
+ exclude: /node_modules/,
15
+ },
16
+ ],
17
+ },
18
+ resolve: {
19
+ extensions: [".tsx", ".ts", ".js"],
20
+ },
21
+ output: {
22
+ filename: "bundle.js",
23
+ path: path.resolve(__dirname, "dist"),
24
+ },
25
+ devServer: {
26
+ static: {
27
+ directory: path.join(__dirname, "public"),
28
+ },
29
+ liveReload: !process.env.CI,
30
+ watchFiles: !process.env.CI
31
+ ? ["./src", "./*.{js,json,ts,html}", "../src", "../*.{js,json,ts,html}"]
32
+ : [],
33
+ compress: true,
34
+ port: 3000,
35
+ },
36
+ };
@@ -0,0 +1,17 @@
1
+ console.log("===== Using @swc/jest ======");
2
+
3
+ module.exports = {
4
+ transform: {
5
+ "^.+\\.(t|j)sx?$": "@swc/jest",
6
+ },
7
+ testPathIgnorePatterns: [
8
+ "<rootDir>/node_modules/",
9
+ "<rootDir>/e2e/",
10
+ "<rootDir>/docs/",
11
+ "<rootDir>/coverage/",
12
+ "<rootDir>/scripts/",
13
+ "<rootDir>/guides/",
14
+ ],
15
+ coveragePathIgnorePatterns: ["<rootDir>/src/test/", "<rootDir>/e2e/"],
16
+ setupFilesAfterEnv: ["<rootDir>/src/test/jest.matchers.ts"],
17
+ };
package/package.json CHANGED
@@ -1,88 +1,159 @@
1
1
  {
2
- "name": "terra-draw",
3
- "version": "0.0.1-alpha.9",
4
- "description": "Frictionless map drawing across mapping provider",
5
- "scripts": {
6
- "build": "microbundle",
7
- "watch": "microbundle --watch --format modern",
8
- "test": "jest --config jest.config.ts",
9
- "test:coverage": "jest --config jest.config.ts --coverage",
10
- "test:nocheck": "NO_CHECK=true jest --config jest.config.ts",
11
- "test:nocheck:coverage": "NO_CHECK=true jest --config jest.config.ts --coverage",
12
- "lint": "eslint --ext .ts src/",
13
- "lint:quiet": "eslint --ext .ts --quiet src/",
14
- "lint:fix": "eslint --fix --ext .ts src/",
15
- "lint:fix:quiet": "eslint --fix --quiet --ext .ts src/",
16
- "prepare": "husky install"
17
- },
18
- "type": "module",
19
- "source": "src/terra-draw.ts",
20
- "exports": {
21
- "types": "./dist/terra-draw.d.ts",
22
- "require": "./dist/terra-draw.cjs",
23
- "default": "./dist/terra-draw.modern.js"
24
- },
25
- "types": "./dist/terra-draw.d.ts",
26
- "main": "./dist/terra-draw.cjs",
27
- "module": "./dist/terra-draw.module.js",
28
- "unpkg": "./dist/terra-draw.umd.js",
29
- "author": "James Milner",
30
- "license": "MIT",
31
- "repository": "JamesLMilner/terra-draw",
32
- "devDependencies": {
33
- "@commitlint/cli": "^17.1.2",
34
- "@commitlint/config-conventional": "^17.1.0",
35
- "@googlemaps/js-api-loader": "^1.14.3",
36
- "@swc/jest": "^0.2.22",
37
- "@types/geojson": "^7946.0.8",
38
- "@types/google.maps": "^3.49.2",
39
- "@types/jest": "^28.1.5",
40
- "@types/leaflet": "^1.7.11",
41
- "@types/mapbox-gl": "^2.7.3",
42
- "@types/rbush": "^3.0.0",
43
- "@typescript-eslint/eslint-plugin": "^5.38.1",
44
- "@typescript-eslint/parser": "^5.38.1",
45
- "eslint": "^8.24.0",
46
- "eslint-config-prettier": "^8.5.0",
47
- "eslint-plugin-prettier": "^4.2.1",
48
- "husky": "^7.0.0",
49
- "jest": "^28.1.2",
50
- "leaflet": "^1.8.0",
51
- "mapbox-gl": "^2.9.1",
52
- "microbundle": "^0.15.0",
53
- "serve": "^13.0.4",
54
- "ts-jest": "^28.0.5",
55
- "ts-loader": "^9.3.1",
56
- "typescript": "^4.7.4"
57
- },
58
- "commitlint": {
59
- "extends": [
60
- "@commitlint/config-conventional"
61
- ]
62
- },
63
- "eslintConfig": {
64
- "parser": "@typescript-eslint/parser",
65
- "plugins": [
66
- "@typescript-eslint"
67
- ],
68
- "rules": {
69
- "indent": [
70
- "error",
71
- 4
72
- ],
73
- "semi": [
74
- "error",
75
- "always"
76
- ],
77
- "@typescript-eslint/no-empty-function": "warn"
78
- },
79
- "extends": [
80
- "plugin:@typescript-eslint/recommended",
81
- "prettier"
82
- ]
83
- },
84
- "prettier": {
85
- "printWidth": 80,
86
- "semi": true
87
- }
88
- }
2
+ "name": "terra-draw",
3
+ "version": "1.0.0-beta.1",
4
+ "description": "Frictionless map drawing across mapping provider",
5
+ "scripts": {
6
+ "docs": "typedoc",
7
+ "docs:serve": "serve ./docs",
8
+ "release:beta:increment": "standard-version --prerelease beta",
9
+ "release:beta:changelog": "tsx ./scripts/changelog-valid.ts",
10
+ "release:beta:next": "tsx ./scripts/next-beta-version.ts",
11
+ "build": "microbundle",
12
+ "watch": "microbundle --watch --format modern",
13
+ "test": "jest --config jest.config.ts",
14
+ "test:coverage": "jest --config jest.config.ts --coverage",
15
+ "test:nocheck": "jest --config jest.nocheck.config.ts",
16
+ "test:nocheck:coverage": "jest --config jest.nocheck.config.ts --coverage",
17
+ "lint": "eslint --ext .ts src/",
18
+ "lint:quiet": "eslint --ext .ts --quiet src/",
19
+ "lint:fix": "eslint --fix --ext .ts src/",
20
+ "lint:fix:quiet": "eslint --fix --quiet --ext .ts src/",
21
+ "format": "prettier --ignore-path .gitignore --write \"**/*.+(js|ts|json)\"",
22
+ "format:quiet": "prettier --ignore-path .gitignore --write \"**/*.+(js|ts|json)\" --log-level=silent",
23
+ "prepare": "husky install"
24
+ },
25
+ "type": "module",
26
+ "source": "src/terra-draw.ts",
27
+ "exports": {
28
+ "types": "./dist/terra-draw.d.ts",
29
+ "require": "./dist/terra-draw.cjs",
30
+ "default": "./dist/terra-draw.modern.js"
31
+ },
32
+ "types": "./dist/terra-draw.d.ts",
33
+ "main": "./dist/terra-draw.cjs",
34
+ "module": "./dist/terra-draw.module.js",
35
+ "unpkg": "./dist/terra-draw.umd.js",
36
+ "author": "James Milner",
37
+ "license": "MIT",
38
+ "repository": "JamesLMilner/terra-draw",
39
+ "keywords": [
40
+ "map",
41
+ "drawing",
42
+ "draw",
43
+ "map drawing",
44
+ "geometry",
45
+ "leaflet",
46
+ "leafletjs",
47
+ "mapbox",
48
+ "mapboxgl",
49
+ "google maps",
50
+ "openlayers",
51
+ "maplibre"
52
+ ],
53
+ "devDependencies": {
54
+ "@arcgis/core": "4.27.6",
55
+ "@commitlint/cli": "17.1.2",
56
+ "@commitlint/config-conventional": "17.1.0",
57
+ "@googlemaps/js-api-loader": "1.14.3",
58
+ "@swc/jest": "0.2.36",
59
+ "@types/geojson": "7946.0.8",
60
+ "@types/google.maps": "3.49.2",
61
+ "@types/jest": "29.5.12",
62
+ "@types/leaflet": "^1.9.12",
63
+ "@types/mapbox-gl": "2.7.3",
64
+ "@types/rbush": "3.0.0",
65
+ "@typescript-eslint/eslint-plugin": "7.14.1",
66
+ "@typescript-eslint/parser": "7.14.1",
67
+ "eslint": "8.57.0",
68
+ "eslint-config-prettier": "9.0.0",
69
+ "eslint-plugin-prettier": "5.0.0",
70
+ "husky": "7.0.0",
71
+ "jest": "29.7.0",
72
+ "jest-environment-jsdom": "29.7.0",
73
+ "leaflet": "^1.9.4",
74
+ "mapbox-gl": "2.13.0",
75
+ "maplibre-gl": "3.2.0",
76
+ "microbundle": "0.15.0",
77
+ "ol": "10.0.0",
78
+ "serve": "14.1.2",
79
+ "standard-version": "9.5.0",
80
+ "ts-jest": "29.1.2",
81
+ "ts-loader": "9.5.1",
82
+ "tsx": "4.7.2",
83
+ "typedoc": "^0.26.2",
84
+ "typescript": "5.5.2"
85
+ },
86
+ "commitlint": {
87
+ "extends": [
88
+ "@commitlint/config-conventional"
89
+ ]
90
+ },
91
+ "eslintConfig": {
92
+ "parser": "@typescript-eslint/parser",
93
+ "plugins": [
94
+ "@typescript-eslint"
95
+ ],
96
+ "rules": {
97
+ "@typescript-eslint/no-empty-function": "warn",
98
+ "@typescript-eslint/no-explicit-any": "warn"
99
+ },
100
+ "extends": [
101
+ "plugin:@typescript-eslint/recommended",
102
+ "prettier"
103
+ ]
104
+ },
105
+ "prettier": {
106
+ "printWidth": 80,
107
+ "semi": true,
108
+ "useTabs": true
109
+ },
110
+ "standard-version": {
111
+ "types": [
112
+ {
113
+ "type": "feat",
114
+ "section": "Features"
115
+ },
116
+ {
117
+ "type": "fix",
118
+ "section": "Bug Fixes"
119
+ },
120
+ {
121
+ "type": "docs",
122
+ "section": "Documentation"
123
+ },
124
+ {
125
+ "type": "style",
126
+ "section": "Styling"
127
+ },
128
+ {
129
+ "type": "refactor",
130
+ "section": "Refactors"
131
+ },
132
+ {
133
+ "type": "perf",
134
+ "section": "Performance"
135
+ },
136
+ {
137
+ "type": "test",
138
+ "section": "Tests"
139
+ },
140
+ {
141
+ "type": "build",
142
+ "section": "Build System"
143
+ },
144
+ {
145
+ "type": "ci",
146
+ "section": "CI"
147
+ },
148
+ {
149
+ "type": "chore",
150
+ "section": "Chore"
151
+ },
152
+ {
153
+ "type": "revert",
154
+ "section": "Reverts"
155
+ }
156
+ ]
157
+ },
158
+ "sideEffects": false
159
+ }
package/readme.gif ADDED
Binary file
package/tsconfig.json CHANGED
@@ -1,14 +1,27 @@
1
1
  {
2
- "compilerOptions": {
3
- "outDir": "./dist/",
4
- "strict": true,
5
- "noImplicitAny": true,
6
- "module": "es6",
7
- "target": "es6",
8
- "jsx": "react",
9
- "sourceMap": true,
10
- "allowJs": true,
11
- "moduleResolution": "node",
12
- "allowSyntheticDefaultImports": true
13
- }
2
+ "compilerOptions": {
3
+ "outDir": "./dist/",
4
+ "strict": true,
5
+ "module": "es6",
6
+ "target": "es6",
7
+ "jsx": "react",
8
+ "sourceMap": true,
9
+ "allowJs": true,
10
+ "moduleResolution": "node",
11
+ "allowSyntheticDefaultImports": true
12
+ },
13
+ "typedocOptions": {
14
+ "entryPoints": ["src/terra-draw.ts"],
15
+ "exclude": ["src/geometry/**/*.ts", "src/test/**/*.ts", "src/util/**/*.ts"],
16
+ "out": "docs",
17
+ "skipErrorChecking": true
18
+ },
19
+ "exclude": [
20
+ "node_modules/",
21
+ "guides/",
22
+ "docs/",
23
+ "dist/",
24
+ "development/dist",
25
+ "development/node_modules"
26
+ ]
14
27
  }
@@ -1,36 +0,0 @@
1
- Contributor Covenant Code of Conduct
2
- Our Pledge
3
- In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
4
-
5
- Our Standards
6
- Examples of behavior that contributes to creating a positive environment include:
7
-
8
- Using welcoming and inclusive language
9
- Being respectful of differing viewpoints and experiences
10
- Gracefully accepting constructive criticism
11
- Focusing on what is best for the community
12
- Showing empathy towards other community members
13
- Examples of unacceptable behavior by participants include:
14
-
15
- The use of sexualized language or imagery and unwelcome sexual attention or advances
16
- Trolling, insulting/derogatory comments, and personal or political attacks
17
- Public or private harassment
18
- Publishing others' private information, such as a physical or electronic address, without explicit permission
19
- Other conduct which could reasonably be considered inappropriate in a professional setting
20
- Our Responsibilities
21
- Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
22
-
23
- Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
24
-
25
- Scope
26
- This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
27
-
28
- Enforcement
29
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at codeofconduct@loxo.industries. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
30
-
31
- Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
32
-
33
- Attribution
34
- This Code of Conduct is adapted from the Contributor Covenant, version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
35
-
36
- For answers to common questions about this code of conduct, see https://www.contributor-covenant.org/faq
package/CONTRIBUTING.md DELETED
@@ -1,17 +0,0 @@
1
- # Contributing
2
-
3
- ## Instructions
4
-
5
- This document will receive a more thorough update in the future. For the time being, if you wish to contribute to Terra Draw, we request that you:
6
-
7
- 1) Make an issue on GitHub describing the bug you intend to fix or the feature you intend to add.
8
- 2) Create a fork of the project, and work on a branch that represents the issue
9
- 3) Ensure that the work you have done is unit tested, aiming for 80% code coverage
10
- 4) Create a PR that represents this work. Please refer to the issue from the PR
11
- 5) We will address the PR and give you feedback
12
-
13
- Please note that we can not garauntee that all PRs will be merged. There are cases where a PR may deviate from the long-term vision for Terra Draw and hence we may have to decline it. Creating the issue in advance helps us discuss any potential issues upfront before the PR is made.
14
-
15
- ## Code of Conduct
16
-
17
- We have a code of conduct which we expect individuals interacting with the project to respect. Please see the [full Code of Conduct in the repository](./CODE_OF_CONDUCT.md).