···194Goal: determine what the cursor is over.
195196Geometry (/packages/core/src/geom):
197-[ ] shapeBounds(shape) -> Box2
198-[ ] pointInRect(p, rectShape) -> bool
199-[ ] pointInEllipse(p, ellipseShape) -> bool
200-[ ] pointNearSegment(p, a, b, tolerance) -> bool
201-[ ] hitTestPoint(state, worldPoint) -> shapeId? (topmost wins)
202203Layering:
204-[ ] Define draw order = page.shapeIds order
205-[ ] hitTest uses reverse order for topmost selection
206207Tests:
208-[ ] hitTestPoint returns expected shapeId for overlapping shapes
209-[ ] tolerance works for line/arrow selection
210211(DoD):
212- You can hover shapes and log the hit shape id (no selection yet).
213-214215==============================================================================
2167. Milestone G: Input system (pointer + keyboard) *wb-G*
···194Goal: determine what the cursor is over.
195196Geometry (/packages/core/src/geom):
197+[x] shapeBounds(shape) -> Box2
198+[x] pointInRect(p, rectShape) -> bool
199+[x] pointInEllipse(p, ellipseShape) -> bool
200+[x] pointNearSegment(p, a, b, tolerance) -> bool
201+[x] hitTestPoint(state, worldPoint) -> shapeId? (topmost wins)
202203Layering:
204+[x] Define draw order = page.shapeIds order
205+[x] hitTest uses reverse order for topmost selection
206207Tests:
208+[x] hitTestPoint returns expected shapeId for overlapping shapes
209+[x] tolerance works for line/arrow selection
210211(DoD):
212- You can hover shapes and log the hit shape id (no selection yet).
0213214==============================================================================
2157. Milestone G: Input system (pointer + keyboard) *wb-G*
···78# Miscellaneous
9/static/
10+11+# TS covered by dprint
12+**/*.ts
13+**/*.js
-38
apps/web/README.md
···1-# sv
2-3-Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli).
4-5-## Creating a project
6-7-If you're seeing this, you've probably already done this step. Congrats!
8-9-```sh
10-# create a new project in the current directory
11-npx sv create
12-13-# create a new project in my-app
14-npx sv create my-app
15-```
16-17-## Developing
18-19-Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
20-21-```sh
22-npm run dev
23-24-# or start the server and open the app in a new browser tab
25-npm run dev -- --open
26-```
27-28-## Building
29-30-To create a production version of your app:
31-32-```sh
33-npm run build
34-```
35-36-You can preview the production build with `npm run preview`.
37-38-> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
···00000000000000000000000000000000000000
+30-36
apps/web/eslint.config.js
···1-import prettier from 'eslint-config-prettier';
2-import { fileURLToPath } from 'node:url';
3-import { includeIgnoreFile } from '@eslint/compat';
4-import js from '@eslint/js';
5-import svelte from 'eslint-plugin-svelte';
6-import { defineConfig } from 'eslint/config';
7-import globals from 'globals';
8-import ts from 'typescript-eslint';
9-import svelteConfig from './svelte.config.js';
1011-const gitignorePath = fileURLToPath(new URL('./.gitignore', import.meta.url));
1213export default defineConfig(
14- includeIgnoreFile(gitignorePath),
15- js.configs.recommended,
16- ...ts.configs.recommended,
17- ...svelte.configs.recommended,
18- prettier,
19- ...svelte.configs.prettier,
20- {
21- languageOptions: { globals: { ...globals.browser, ...globals.node } },
22-23- rules: {
24- // typescript-eslint strongly recommend that you do not use the no-undef lint rule on TypeScript projects.
25- // see: https://typescript-eslint.io/troubleshooting/faqs/eslint/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
26- "no-undef": 'off'
27- }
28- },
29- {
30- files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'],
3132- languageOptions: {
33- parserOptions: {
34- projectService: true,
35- extraFileExtensions: ['.svelte'],
36- parser: ts.parser,
37- svelteConfig
38- }
39- }
40- }
00041);
···1+import { includeIgnoreFile } from "@eslint/compat";
2+import js from "@eslint/js";
3+import prettier from "eslint-config-prettier";
4+import svelte from "eslint-plugin-svelte";
5+import { defineConfig } from "eslint/config";
6+import globals from "globals";
7+import { fileURLToPath } from "node:url";
8+import ts from "typescript-eslint";
9+import svelteConfig from "./svelte.config.js";
1011+const gitignorePath = fileURLToPath(new URL("./.gitignore", import.meta.url));
1213export default defineConfig(
14+ includeIgnoreFile(gitignorePath),
15+ js.configs.recommended,
16+ ...ts.configs.recommended,
17+ ...svelte.configs.recommended,
18+ prettier,
19+ ...svelte.configs.prettier,
20+ {
21+ languageOptions: { globals: { ...globals.browser, ...globals.node } },
0000000002223+ rules: {
24+ // typescript-eslint strongly recommend that you do not use the no-undef lint rule on TypeScript projects.
25+ // see: https://typescript-eslint.io/troubleshooting/faqs/eslint/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
26+ "no-undef": "off",
27+ },
28+ },
29+ {
30+ files: ["**/*.svelte", "**/*.svelte.ts", "**/*.svelte.js"],
31+ languageOptions: {
32+ parserOptions: { projectService: true, extraFileExtensions: [".svelte"], parser: ts.parser, svelteConfig },
33+ },
34+ },
35);