Files
modeling-app/src/machines/modelingMachine.ts

2035 lines
66 KiB
TypeScript
Raw Normal View History

import {
PathToNode,
VariableDeclaration,
VariableDeclarator,
parse,
recast,
} from 'lang/wasm'
import { Axis, Selection, Selections, updateSelections } from 'lib/selections'
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
import { assign, fromPromise, setup } from 'xstate'
import { SidebarType } from 'components/ModelingSidebar/ModelingPanes'
Symbols overlay (#2033) * start of overlay work * add new icons * add constraint symbols * add three dots * add primary colours * refactor how we get constraint info for overlays * refactor how we get constraint info for overlays * get symbols working for tangential arc too * extra data on constraint info * add initial delete * fix types and circular dep issue after rebase * fix quirk with horz vert line overlays * fix setup and tear down of overlays * remove overlays that are too small * throttle overlay updates and prove tests selecting html instead of hardcoded px coords * initial show overaly on segment hover * remove overlays when tool is equipped * dounce overlay updates * tsc * make higlighting robust to small changes in source ranges * replace with variable for unconstrained values, and improve styles for popover * background tweak * make overlays unconstrain inputs * fix small regression * write query for finding related tag references * make delete segment safe * typo * un used imports * test deleteSegmentFromPipeExpression * add getConstraintInfo test * test removeSingleConstraintInfo * more tests * tsc * add tests for overlay buttons * rename tests * fmt * better naming structure * more reliablity * more test tweaks * fix selection test * add delete segments with overlays tests * dependant tag tests for segment delet * typo * test clean up * fix some perf issus * clean up * clean up * make things a little more dry * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * trigger ci * Make constraint hover popovers readable on light mode * Touch up the new variable dialog * Little touch-up to three-dot menu style * fix highlight issue * fmt * use optional chain * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)" This reverts commit be3d61e4a303b0d9a792dddbfe8430cc58d46451. * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * disable var panel in sketch mode * fix overlay tests after mergi in main * test tweak * try fix ubuntu * fmt * more test tweaks * tweak * tweaks --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Frank Noirot <frank@kittycad.io>
2024-05-24 20:54:42 +10:00
import {
isNodeSafeToReplacePath,
getNodePathFromSourceRange,
} from 'lang/queryAst'
2024-03-28 17:22:11 +11:00
import {
kclManager,
sceneInfra,
sceneEntitiesManager,
engineCommandManager,
editorManager,
2024-03-28 17:22:11 +11:00
} from 'lib/singletons'
xstate migration (#713) * Add basic Popover functionality * Fix up light mode of basic bar * Add support for 2D and 3D mode styling * Turn toolbar buttons back on * Remove ActionButton until after tool logic refactor * Add transitions * Add initial modeling machine This is not a full description of how the modelingMachine should work, but begins to replicate all of the features of our useStore in XState instead of zustand. * Add fillet tool flow * Refactor: break out engine manager setup into hook Preparing for making a wrapper component around the App that will manage the engine manager at the same level as the modelingMachine. * Create modeling provider, move engine management to it * Refactor: move other engine-related useEffect into hook * Add TS schema, selection actions to modelingMachine * Add barebones modeling machine to app Only implementing adding to code-based selections in the text editor so far * Update moved useEffect hook after merge * give myself reminder TODO * fix engineCommandManager waitForReady Promise * enable devtools * make utility class for handling default planes * progresson startNewSketch and EditSketch * add provider to tests * too large of a commit put all of the lang state into another singleton, but did lots of work on xstate too * fix edit sketch ast issue * re-execute on sketch exit * prettierignore xstate typegen file * add move tool button back in * handle mouse commands with xState states * fix move * remove old imports * big useStore delete * fix some destructuring bugs * start of constraint actions * add horizontal/vertical distance constraints * fix more destructuring errors * fix * add angle constaints * add align vertically/horizontally constraints * add length and equal length constraints * rename modal states to be more cmd bar friendly * add doesPipeHave query * add another query * add extrude states * state machine clean up * xstate layout tweak * make xstate types happy * Revamp cursor logic and place curors after ast mod * Xstate merge (#796) * turning back on all planes (#720) * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix more tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> fix stdlib Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> compile Signed-off-by: Jess Frazelle <github@jessfraz.com> update sample code Signed-off-by: Jess Frazelle <github@jessfraz.com> re-enable the planes Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> fix all tests Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> boilerplate Signed-off-by: Jess Frazelle <github@jessfraz.com> Cut release v0.9.2 (#714) rust make default planes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> use the planes from engine Signed-off-by: Jess Frazelle <github@jessfraz.com> fixups Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> negative args Signed-off-by: Jess Frazelle <github@jessfraz.com> diable camera Signed-off-by: Jess Frazelle <github@jessfraz.com> hide planes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updatress Signed-off-by: Jess Frazelle <github@jessfraz.com> fmt Signed-off-by: Jess Frazelle <github@jessfraz.com> Update src/hooks/useAppMode.ts Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch> Update src/hooks/useAppMode.ts Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch> cleanups Signed-off-by: Jess Frazelle <github@jessfraz.com> Bump kittycad from 0.2.26 to 0.2.27 in /src-tauri (#726) Bumps [kittycad](https://github.com/KittyCAD/kittycad.rs) from 0.2.26 to 0.2.27. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/v0.2.26...v0.2.27) --- updated-dependencies: - dependency-name: kittycad dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump tauri-plugin-fs-extra from `b04bde3` to `6c7a4c0` in /src-tauri (#725) Bumps [tauri-plugin-fs-extra](https://github.com/tauri-apps/plugins-workspace) from `b04bde3` to `6c7a4c0`. - [Release notes](https://github.com/tauri-apps/plugins-workspace/releases) - [Commits](https://github.com/tauri-apps/plugins-workspace/compare/b04bde3461066c709d6801cf9ca305cf889a8394...6c7a4c09847f9659f9393a1412fa59bebd7c2004) --- updated-dependencies: - dependency-name: tauri-plugin-fs-extra dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump toml from 0.8.0 to 0.8.1 in /src-tauri (#724) Bumps [toml](https://github.com/toml-rs/toml) from 0.8.0 to 0.8.1. - [Commits](https://github.com/toml-rs/toml/compare/toml-v0.8.0...toml-v0.8.1) --- updated-dependencies: - dependency-name: toml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump openapitor from `61a1605` to `d3e98c4` in /src/wasm-lib (#723) Bumps [openapitor](https://github.com/KittyCAD/kittycad.rs) from `61a1605` to `d3e98c4`. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/61a16059b3eaf8793a2a2e1edbc0d770f284fea3...d3e98c4ec0ff7c307d66378eab1c4630250ec210) --- updated-dependencies: - dependency-name: openapitor dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump kittycad from 0.2.26 to 0.2.27 in /src/wasm-lib (#722) Bumps [kittycad](https://github.com/KittyCAD/kittycad.rs) from 0.2.26 to 0.2.27. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/v0.2.26...v0.2.27) --- updated-dependencies: - dependency-name: kittycad dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump thiserror from 1.0.48 to 1.0.49 in /src/wasm-lib (#721) Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.48 to 1.0.49. - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](https://github.com/dtolnay/thiserror/compare/1.0.48...1.0.49) --- updated-dependencies: - dependency-name: thiserror dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump expectorate from 1.0.7 to 1.1.0 in /src/wasm-lib (#712) Bumps [expectorate](https://github.com/oxidecomputer/expectorate) from 1.0.7 to 1.1.0. - [Release notes](https://github.com/oxidecomputer/expectorate/releases) - [Commits](https://github.com/oxidecomputer/expectorate/compare/v1.0.7...v1.1.0) --- updated-dependencies: - dependency-name: expectorate dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump clap from 4.4.4 to 4.4.5 in /src/wasm-lib (#711) Bumps [clap](https://github.com/clap-rs/clap) from 4.4.4 to 4.4.5. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.4.4...v4.4.5) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> refactor cleanup Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> type improvements * use new sketchmode no camera Signed-off-by: Jess Frazelle <github@jessfraz.com> * js working better Signed-off-by: Jess Frazelle <github@jessfraz.com> * start of negative planes Signed-off-by: Jess Frazelle <github@jessfraz.com> * tests and neg Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * images Signed-off-by: Jess Frazelle <github@jessfraz.com> * norma;s Signed-off-by: Jess Frazelle <github@jessfraz.com> * better initial load of planes Signed-off-by: Jess Frazelle <github@jessfraz.com> * ts Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix tsc Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix edit sketch Signed-off-by: Jess Frazelle <github@jessfraz.com> * add regression test for 2d solid issue Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * show planes Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix clippy Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> * canecel in progress Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix ci as well Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> * stopping point Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * refactor Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * it works Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * Hide planes (#797) * hide planes in one go Signed-off-by: Jess Frazelle <github@jessfraz.com> * update hide; Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> * make tsc happy * Make "Replay Onboarding" button available on home settings page (#804) * Fix unrelated bug, settings button in the home sidebar doesn't go to the home settings after my previous fixes to routes * Turn on "Replay Onboarding" button in home settings * Use ONBOARDING_PROJECT_NAME in both places * Fix formatting * Cut release v0.10.0 (#803) Co-authored-by: Frank Noirot <frank@kittycad.io> * Bump kittycad from 0.2.28 to 0.2.31 in /src-tauri (#798) Bumps [kittycad](https://github.com/KittyCAD/kittycad.rs) from 0.2.28 to 0.2.31. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/v0.2.28...v0.2.31) --- updated-dependencies: - dependency-name: kittycad dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump openapitor from `fa0345c` to `c122a9b` in /src/wasm-lib (#800) Bumps [openapitor](https://github.com/KittyCAD/kittycad.rs) from `fa0345c` to `c122a9b`. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/fa0345c514fcc9ae6cd74ae35c8e5c2800fec34f...c122a9b1d6afe51c25e545b5e0bbeb91d367e6d2) --- updated-dependencies: - dependency-name: openapitor dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump syn from 2.0.37 to 2.0.38 in /src/wasm-lib (#801) Bumps [syn](https://github.com/dtolnay/syn) from 2.0.37 to 2.0.38. - [Release notes](https://github.com/dtolnay/syn/releases) - [Commits](https://github.com/dtolnay/syn/compare/2.0.37...2.0.38) --- updated-dependencies: - dependency-name: syn dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump winnow from 0.5.15 to 0.5.16 in /src/wasm-lib (#799) Bumps [winnow](https://github.com/winnow-rs/winnow) from 0.5.15 to 0.5.16. - [Changelog](https://github.com/winnow-rs/winnow/blob/main/CHANGELOG.md) - [Commits](https://github.com/winnow-rs/winnow/compare/v0.5.15...v0.5.16) --- updated-dependencies: - dependency-name: winnow dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump tauri-plugin-fs-extra from `fa32d1a` to `9f27e6e` in /src-tauri (#802) Bumps [tauri-plugin-fs-extra](https://github.com/tauri-apps/plugins-workspace) from `fa32d1a` to `9f27e6e`. - [Release notes](https://github.com/tauri-apps/plugins-workspace/releases) - [Commits](https://github.com/tauri-apps/plugins-workspace/compare/fa32d1afa97f52f74d814c5619b8d95da3268e3e...9f27e6e4415ddf6c40f846d50c0d95c768cded77) --- updated-dependencies: - dependency-name: tauri-plugin-fs-extra dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * better plane selection Signed-off-by: Jess Frazelle <github@jessfraz.com> * use the sketch plane id Signed-off-by: Jess Frazelle <github@jessfraz.com> * add todo w bug Signed-off-by: Jess Frazelle <github@jessfraz.com> * Improve Prop Typings for Modals. Remove instances of `any`. (#792) * Update typings for modals. Remove instances of `any` * Fix generic type for creating modals * cleanup other stuffs Signed-off-by: Jess Frazelle <github@jessfraz.com> * make plane id available when selecting default plane * few clean up things * change enter sketch action order to make sure plane id is available to 'enter edit mode' * Revert "Improve Prop Typings for Modals. Remove instances of `any`. (… (#813) Revert "Improve Prop Typings for Modals. Remove instances of `any`. (#792)" This reverts commit 629f326f4cdf13d83a62f471b4b9a40d3c3a2a88. * ffmpeg instructions (#814) * fix some tsc stuff * small tweak --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jason Rametta <rametta@outlook.com> * clean up * fix test and tsc * remove one more thing from useStore * tweak state digrame layout * fmt --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Frank Johnson <frankjohnson1993@gmail.com> Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jason Rametta <rametta@outlook.com>
2023-10-11 13:36:54 +11:00
import {
horzVertInfo,
applyConstraintHorzVert,
} from 'components/Toolbar/HorzVert'
import {
applyConstraintHorzVertAlign,
horzVertDistanceInfo,
} from 'components/Toolbar/SetHorzVertDistance'
import { angleBetweenInfo } from 'components/Toolbar/SetAngleBetween'
import { angleLengthInfo } from 'components/Toolbar/setAngleLength'
xstate migration (#713) * Add basic Popover functionality * Fix up light mode of basic bar * Add support for 2D and 3D mode styling * Turn toolbar buttons back on * Remove ActionButton until after tool logic refactor * Add transitions * Add initial modeling machine This is not a full description of how the modelingMachine should work, but begins to replicate all of the features of our useStore in XState instead of zustand. * Add fillet tool flow * Refactor: break out engine manager setup into hook Preparing for making a wrapper component around the App that will manage the engine manager at the same level as the modelingMachine. * Create modeling provider, move engine management to it * Refactor: move other engine-related useEffect into hook * Add TS schema, selection actions to modelingMachine * Add barebones modeling machine to app Only implementing adding to code-based selections in the text editor so far * Update moved useEffect hook after merge * give myself reminder TODO * fix engineCommandManager waitForReady Promise * enable devtools * make utility class for handling default planes * progresson startNewSketch and EditSketch * add provider to tests * too large of a commit put all of the lang state into another singleton, but did lots of work on xstate too * fix edit sketch ast issue * re-execute on sketch exit * prettierignore xstate typegen file * add move tool button back in * handle mouse commands with xState states * fix move * remove old imports * big useStore delete * fix some destructuring bugs * start of constraint actions * add horizontal/vertical distance constraints * fix more destructuring errors * fix * add angle constaints * add align vertically/horizontally constraints * add length and equal length constraints * rename modal states to be more cmd bar friendly * add doesPipeHave query * add another query * add extrude states * state machine clean up * xstate layout tweak * make xstate types happy * Revamp cursor logic and place curors after ast mod * Xstate merge (#796) * turning back on all planes (#720) * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix more tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> fix stdlib Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> compile Signed-off-by: Jess Frazelle <github@jessfraz.com> update sample code Signed-off-by: Jess Frazelle <github@jessfraz.com> re-enable the planes Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> fix all tests Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> boilerplate Signed-off-by: Jess Frazelle <github@jessfraz.com> Cut release v0.9.2 (#714) rust make default planes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> use the planes from engine Signed-off-by: Jess Frazelle <github@jessfraz.com> fixups Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> negative args Signed-off-by: Jess Frazelle <github@jessfraz.com> diable camera Signed-off-by: Jess Frazelle <github@jessfraz.com> hide planes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updatress Signed-off-by: Jess Frazelle <github@jessfraz.com> fmt Signed-off-by: Jess Frazelle <github@jessfraz.com> Update src/hooks/useAppMode.ts Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch> Update src/hooks/useAppMode.ts Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch> cleanups Signed-off-by: Jess Frazelle <github@jessfraz.com> Bump kittycad from 0.2.26 to 0.2.27 in /src-tauri (#726) Bumps [kittycad](https://github.com/KittyCAD/kittycad.rs) from 0.2.26 to 0.2.27. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/v0.2.26...v0.2.27) --- updated-dependencies: - dependency-name: kittycad dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump tauri-plugin-fs-extra from `b04bde3` to `6c7a4c0` in /src-tauri (#725) Bumps [tauri-plugin-fs-extra](https://github.com/tauri-apps/plugins-workspace) from `b04bde3` to `6c7a4c0`. - [Release notes](https://github.com/tauri-apps/plugins-workspace/releases) - [Commits](https://github.com/tauri-apps/plugins-workspace/compare/b04bde3461066c709d6801cf9ca305cf889a8394...6c7a4c09847f9659f9393a1412fa59bebd7c2004) --- updated-dependencies: - dependency-name: tauri-plugin-fs-extra dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump toml from 0.8.0 to 0.8.1 in /src-tauri (#724) Bumps [toml](https://github.com/toml-rs/toml) from 0.8.0 to 0.8.1. - [Commits](https://github.com/toml-rs/toml/compare/toml-v0.8.0...toml-v0.8.1) --- updated-dependencies: - dependency-name: toml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump openapitor from `61a1605` to `d3e98c4` in /src/wasm-lib (#723) Bumps [openapitor](https://github.com/KittyCAD/kittycad.rs) from `61a1605` to `d3e98c4`. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/61a16059b3eaf8793a2a2e1edbc0d770f284fea3...d3e98c4ec0ff7c307d66378eab1c4630250ec210) --- updated-dependencies: - dependency-name: openapitor dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump kittycad from 0.2.26 to 0.2.27 in /src/wasm-lib (#722) Bumps [kittycad](https://github.com/KittyCAD/kittycad.rs) from 0.2.26 to 0.2.27. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/v0.2.26...v0.2.27) --- updated-dependencies: - dependency-name: kittycad dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump thiserror from 1.0.48 to 1.0.49 in /src/wasm-lib (#721) Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.48 to 1.0.49. - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](https://github.com/dtolnay/thiserror/compare/1.0.48...1.0.49) --- updated-dependencies: - dependency-name: thiserror dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump expectorate from 1.0.7 to 1.1.0 in /src/wasm-lib (#712) Bumps [expectorate](https://github.com/oxidecomputer/expectorate) from 1.0.7 to 1.1.0. - [Release notes](https://github.com/oxidecomputer/expectorate/releases) - [Commits](https://github.com/oxidecomputer/expectorate/compare/v1.0.7...v1.1.0) --- updated-dependencies: - dependency-name: expectorate dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump clap from 4.4.4 to 4.4.5 in /src/wasm-lib (#711) Bumps [clap](https://github.com/clap-rs/clap) from 4.4.4 to 4.4.5. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.4.4...v4.4.5) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> refactor cleanup Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> type improvements * use new sketchmode no camera Signed-off-by: Jess Frazelle <github@jessfraz.com> * js working better Signed-off-by: Jess Frazelle <github@jessfraz.com> * start of negative planes Signed-off-by: Jess Frazelle <github@jessfraz.com> * tests and neg Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * images Signed-off-by: Jess Frazelle <github@jessfraz.com> * norma;s Signed-off-by: Jess Frazelle <github@jessfraz.com> * better initial load of planes Signed-off-by: Jess Frazelle <github@jessfraz.com> * ts Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix tsc Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix edit sketch Signed-off-by: Jess Frazelle <github@jessfraz.com> * add regression test for 2d solid issue Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * show planes Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix clippy Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> * canecel in progress Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix ci as well Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> * stopping point Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * refactor Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * it works Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * Hide planes (#797) * hide planes in one go Signed-off-by: Jess Frazelle <github@jessfraz.com> * update hide; Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> * make tsc happy * Make "Replay Onboarding" button available on home settings page (#804) * Fix unrelated bug, settings button in the home sidebar doesn't go to the home settings after my previous fixes to routes * Turn on "Replay Onboarding" button in home settings * Use ONBOARDING_PROJECT_NAME in both places * Fix formatting * Cut release v0.10.0 (#803) Co-authored-by: Frank Noirot <frank@kittycad.io> * Bump kittycad from 0.2.28 to 0.2.31 in /src-tauri (#798) Bumps [kittycad](https://github.com/KittyCAD/kittycad.rs) from 0.2.28 to 0.2.31. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/v0.2.28...v0.2.31) --- updated-dependencies: - dependency-name: kittycad dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump openapitor from `fa0345c` to `c122a9b` in /src/wasm-lib (#800) Bumps [openapitor](https://github.com/KittyCAD/kittycad.rs) from `fa0345c` to `c122a9b`. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/fa0345c514fcc9ae6cd74ae35c8e5c2800fec34f...c122a9b1d6afe51c25e545b5e0bbeb91d367e6d2) --- updated-dependencies: - dependency-name: openapitor dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump syn from 2.0.37 to 2.0.38 in /src/wasm-lib (#801) Bumps [syn](https://github.com/dtolnay/syn) from 2.0.37 to 2.0.38. - [Release notes](https://github.com/dtolnay/syn/releases) - [Commits](https://github.com/dtolnay/syn/compare/2.0.37...2.0.38) --- updated-dependencies: - dependency-name: syn dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump winnow from 0.5.15 to 0.5.16 in /src/wasm-lib (#799) Bumps [winnow](https://github.com/winnow-rs/winnow) from 0.5.15 to 0.5.16. - [Changelog](https://github.com/winnow-rs/winnow/blob/main/CHANGELOG.md) - [Commits](https://github.com/winnow-rs/winnow/compare/v0.5.15...v0.5.16) --- updated-dependencies: - dependency-name: winnow dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump tauri-plugin-fs-extra from `fa32d1a` to `9f27e6e` in /src-tauri (#802) Bumps [tauri-plugin-fs-extra](https://github.com/tauri-apps/plugins-workspace) from `fa32d1a` to `9f27e6e`. - [Release notes](https://github.com/tauri-apps/plugins-workspace/releases) - [Commits](https://github.com/tauri-apps/plugins-workspace/compare/fa32d1afa97f52f74d814c5619b8d95da3268e3e...9f27e6e4415ddf6c40f846d50c0d95c768cded77) --- updated-dependencies: - dependency-name: tauri-plugin-fs-extra dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * better plane selection Signed-off-by: Jess Frazelle <github@jessfraz.com> * use the sketch plane id Signed-off-by: Jess Frazelle <github@jessfraz.com> * add todo w bug Signed-off-by: Jess Frazelle <github@jessfraz.com> * Improve Prop Typings for Modals. Remove instances of `any`. (#792) * Update typings for modals. Remove instances of `any` * Fix generic type for creating modals * cleanup other stuffs Signed-off-by: Jess Frazelle <github@jessfraz.com> * make plane id available when selecting default plane * few clean up things * change enter sketch action order to make sure plane id is available to 'enter edit mode' * Revert "Improve Prop Typings for Modals. Remove instances of `any`. (… (#813) Revert "Improve Prop Typings for Modals. Remove instances of `any`. (#792)" This reverts commit 629f326f4cdf13d83a62f471b4b9a40d3c3a2a88. * ffmpeg instructions (#814) * fix some tsc stuff * small tweak --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jason Rametta <rametta@outlook.com> * clean up * fix test and tsc * remove one more thing from useStore * tweak state digrame layout * fmt --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Frank Johnson <frankjohnson1993@gmail.com> Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jason Rametta <rametta@outlook.com>
2023-10-11 13:36:54 +11:00
import {
applyConstraintEqualLength,
setEqualLengthInfo,
} from 'components/Toolbar/EqualLength'
import {
deleteFromSelection,
extrudeSketch,
revolveSketch,
} from 'lang/modifyAst'
import { applyFilletToSelection } from 'lang/modifyAst/addFillet'
xstate migration (#713) * Add basic Popover functionality * Fix up light mode of basic bar * Add support for 2D and 3D mode styling * Turn toolbar buttons back on * Remove ActionButton until after tool logic refactor * Add transitions * Add initial modeling machine This is not a full description of how the modelingMachine should work, but begins to replicate all of the features of our useStore in XState instead of zustand. * Add fillet tool flow * Refactor: break out engine manager setup into hook Preparing for making a wrapper component around the App that will manage the engine manager at the same level as the modelingMachine. * Create modeling provider, move engine management to it * Refactor: move other engine-related useEffect into hook * Add TS schema, selection actions to modelingMachine * Add barebones modeling machine to app Only implementing adding to code-based selections in the text editor so far * Update moved useEffect hook after merge * give myself reminder TODO * fix engineCommandManager waitForReady Promise * enable devtools * make utility class for handling default planes * progresson startNewSketch and EditSketch * add provider to tests * too large of a commit put all of the lang state into another singleton, but did lots of work on xstate too * fix edit sketch ast issue * re-execute on sketch exit * prettierignore xstate typegen file * add move tool button back in * handle mouse commands with xState states * fix move * remove old imports * big useStore delete * fix some destructuring bugs * start of constraint actions * add horizontal/vertical distance constraints * fix more destructuring errors * fix * add angle constaints * add align vertically/horizontally constraints * add length and equal length constraints * rename modal states to be more cmd bar friendly * add doesPipeHave query * add another query * add extrude states * state machine clean up * xstate layout tweak * make xstate types happy * Revamp cursor logic and place curors after ast mod * Xstate merge (#796) * turning back on all planes (#720) * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix more tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> fix stdlib Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> compile Signed-off-by: Jess Frazelle <github@jessfraz.com> update sample code Signed-off-by: Jess Frazelle <github@jessfraz.com> re-enable the planes Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> fix all tests Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> boilerplate Signed-off-by: Jess Frazelle <github@jessfraz.com> Cut release v0.9.2 (#714) rust make default planes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> use the planes from engine Signed-off-by: Jess Frazelle <github@jessfraz.com> fixups Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> negative args Signed-off-by: Jess Frazelle <github@jessfraz.com> diable camera Signed-off-by: Jess Frazelle <github@jessfraz.com> hide planes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updatress Signed-off-by: Jess Frazelle <github@jessfraz.com> fmt Signed-off-by: Jess Frazelle <github@jessfraz.com> Update src/hooks/useAppMode.ts Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch> Update src/hooks/useAppMode.ts Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch> cleanups Signed-off-by: Jess Frazelle <github@jessfraz.com> Bump kittycad from 0.2.26 to 0.2.27 in /src-tauri (#726) Bumps [kittycad](https://github.com/KittyCAD/kittycad.rs) from 0.2.26 to 0.2.27. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/v0.2.26...v0.2.27) --- updated-dependencies: - dependency-name: kittycad dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump tauri-plugin-fs-extra from `b04bde3` to `6c7a4c0` in /src-tauri (#725) Bumps [tauri-plugin-fs-extra](https://github.com/tauri-apps/plugins-workspace) from `b04bde3` to `6c7a4c0`. - [Release notes](https://github.com/tauri-apps/plugins-workspace/releases) - [Commits](https://github.com/tauri-apps/plugins-workspace/compare/b04bde3461066c709d6801cf9ca305cf889a8394...6c7a4c09847f9659f9393a1412fa59bebd7c2004) --- updated-dependencies: - dependency-name: tauri-plugin-fs-extra dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump toml from 0.8.0 to 0.8.1 in /src-tauri (#724) Bumps [toml](https://github.com/toml-rs/toml) from 0.8.0 to 0.8.1. - [Commits](https://github.com/toml-rs/toml/compare/toml-v0.8.0...toml-v0.8.1) --- updated-dependencies: - dependency-name: toml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump openapitor from `61a1605` to `d3e98c4` in /src/wasm-lib (#723) Bumps [openapitor](https://github.com/KittyCAD/kittycad.rs) from `61a1605` to `d3e98c4`. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/61a16059b3eaf8793a2a2e1edbc0d770f284fea3...d3e98c4ec0ff7c307d66378eab1c4630250ec210) --- updated-dependencies: - dependency-name: openapitor dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump kittycad from 0.2.26 to 0.2.27 in /src/wasm-lib (#722) Bumps [kittycad](https://github.com/KittyCAD/kittycad.rs) from 0.2.26 to 0.2.27. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/v0.2.26...v0.2.27) --- updated-dependencies: - dependency-name: kittycad dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump thiserror from 1.0.48 to 1.0.49 in /src/wasm-lib (#721) Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.48 to 1.0.49. - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](https://github.com/dtolnay/thiserror/compare/1.0.48...1.0.49) --- updated-dependencies: - dependency-name: thiserror dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump expectorate from 1.0.7 to 1.1.0 in /src/wasm-lib (#712) Bumps [expectorate](https://github.com/oxidecomputer/expectorate) from 1.0.7 to 1.1.0. - [Release notes](https://github.com/oxidecomputer/expectorate/releases) - [Commits](https://github.com/oxidecomputer/expectorate/compare/v1.0.7...v1.1.0) --- updated-dependencies: - dependency-name: expectorate dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump clap from 4.4.4 to 4.4.5 in /src/wasm-lib (#711) Bumps [clap](https://github.com/clap-rs/clap) from 4.4.4 to 4.4.5. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.4.4...v4.4.5) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> refactor cleanup Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> type improvements * use new sketchmode no camera Signed-off-by: Jess Frazelle <github@jessfraz.com> * js working better Signed-off-by: Jess Frazelle <github@jessfraz.com> * start of negative planes Signed-off-by: Jess Frazelle <github@jessfraz.com> * tests and neg Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * images Signed-off-by: Jess Frazelle <github@jessfraz.com> * norma;s Signed-off-by: Jess Frazelle <github@jessfraz.com> * better initial load of planes Signed-off-by: Jess Frazelle <github@jessfraz.com> * ts Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix tsc Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix edit sketch Signed-off-by: Jess Frazelle <github@jessfraz.com> * add regression test for 2d solid issue Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * show planes Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix clippy Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> * canecel in progress Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix ci as well Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> * stopping point Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * refactor Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * it works Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * Hide planes (#797) * hide planes in one go Signed-off-by: Jess Frazelle <github@jessfraz.com> * update hide; Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> * make tsc happy * Make "Replay Onboarding" button available on home settings page (#804) * Fix unrelated bug, settings button in the home sidebar doesn't go to the home settings after my previous fixes to routes * Turn on "Replay Onboarding" button in home settings * Use ONBOARDING_PROJECT_NAME in both places * Fix formatting * Cut release v0.10.0 (#803) Co-authored-by: Frank Noirot <frank@kittycad.io> * Bump kittycad from 0.2.28 to 0.2.31 in /src-tauri (#798) Bumps [kittycad](https://github.com/KittyCAD/kittycad.rs) from 0.2.28 to 0.2.31. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/v0.2.28...v0.2.31) --- updated-dependencies: - dependency-name: kittycad dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump openapitor from `fa0345c` to `c122a9b` in /src/wasm-lib (#800) Bumps [openapitor](https://github.com/KittyCAD/kittycad.rs) from `fa0345c` to `c122a9b`. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/fa0345c514fcc9ae6cd74ae35c8e5c2800fec34f...c122a9b1d6afe51c25e545b5e0bbeb91d367e6d2) --- updated-dependencies: - dependency-name: openapitor dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump syn from 2.0.37 to 2.0.38 in /src/wasm-lib (#801) Bumps [syn](https://github.com/dtolnay/syn) from 2.0.37 to 2.0.38. - [Release notes](https://github.com/dtolnay/syn/releases) - [Commits](https://github.com/dtolnay/syn/compare/2.0.37...2.0.38) --- updated-dependencies: - dependency-name: syn dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump winnow from 0.5.15 to 0.5.16 in /src/wasm-lib (#799) Bumps [winnow](https://github.com/winnow-rs/winnow) from 0.5.15 to 0.5.16. - [Changelog](https://github.com/winnow-rs/winnow/blob/main/CHANGELOG.md) - [Commits](https://github.com/winnow-rs/winnow/compare/v0.5.15...v0.5.16) --- updated-dependencies: - dependency-name: winnow dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump tauri-plugin-fs-extra from `fa32d1a` to `9f27e6e` in /src-tauri (#802) Bumps [tauri-plugin-fs-extra](https://github.com/tauri-apps/plugins-workspace) from `fa32d1a` to `9f27e6e`. - [Release notes](https://github.com/tauri-apps/plugins-workspace/releases) - [Commits](https://github.com/tauri-apps/plugins-workspace/compare/fa32d1afa97f52f74d814c5619b8d95da3268e3e...9f27e6e4415ddf6c40f846d50c0d95c768cded77) --- updated-dependencies: - dependency-name: tauri-plugin-fs-extra dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * better plane selection Signed-off-by: Jess Frazelle <github@jessfraz.com> * use the sketch plane id Signed-off-by: Jess Frazelle <github@jessfraz.com> * add todo w bug Signed-off-by: Jess Frazelle <github@jessfraz.com> * Improve Prop Typings for Modals. Remove instances of `any`. (#792) * Update typings for modals. Remove instances of `any` * Fix generic type for creating modals * cleanup other stuffs Signed-off-by: Jess Frazelle <github@jessfraz.com> * make plane id available when selecting default plane * few clean up things * change enter sketch action order to make sure plane id is available to 'enter edit mode' * Revert "Improve Prop Typings for Modals. Remove instances of `any`. (… (#813) Revert "Improve Prop Typings for Modals. Remove instances of `any`. (#792)" This reverts commit 629f326f4cdf13d83a62f471b4b9a40d3c3a2a88. * ffmpeg instructions (#814) * fix some tsc stuff * small tweak --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jason Rametta <rametta@outlook.com> * clean up * fix test and tsc * remove one more thing from useStore * tweak state digrame layout * fmt --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Frank Johnson <frankjohnson1993@gmail.com> Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jason Rametta <rametta@outlook.com>
2023-10-11 13:36:54 +11:00
import { getNodeFromPath } from '../lang/queryAst'
import {
applyConstraintEqualAngle,
equalAngleInfo,
} from 'components/Toolbar/EqualAngle'
import {
applyRemoveConstrainingValues,
removeConstrainingValuesInfo,
} from 'components/Toolbar/RemoveConstrainingValues'
import { intersectInfo } from 'components/Toolbar/Intersect'
import {
absDistanceInfo,
applyConstraintAxisAlign,
} from 'components/Toolbar/SetAbsDistance'
Command bar: add extrude command, nonlinear editing, etc (#1204) * Tweak toaster look and feel * Add icons, tweak plus icon names * Rename commandBarMeta to commandBarConfig * Refactor command bar, add support for icons * Create a tailwind plugin for aria-pressed button state * Remove overlay from behind command bar * Clean up toolbar * Button and other style tweaks * Icon tweaks follow-up: make old icons work with new sizing * Delete unused static icons * More CSS tweaks * Small CSS tweak to project sidebar * Add command bar E2E test * fumpt * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * fix typo in a comment * Fix icon padding (built version only) * Update onboarding and warning banner icons padding * Misc minor style fixes * Get Extrude opening and canceling from command bar * Iconography tweaks * Get extrude kind of working * Refactor command bar config types and organization * Move command bar configs to be co-located with each other * Start building a state machine for the command bar * Start converting command bar to state machine * Add support for multiple args, confirmation step * Submission behavior, hotkeys, code organization * Add new test for extruding from command bar * Polish step back and selection hotkeys, CSS tweaks * Loading style tweaks * Validate selection inputs, polish UX of args re-editing * Prevent submission with multiple selection on singlular arg * Remove stray console logs * Tweak test, CSS nit, remove extrude "result" argument * Fix linting warnings * Show Ctrl+/ instead of ⌘K on all platforms but Mac * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * Add "Enter sketch" to command bar * fix command bar test * Fix flaky cmd bar extrude test by waiting for engine select response * Cover both button labels '⌘K' and 'Ctrl+/' in test --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-12-13 12:49:01 -05:00
import { ModelingCommandSchema } from 'lib/commandBarConfigs/modelingCommandConfig'
import { err, reportRejection, trap } from 'lib/trap'
import { DefaultPlaneStr, getFaceDetails } from 'clientSideScene/sceneEntities'
2024-04-03 19:38:16 +11:00
import { uuidv4 } from 'lib/utils'
Symbols overlay (#2033) * start of overlay work * add new icons * add constraint symbols * add three dots * add primary colours * refactor how we get constraint info for overlays * refactor how we get constraint info for overlays * get symbols working for tangential arc too * extra data on constraint info * add initial delete * fix types and circular dep issue after rebase * fix quirk with horz vert line overlays * fix setup and tear down of overlays * remove overlays that are too small * throttle overlay updates and prove tests selecting html instead of hardcoded px coords * initial show overaly on segment hover * remove overlays when tool is equipped * dounce overlay updates * tsc * make higlighting robust to small changes in source ranges * replace with variable for unconstrained values, and improve styles for popover * background tweak * make overlays unconstrain inputs * fix small regression * write query for finding related tag references * make delete segment safe * typo * un used imports * test deleteSegmentFromPipeExpression * add getConstraintInfo test * test removeSingleConstraintInfo * more tests * tsc * add tests for overlay buttons * rename tests * fmt * better naming structure * more reliablity * more test tweaks * fix selection test * add delete segments with overlays tests * dependant tag tests for segment delet * typo * test clean up * fix some perf issus * clean up * clean up * make things a little more dry * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * trigger ci * Make constraint hover popovers readable on light mode * Touch up the new variable dialog * Little touch-up to three-dot menu style * fix highlight issue * fmt * use optional chain * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)" This reverts commit be3d61e4a303b0d9a792dddbfe8430cc58d46451. * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * disable var panel in sketch mode * fix overlay tests after mergi in main * test tweak * try fix ubuntu * fmt * more test tweaks * tweak * tweaks --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Frank Noirot <frank@kittycad.io>
2024-05-24 20:54:42 +10:00
import { Coords2d } from 'lang/std/sketch'
import { deleteSegment } from 'clientSideScene/ClientSideSceneComp'
import { executeAst } from 'lang/langHelpers'
import toast from 'react-hot-toast'
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
import { ToolbarModeName } from 'lib/toolbar'
xstate migration (#713) * Add basic Popover functionality * Fix up light mode of basic bar * Add support for 2D and 3D mode styling * Turn toolbar buttons back on * Remove ActionButton until after tool logic refactor * Add transitions * Add initial modeling machine This is not a full description of how the modelingMachine should work, but begins to replicate all of the features of our useStore in XState instead of zustand. * Add fillet tool flow * Refactor: break out engine manager setup into hook Preparing for making a wrapper component around the App that will manage the engine manager at the same level as the modelingMachine. * Create modeling provider, move engine management to it * Refactor: move other engine-related useEffect into hook * Add TS schema, selection actions to modelingMachine * Add barebones modeling machine to app Only implementing adding to code-based selections in the text editor so far * Update moved useEffect hook after merge * give myself reminder TODO * fix engineCommandManager waitForReady Promise * enable devtools * make utility class for handling default planes * progresson startNewSketch and EditSketch * add provider to tests * too large of a commit put all of the lang state into another singleton, but did lots of work on xstate too * fix edit sketch ast issue * re-execute on sketch exit * prettierignore xstate typegen file * add move tool button back in * handle mouse commands with xState states * fix move * remove old imports * big useStore delete * fix some destructuring bugs * start of constraint actions * add horizontal/vertical distance constraints * fix more destructuring errors * fix * add angle constaints * add align vertically/horizontally constraints * add length and equal length constraints * rename modal states to be more cmd bar friendly * add doesPipeHave query * add another query * add extrude states * state machine clean up * xstate layout tweak * make xstate types happy * Revamp cursor logic and place curors after ast mod * Xstate merge (#796) * turning back on all planes (#720) * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix more tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> fix stdlib Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> compile Signed-off-by: Jess Frazelle <github@jessfraz.com> update sample code Signed-off-by: Jess Frazelle <github@jessfraz.com> re-enable the planes Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> fix all tests Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> boilerplate Signed-off-by: Jess Frazelle <github@jessfraz.com> Cut release v0.9.2 (#714) rust make default planes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> use the planes from engine Signed-off-by: Jess Frazelle <github@jessfraz.com> fixups Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> negative args Signed-off-by: Jess Frazelle <github@jessfraz.com> diable camera Signed-off-by: Jess Frazelle <github@jessfraz.com> hide planes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updatress Signed-off-by: Jess Frazelle <github@jessfraz.com> fmt Signed-off-by: Jess Frazelle <github@jessfraz.com> Update src/hooks/useAppMode.ts Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch> Update src/hooks/useAppMode.ts Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch> cleanups Signed-off-by: Jess Frazelle <github@jessfraz.com> Bump kittycad from 0.2.26 to 0.2.27 in /src-tauri (#726) Bumps [kittycad](https://github.com/KittyCAD/kittycad.rs) from 0.2.26 to 0.2.27. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/v0.2.26...v0.2.27) --- updated-dependencies: - dependency-name: kittycad dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump tauri-plugin-fs-extra from `b04bde3` to `6c7a4c0` in /src-tauri (#725) Bumps [tauri-plugin-fs-extra](https://github.com/tauri-apps/plugins-workspace) from `b04bde3` to `6c7a4c0`. - [Release notes](https://github.com/tauri-apps/plugins-workspace/releases) - [Commits](https://github.com/tauri-apps/plugins-workspace/compare/b04bde3461066c709d6801cf9ca305cf889a8394...6c7a4c09847f9659f9393a1412fa59bebd7c2004) --- updated-dependencies: - dependency-name: tauri-plugin-fs-extra dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump toml from 0.8.0 to 0.8.1 in /src-tauri (#724) Bumps [toml](https://github.com/toml-rs/toml) from 0.8.0 to 0.8.1. - [Commits](https://github.com/toml-rs/toml/compare/toml-v0.8.0...toml-v0.8.1) --- updated-dependencies: - dependency-name: toml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump openapitor from `61a1605` to `d3e98c4` in /src/wasm-lib (#723) Bumps [openapitor](https://github.com/KittyCAD/kittycad.rs) from `61a1605` to `d3e98c4`. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/61a16059b3eaf8793a2a2e1edbc0d770f284fea3...d3e98c4ec0ff7c307d66378eab1c4630250ec210) --- updated-dependencies: - dependency-name: openapitor dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump kittycad from 0.2.26 to 0.2.27 in /src/wasm-lib (#722) Bumps [kittycad](https://github.com/KittyCAD/kittycad.rs) from 0.2.26 to 0.2.27. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/v0.2.26...v0.2.27) --- updated-dependencies: - dependency-name: kittycad dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump thiserror from 1.0.48 to 1.0.49 in /src/wasm-lib (#721) Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.48 to 1.0.49. - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](https://github.com/dtolnay/thiserror/compare/1.0.48...1.0.49) --- updated-dependencies: - dependency-name: thiserror dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump expectorate from 1.0.7 to 1.1.0 in /src/wasm-lib (#712) Bumps [expectorate](https://github.com/oxidecomputer/expectorate) from 1.0.7 to 1.1.0. - [Release notes](https://github.com/oxidecomputer/expectorate/releases) - [Commits](https://github.com/oxidecomputer/expectorate/compare/v1.0.7...v1.1.0) --- updated-dependencies: - dependency-name: expectorate dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump clap from 4.4.4 to 4.4.5 in /src/wasm-lib (#711) Bumps [clap](https://github.com/clap-rs/clap) from 4.4.4 to 4.4.5. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.4.4...v4.4.5) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> refactor cleanup Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> type improvements * use new sketchmode no camera Signed-off-by: Jess Frazelle <github@jessfraz.com> * js working better Signed-off-by: Jess Frazelle <github@jessfraz.com> * start of negative planes Signed-off-by: Jess Frazelle <github@jessfraz.com> * tests and neg Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * images Signed-off-by: Jess Frazelle <github@jessfraz.com> * norma;s Signed-off-by: Jess Frazelle <github@jessfraz.com> * better initial load of planes Signed-off-by: Jess Frazelle <github@jessfraz.com> * ts Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix tsc Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix edit sketch Signed-off-by: Jess Frazelle <github@jessfraz.com> * add regression test for 2d solid issue Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * show planes Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix clippy Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> * canecel in progress Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix ci as well Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> * stopping point Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * refactor Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * it works Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * Hide planes (#797) * hide planes in one go Signed-off-by: Jess Frazelle <github@jessfraz.com> * update hide; Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> * make tsc happy * Make "Replay Onboarding" button available on home settings page (#804) * Fix unrelated bug, settings button in the home sidebar doesn't go to the home settings after my previous fixes to routes * Turn on "Replay Onboarding" button in home settings * Use ONBOARDING_PROJECT_NAME in both places * Fix formatting * Cut release v0.10.0 (#803) Co-authored-by: Frank Noirot <frank@kittycad.io> * Bump kittycad from 0.2.28 to 0.2.31 in /src-tauri (#798) Bumps [kittycad](https://github.com/KittyCAD/kittycad.rs) from 0.2.28 to 0.2.31. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/v0.2.28...v0.2.31) --- updated-dependencies: - dependency-name: kittycad dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump openapitor from `fa0345c` to `c122a9b` in /src/wasm-lib (#800) Bumps [openapitor](https://github.com/KittyCAD/kittycad.rs) from `fa0345c` to `c122a9b`. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/fa0345c514fcc9ae6cd74ae35c8e5c2800fec34f...c122a9b1d6afe51c25e545b5e0bbeb91d367e6d2) --- updated-dependencies: - dependency-name: openapitor dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump syn from 2.0.37 to 2.0.38 in /src/wasm-lib (#801) Bumps [syn](https://github.com/dtolnay/syn) from 2.0.37 to 2.0.38. - [Release notes](https://github.com/dtolnay/syn/releases) - [Commits](https://github.com/dtolnay/syn/compare/2.0.37...2.0.38) --- updated-dependencies: - dependency-name: syn dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump winnow from 0.5.15 to 0.5.16 in /src/wasm-lib (#799) Bumps [winnow](https://github.com/winnow-rs/winnow) from 0.5.15 to 0.5.16. - [Changelog](https://github.com/winnow-rs/winnow/blob/main/CHANGELOG.md) - [Commits](https://github.com/winnow-rs/winnow/compare/v0.5.15...v0.5.16) --- updated-dependencies: - dependency-name: winnow dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump tauri-plugin-fs-extra from `fa32d1a` to `9f27e6e` in /src-tauri (#802) Bumps [tauri-plugin-fs-extra](https://github.com/tauri-apps/plugins-workspace) from `fa32d1a` to `9f27e6e`. - [Release notes](https://github.com/tauri-apps/plugins-workspace/releases) - [Commits](https://github.com/tauri-apps/plugins-workspace/compare/fa32d1afa97f52f74d814c5619b8d95da3268e3e...9f27e6e4415ddf6c40f846d50c0d95c768cded77) --- updated-dependencies: - dependency-name: tauri-plugin-fs-extra dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * better plane selection Signed-off-by: Jess Frazelle <github@jessfraz.com> * use the sketch plane id Signed-off-by: Jess Frazelle <github@jessfraz.com> * add todo w bug Signed-off-by: Jess Frazelle <github@jessfraz.com> * Improve Prop Typings for Modals. Remove instances of `any`. (#792) * Update typings for modals. Remove instances of `any` * Fix generic type for creating modals * cleanup other stuffs Signed-off-by: Jess Frazelle <github@jessfraz.com> * make plane id available when selecting default plane * few clean up things * change enter sketch action order to make sure plane id is available to 'enter edit mode' * Revert "Improve Prop Typings for Modals. Remove instances of `any`. (… (#813) Revert "Improve Prop Typings for Modals. Remove instances of `any`. (#792)" This reverts commit 629f326f4cdf13d83a62f471b4b9a40d3c3a2a88. * ffmpeg instructions (#814) * fix some tsc stuff * small tweak --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jason Rametta <rametta@outlook.com> * clean up * fix test and tsc * remove one more thing from useStore * tweak state digrame layout * fmt --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Frank Johnson <frankjohnson1993@gmail.com> Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jason Rametta <rametta@outlook.com>
2023-10-11 13:36:54 +11:00
export const MODELING_PERSIST_KEY = 'MODELING_PERSIST_KEY'
export type SetSelections =
| {
selectionType: 'singleCodeCursor'
selection?: Selection
}
| {
selectionType: 'otherSelection'
selection: Axis
}
| {
selectionType: 'completeSelection'
selection: Selections
updatedPathToNode?: PathToNode
xstate migration (#713) * Add basic Popover functionality * Fix up light mode of basic bar * Add support for 2D and 3D mode styling * Turn toolbar buttons back on * Remove ActionButton until after tool logic refactor * Add transitions * Add initial modeling machine This is not a full description of how the modelingMachine should work, but begins to replicate all of the features of our useStore in XState instead of zustand. * Add fillet tool flow * Refactor: break out engine manager setup into hook Preparing for making a wrapper component around the App that will manage the engine manager at the same level as the modelingMachine. * Create modeling provider, move engine management to it * Refactor: move other engine-related useEffect into hook * Add TS schema, selection actions to modelingMachine * Add barebones modeling machine to app Only implementing adding to code-based selections in the text editor so far * Update moved useEffect hook after merge * give myself reminder TODO * fix engineCommandManager waitForReady Promise * enable devtools * make utility class for handling default planes * progresson startNewSketch and EditSketch * add provider to tests * too large of a commit put all of the lang state into another singleton, but did lots of work on xstate too * fix edit sketch ast issue * re-execute on sketch exit * prettierignore xstate typegen file * add move tool button back in * handle mouse commands with xState states * fix move * remove old imports * big useStore delete * fix some destructuring bugs * start of constraint actions * add horizontal/vertical distance constraints * fix more destructuring errors * fix * add angle constaints * add align vertically/horizontally constraints * add length and equal length constraints * rename modal states to be more cmd bar friendly * add doesPipeHave query * add another query * add extrude states * state machine clean up * xstate layout tweak * make xstate types happy * Revamp cursor logic and place curors after ast mod * Xstate merge (#796) * turning back on all planes (#720) * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix more tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> fix stdlib Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> compile Signed-off-by: Jess Frazelle <github@jessfraz.com> update sample code Signed-off-by: Jess Frazelle <github@jessfraz.com> re-enable the planes Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> fix all tests Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> boilerplate Signed-off-by: Jess Frazelle <github@jessfraz.com> Cut release v0.9.2 (#714) rust make default planes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> use the planes from engine Signed-off-by: Jess Frazelle <github@jessfraz.com> fixups Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> negative args Signed-off-by: Jess Frazelle <github@jessfraz.com> diable camera Signed-off-by: Jess Frazelle <github@jessfraz.com> hide planes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updatress Signed-off-by: Jess Frazelle <github@jessfraz.com> fmt Signed-off-by: Jess Frazelle <github@jessfraz.com> Update src/hooks/useAppMode.ts Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch> Update src/hooks/useAppMode.ts Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch> cleanups Signed-off-by: Jess Frazelle <github@jessfraz.com> Bump kittycad from 0.2.26 to 0.2.27 in /src-tauri (#726) Bumps [kittycad](https://github.com/KittyCAD/kittycad.rs) from 0.2.26 to 0.2.27. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/v0.2.26...v0.2.27) --- updated-dependencies: - dependency-name: kittycad dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump tauri-plugin-fs-extra from `b04bde3` to `6c7a4c0` in /src-tauri (#725) Bumps [tauri-plugin-fs-extra](https://github.com/tauri-apps/plugins-workspace) from `b04bde3` to `6c7a4c0`. - [Release notes](https://github.com/tauri-apps/plugins-workspace/releases) - [Commits](https://github.com/tauri-apps/plugins-workspace/compare/b04bde3461066c709d6801cf9ca305cf889a8394...6c7a4c09847f9659f9393a1412fa59bebd7c2004) --- updated-dependencies: - dependency-name: tauri-plugin-fs-extra dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump toml from 0.8.0 to 0.8.1 in /src-tauri (#724) Bumps [toml](https://github.com/toml-rs/toml) from 0.8.0 to 0.8.1. - [Commits](https://github.com/toml-rs/toml/compare/toml-v0.8.0...toml-v0.8.1) --- updated-dependencies: - dependency-name: toml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump openapitor from `61a1605` to `d3e98c4` in /src/wasm-lib (#723) Bumps [openapitor](https://github.com/KittyCAD/kittycad.rs) from `61a1605` to `d3e98c4`. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/61a16059b3eaf8793a2a2e1edbc0d770f284fea3...d3e98c4ec0ff7c307d66378eab1c4630250ec210) --- updated-dependencies: - dependency-name: openapitor dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump kittycad from 0.2.26 to 0.2.27 in /src/wasm-lib (#722) Bumps [kittycad](https://github.com/KittyCAD/kittycad.rs) from 0.2.26 to 0.2.27. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/v0.2.26...v0.2.27) --- updated-dependencies: - dependency-name: kittycad dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump thiserror from 1.0.48 to 1.0.49 in /src/wasm-lib (#721) Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.48 to 1.0.49. - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](https://github.com/dtolnay/thiserror/compare/1.0.48...1.0.49) --- updated-dependencies: - dependency-name: thiserror dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump expectorate from 1.0.7 to 1.1.0 in /src/wasm-lib (#712) Bumps [expectorate](https://github.com/oxidecomputer/expectorate) from 1.0.7 to 1.1.0. - [Release notes](https://github.com/oxidecomputer/expectorate/releases) - [Commits](https://github.com/oxidecomputer/expectorate/compare/v1.0.7...v1.1.0) --- updated-dependencies: - dependency-name: expectorate dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump clap from 4.4.4 to 4.4.5 in /src/wasm-lib (#711) Bumps [clap](https://github.com/clap-rs/clap) from 4.4.4 to 4.4.5. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.4.4...v4.4.5) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> refactor cleanup Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> type improvements * use new sketchmode no camera Signed-off-by: Jess Frazelle <github@jessfraz.com> * js working better Signed-off-by: Jess Frazelle <github@jessfraz.com> * start of negative planes Signed-off-by: Jess Frazelle <github@jessfraz.com> * tests and neg Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * images Signed-off-by: Jess Frazelle <github@jessfraz.com> * norma;s Signed-off-by: Jess Frazelle <github@jessfraz.com> * better initial load of planes Signed-off-by: Jess Frazelle <github@jessfraz.com> * ts Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix tsc Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix edit sketch Signed-off-by: Jess Frazelle <github@jessfraz.com> * add regression test for 2d solid issue Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * show planes Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix clippy Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> * canecel in progress Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix ci as well Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> * stopping point Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * refactor Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * it works Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * Hide planes (#797) * hide planes in one go Signed-off-by: Jess Frazelle <github@jessfraz.com> * update hide; Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> * make tsc happy * Make "Replay Onboarding" button available on home settings page (#804) * Fix unrelated bug, settings button in the home sidebar doesn't go to the home settings after my previous fixes to routes * Turn on "Replay Onboarding" button in home settings * Use ONBOARDING_PROJECT_NAME in both places * Fix formatting * Cut release v0.10.0 (#803) Co-authored-by: Frank Noirot <frank@kittycad.io> * Bump kittycad from 0.2.28 to 0.2.31 in /src-tauri (#798) Bumps [kittycad](https://github.com/KittyCAD/kittycad.rs) from 0.2.28 to 0.2.31. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/v0.2.28...v0.2.31) --- updated-dependencies: - dependency-name: kittycad dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump openapitor from `fa0345c` to `c122a9b` in /src/wasm-lib (#800) Bumps [openapitor](https://github.com/KittyCAD/kittycad.rs) from `fa0345c` to `c122a9b`. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/fa0345c514fcc9ae6cd74ae35c8e5c2800fec34f...c122a9b1d6afe51c25e545b5e0bbeb91d367e6d2) --- updated-dependencies: - dependency-name: openapitor dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump syn from 2.0.37 to 2.0.38 in /src/wasm-lib (#801) Bumps [syn](https://github.com/dtolnay/syn) from 2.0.37 to 2.0.38. - [Release notes](https://github.com/dtolnay/syn/releases) - [Commits](https://github.com/dtolnay/syn/compare/2.0.37...2.0.38) --- updated-dependencies: - dependency-name: syn dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump winnow from 0.5.15 to 0.5.16 in /src/wasm-lib (#799) Bumps [winnow](https://github.com/winnow-rs/winnow) from 0.5.15 to 0.5.16. - [Changelog](https://github.com/winnow-rs/winnow/blob/main/CHANGELOG.md) - [Commits](https://github.com/winnow-rs/winnow/compare/v0.5.15...v0.5.16) --- updated-dependencies: - dependency-name: winnow dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump tauri-plugin-fs-extra from `fa32d1a` to `9f27e6e` in /src-tauri (#802) Bumps [tauri-plugin-fs-extra](https://github.com/tauri-apps/plugins-workspace) from `fa32d1a` to `9f27e6e`. - [Release notes](https://github.com/tauri-apps/plugins-workspace/releases) - [Commits](https://github.com/tauri-apps/plugins-workspace/compare/fa32d1afa97f52f74d814c5619b8d95da3268e3e...9f27e6e4415ddf6c40f846d50c0d95c768cded77) --- updated-dependencies: - dependency-name: tauri-plugin-fs-extra dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * better plane selection Signed-off-by: Jess Frazelle <github@jessfraz.com> * use the sketch plane id Signed-off-by: Jess Frazelle <github@jessfraz.com> * add todo w bug Signed-off-by: Jess Frazelle <github@jessfraz.com> * Improve Prop Typings for Modals. Remove instances of `any`. (#792) * Update typings for modals. Remove instances of `any` * Fix generic type for creating modals * cleanup other stuffs Signed-off-by: Jess Frazelle <github@jessfraz.com> * make plane id available when selecting default plane * few clean up things * change enter sketch action order to make sure plane id is available to 'enter edit mode' * Revert "Improve Prop Typings for Modals. Remove instances of `any`. (… (#813) Revert "Improve Prop Typings for Modals. Remove instances of `any`. (#792)" This reverts commit 629f326f4cdf13d83a62f471b4b9a40d3c3a2a88. * ffmpeg instructions (#814) * fix some tsc stuff * small tweak --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jason Rametta <rametta@outlook.com> * clean up * fix test and tsc * remove one more thing from useStore * tweak state digrame layout * fmt --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Frank Johnson <frankjohnson1993@gmail.com> Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jason Rametta <rametta@outlook.com>
2023-10-11 13:36:54 +11:00
}
| {
selectionType: 'mirrorCodeMirrorSelections'
selection: Selections
}
export type MouseState =
| {
type: 'idle'
}
| {
type: 'isHovering'
on: any
}
| {
type: 'isDragging'
on: any
}
Symbols overlay (#2033) * start of overlay work * add new icons * add constraint symbols * add three dots * add primary colours * refactor how we get constraint info for overlays * refactor how we get constraint info for overlays * get symbols working for tangential arc too * extra data on constraint info * add initial delete * fix types and circular dep issue after rebase * fix quirk with horz vert line overlays * fix setup and tear down of overlays * remove overlays that are too small * throttle overlay updates and prove tests selecting html instead of hardcoded px coords * initial show overaly on segment hover * remove overlays when tool is equipped * dounce overlay updates * tsc * make higlighting robust to small changes in source ranges * replace with variable for unconstrained values, and improve styles for popover * background tweak * make overlays unconstrain inputs * fix small regression * write query for finding related tag references * make delete segment safe * typo * un used imports * test deleteSegmentFromPipeExpression * add getConstraintInfo test * test removeSingleConstraintInfo * more tests * tsc * add tests for overlay buttons * rename tests * fmt * better naming structure * more reliablity * more test tweaks * fix selection test * add delete segments with overlays tests * dependant tag tests for segment delet * typo * test clean up * fix some perf issus * clean up * clean up * make things a little more dry * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * trigger ci * Make constraint hover popovers readable on light mode * Touch up the new variable dialog * Little touch-up to three-dot menu style * fix highlight issue * fmt * use optional chain * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)" This reverts commit be3d61e4a303b0d9a792dddbfe8430cc58d46451. * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * disable var panel in sketch mode * fix overlay tests after mergi in main * test tweak * try fix ubuntu * fmt * more test tweaks * tweak * tweaks --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Frank Noirot <frank@kittycad.io>
2024-05-24 20:54:42 +10:00
| {
type: 'timeoutEnd'
pathToNodeString: string
}
SketchOnFace UI (#1664) * always enter edit mode * initial blocking of extra code-mirror updates * dry out code * rejig selections * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * clean up * stream clean up * update export * sketch mode can be entered and exited for extrude faces But has bugs * startSketchOn working in some cases, editsketch animation working but not orientation of instersection plane etc * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)" This reverts commit 406fca4c553681fbad882167a9c1ab380af52899. * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * remove comment * add sketch on face e2e test * tweenCamToNegYAxis should respect reduced motion * initial sketch on face working with test * remove temporary toolbar button and xState flow * un-used vars * snapshot test tweak * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * type tidy up * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)" This reverts commit c39b8ebf954fa63556e21da081031b8acd77c909. * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)" This reverts commit fecf6f490af6ced34959653984108958fb504f82. * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * rename * sketch on sketch on sketch * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * typo * startSketchOn Endcaps end works, start is weird still * clear selections for entity_ids that are not recognised * fix sketch on end cap of second order extrustion * tiny clean up * fix sketch on close segment/face * clean up 'lastCodeMirrorSelectionUpdatedFromScene' * add code mode test for sketchOnExtrudedFace * make end cap selection more robust * update js artifacts for extrudes * update kcl docs * clean up --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-03-22 10:23:04 +11:00
export interface SketchDetails {
sketchPathToNode: PathToNode
zAxis: [number, number, number]
yAxis: [number, number, number]
origin: [number, number, number]
}
Symbols overlay (#2033) * start of overlay work * add new icons * add constraint symbols * add three dots * add primary colours * refactor how we get constraint info for overlays * refactor how we get constraint info for overlays * get symbols working for tangential arc too * extra data on constraint info * add initial delete * fix types and circular dep issue after rebase * fix quirk with horz vert line overlays * fix setup and tear down of overlays * remove overlays that are too small * throttle overlay updates and prove tests selecting html instead of hardcoded px coords * initial show overaly on segment hover * remove overlays when tool is equipped * dounce overlay updates * tsc * make higlighting robust to small changes in source ranges * replace with variable for unconstrained values, and improve styles for popover * background tweak * make overlays unconstrain inputs * fix small regression * write query for finding related tag references * make delete segment safe * typo * un used imports * test deleteSegmentFromPipeExpression * add getConstraintInfo test * test removeSingleConstraintInfo * more tests * tsc * add tests for overlay buttons * rename tests * fmt * better naming structure * more reliablity * more test tweaks * fix selection test * add delete segments with overlays tests * dependant tag tests for segment delet * typo * test clean up * fix some perf issus * clean up * clean up * make things a little more dry * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * trigger ci * Make constraint hover popovers readable on light mode * Touch up the new variable dialog * Little touch-up to three-dot menu style * fix highlight issue * fmt * use optional chain * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)" This reverts commit be3d61e4a303b0d9a792dddbfe8430cc58d46451. * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * disable var panel in sketch mode * fix overlay tests after mergi in main * test tweak * try fix ubuntu * fmt * more test tweaks * tweak * tweaks --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Frank Noirot <frank@kittycad.io>
2024-05-24 20:54:42 +10:00
export interface SegmentOverlay {
windowCoords: Coords2d
angle: number
group: any
pathToNode: PathToNode
visible: boolean
}
export interface SegmentOverlays {
[pathToNodeString: string]: SegmentOverlay
}
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
export type ExtrudeFacePlane = {
type: 'extrudeFace'
position: [number, number, number]
sketchPathToNode: PathToNode
extrudePathToNode: PathToNode
cap: 'start' | 'end' | 'none'
faceId: string
zAxis: [number, number, number]
yAxis: [number, number, number]
}
export type DefaultPlane = {
type: 'defaultPlane'
plane: DefaultPlaneStr
planeId: string
zAxis: [number, number, number]
yAxis: [number, number, number]
}
Symbols overlay (#2033) * start of overlay work * add new icons * add constraint symbols * add three dots * add primary colours * refactor how we get constraint info for overlays * refactor how we get constraint info for overlays * get symbols working for tangential arc too * extra data on constraint info * add initial delete * fix types and circular dep issue after rebase * fix quirk with horz vert line overlays * fix setup and tear down of overlays * remove overlays that are too small * throttle overlay updates and prove tests selecting html instead of hardcoded px coords * initial show overaly on segment hover * remove overlays when tool is equipped * dounce overlay updates * tsc * make higlighting robust to small changes in source ranges * replace with variable for unconstrained values, and improve styles for popover * background tweak * make overlays unconstrain inputs * fix small regression * write query for finding related tag references * make delete segment safe * typo * un used imports * test deleteSegmentFromPipeExpression * add getConstraintInfo test * test removeSingleConstraintInfo * more tests * tsc * add tests for overlay buttons * rename tests * fmt * better naming structure * more reliablity * more test tweaks * fix selection test * add delete segments with overlays tests * dependant tag tests for segment delet * typo * test clean up * fix some perf issus * clean up * clean up * make things a little more dry * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * trigger ci * Make constraint hover popovers readable on light mode * Touch up the new variable dialog * Little touch-up to three-dot menu style * fix highlight issue * fmt * use optional chain * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)" This reverts commit be3d61e4a303b0d9a792dddbfe8430cc58d46451. * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * disable var panel in sketch mode * fix overlay tests after mergi in main * test tweak * try fix ubuntu * fmt * more test tweaks * tweak * tweaks --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Frank Noirot <frank@kittycad.io>
2024-05-24 20:54:42 +10:00
export type SegmentOverlayPayload =
| {
type: 'set-one'
pathToNodeString: string
seg: SegmentOverlay
}
| {
type: 'delete-one'
pathToNodeString: string
}
| { type: 'clear' }
| {
type: 'set-many'
overlays: SegmentOverlays
}
Text-to-CAD with alpha model (might have issues) integration (#3299) * Add close dismiss button to Infinite duration non-loading toasts * Add text-to-cad icon candidates * Add a way to silently create files * Add text-to-cad command with mock backend * add the actual endpoint Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix the response Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixups Signed-off-by: Jess Frazelle <github@jessfraz.com> * Add `credentials: include` * add headers Signed-off-by: Jess Frazelle <github@jessfraz.com> * Mostly working? Just getting CORS on desktop * Merge goof * fixups Signed-off-by: Jess Frazelle <github@jessfraz.com> * create cross platform fetch; Signed-off-by: Jess Frazelle <github@jessfraz.com> * send the token; Signed-off-by: Jess Frazelle <github@jessfraz.com> * send the token; Signed-off-by: Jess Frazelle <github@jessfraz.com> * better names for files Signed-off-by: Jess Frazelle <github@jessfraz.com> * Commit broken THREEjs success toast * base64 decode Signed-off-by: Jess Frazelle <github@jessfraz.com> * send telemetry on reject / accept Signed-off-by: Jess Frazelle <github@jessfraz.com> * start of tests Signed-off-by: Jess Frazelle <github@jessfraz.com> * more tests Signed-off-by: Jess Frazelle <github@jessfraz.com> * basic tests; Signed-off-by: Jess Frazelle <github@jessfraz.com> * lego Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fmt Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * Get model stylized based on settings * Don't need automatic dismiss button for Infinity-duration toasts anymore * Stylize loaded model, add OrbitControls, polish button behavior * Allow user to retry prompt if one fails * Add an auto-grow textarea input type to the command bar, set text-to-cad to use it * Delete the created file in desktop if user rejects it * Submit with meta+Enter * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * add more tests and various fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * Set `prompt` arg defaultValue to failed prompt value on retry * Add missing `awaits` to playwright tests to get them passing * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * empty --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-08-14 14:26:44 -04:00
export interface Store {
videoElement?: HTMLVideoElement
openPanes: SidebarType[]
}
export type SketchTool = 'line' | 'tangentialArc' | 'rectangle' | 'none'
export type ModelingMachineEvent =
| {
type: 'Enter sketch'
data?: {
forceNewSketch?: boolean
}
}
SketchOnFace UI (#1664) * always enter edit mode * initial blocking of extra code-mirror updates * dry out code * rejig selections * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * clean up * stream clean up * update export * sketch mode can be entered and exited for extrude faces But has bugs * startSketchOn working in some cases, editsketch animation working but not orientation of instersection plane etc * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)" This reverts commit 406fca4c553681fbad882167a9c1ab380af52899. * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * remove comment * add sketch on face e2e test * tweenCamToNegYAxis should respect reduced motion * initial sketch on face working with test * remove temporary toolbar button and xState flow * un-used vars * snapshot test tweak * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * type tidy up * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)" This reverts commit c39b8ebf954fa63556e21da081031b8acd77c909. * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)" This reverts commit fecf6f490af6ced34959653984108958fb504f82. * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * rename * sketch on sketch on sketch * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * typo * startSketchOn Endcaps end works, start is weird still * clear selections for entity_ids that are not recognised * fix sketch on end cap of second order extrustion * tiny clean up * fix sketch on close segment/face * clean up 'lastCodeMirrorSelectionUpdatedFromScene' * add code mode test for sketchOnExtrudedFace * make end cap selection more robust * update js artifacts for extrudes * update kcl docs * clean up --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-03-22 10:23:04 +11:00
| { type: 'Sketch On Face' }
| {
Client sketch scene (#1271) * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * make tsc happ * better error msg * fix control point issue * basic code gen working for tangentialArc * partical fix for move with arcs * tangential arc move * fix * make eslint rules less annoying * inital refactor of some xstate stuff * more old tangential arc clean up stuff * more tweaks * add testing * tweak xstate inspect * temp remove test * update formating for less conflicts * fix state machine layout after merge * shrug, something weird with xstate typegen * renaming some xstate events * tweak numbers to make CI playwright happ * CI hacks * more CI hacks * more CI hacks * new hack strategy * run tests agian * make cmd bar less flaky * ci hacks * CI hacks * CI hacks * CI hacks * clean up * fix * still have constraint stuff to deal with * progress on move rules * update source ranges after no execute code-mod * typo * mvp working * hide show sketch overlay * match scaling * update arrow head style * animate line tool * bypass xstate for animations, much smoother * add new segment working with refactor needed for setup paper sketch * refactor setup paper sketch * tangantialArcTo drag animations working * tangential arc polish * cargo fmt * clippy * more clippy * mock canvas * last of clippy? * typo * more clippy stuff * move util function so they are shareable with typescript * migrate a bunch to rust and only rust * add arc center point for draft tangential ac * clippy tweak * delete uneeded test * Rough start to scaling arrow heads. The tangent arrow heads are basically nuked and replaced while the straight line sections are just rotated and repositioned, this means they miss out on updating scaling number after a screen size changes. Needs fixing * fix bug with tool tips * fix draft line start position Having drag the end of teh path before selecting a tooltip would result in the draft line starting where the path used to end, stale data * some progress with pan maybe * fmt * inital camera sync working For perspective camera at least * change three.js to use z-up * add grid * orthographic camera working with polish items TODO * fix zoom level when swapping camera * fix up camera/orbit changing on cam change (pan wasn't being respected) * tidy up * use orbit target instead of assuming scene center * dynamic fov working * animate orthographic to perspective and reverse * fix import * temp fix for batch commands * initial client side scene sketch working * remove hover log * FOV adjust fix * fix comment * tear down sketch and small tweaks * some progress with camera tweening * combine dollyZoom engine commands see https://github.com/KittyCAD/modeling-api/compare/kurt-perspective-settings?expand=1 and https://github.com/KittyCAD/engine/compare/kurt-perspective-settings?expand=1 * make tests happy (mocks) * fix tween to vertical/camera-up bug * tween to each axis with hacky solutions in there * fix startSketchOn planes * tidy startSketchOn * tweening okay for now I think * get sketching on default planes working * allow editing on all default planes * clean up enter and exit sketch logic * tidy * tidy * remove more default plane stuff * start of draft line * remove some annoying parts of the paper.js implementation * fix drag than equip line bug * comment * don't animate on skech tear down since it's used for draft line * remove more default plane shit * style draft line * refine dashed line * draft line set up and tear down mostly happy * add on click logic ready for draft lines * sketch mode with drag and draft mode working solidly now, straight segments only * default planes match colors, hover and select still TODO * hover and click logic working for default planes Now just need the code mode to fire to 'startSketchOn(...)' * select default planes * remove some logs * fix update infinite loop * start of orbitControls port to Franks control guards * hiding scenes at different times * scene hide on camera move should be respected by scroll zoom * basic hover working * Hook up user camera settings to ClientSideScene (#1334) * Refactor to not import utilities from Router.tsx * Stop tracking changes or formatting *.typegen.ts * Hook up cameraControls to ClientSideScene * Remove camera controls toggle from temp debug panel --------- Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> * add select segment moves cursor * highlight segments yellow on hover * cursor ranges effect 2d line colors * fix constrainst i.e. make sure the sketch is rejiged * selecting nothing should remove selections * remove hardcoded strings * update get_tangential_arc_to_info rust util * initial drawing of tangential arcs in client scene * fix tangentialArc arrow head direction * correct userData types for tangential arcs * get tangential arc updates working Doesn't include draging the head of the tangential arc itself yet * spot of clean up * make selections work with tangential arcs * get draft tangential segment animated * fix initial click weirdness for adding new tangential line * couple tweaks * add grace pixels /threshold to raycast * redo arc dashes so that they spawn from the ccenter of the arc * fix multi drag bug * fmt * add temp solution for close * add default axis hover colors, still needs select logic * selection of axis works, just with out selection color * get axis selection colors working * fix outdate source ranges after drag problem * update moreNodePathFromSourceRange * fix ts-rs issue/workaround * fix default plane weirdness * fix tangential arc rounding issue * review clean up part 1 * review clean up part 2 Big state-diagram cull * clippy * typo * clippy * fix xstate types with typegen * fix types * clippy * catch error * fix test import issue Not sure exactly what was happening but guessing circular import that vite didn't like * add axis/plane info to sketch group tests * case changes because of rs-ts bug, can probably revert this later * start of playwright test fixes * reduce geo complexity for straight segments * fix cam adjust tests * Revert "Clean up vite build warnings (#1332)" This reverts commit c1f661ab5254458c3e9fdb396a31860a22c790f1. * selection e2e test fixed< * remove camToggle to allow playwright tests to pass * remove drag test too brittle and needs to be redone from the ground up anyway * trigger CI * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * fix last test * clean up part 3 * clean up part 4 * clean up part 5 * clean up sketch enter exit logic * fix engine side selections * default plane should not be selected form 'onDragEnd' i.e. rotating the camera should not mean the user acidently selects a plane * clean up state diagram around animating to sketch mode Embracing that the animation is async and puting the interdiate steps in the state diagram clean up some logic and solved some bugs at the same time * add test for multiple sketches * typo * make highlight more robust * type tweak * scale segmenst with distance from camera so they have a consistent pixel size/ screenspace size * Jess's advice * tsc and fmt * clean up part 6 remove integer from xstate names * clean up part 7 * integrate sequency in to camera moves * fix tests * update snapshot e2e * small snapshot change * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * trigger ci * Fix HomeLoaderData types * update std stuff * update kittycad rs client lib --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-02-11 12:59:00 +11:00
type: 'Select default plane'
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
data: DefaultPlane | ExtrudeFacePlane
}
| {
type: 'Set selection'
data: SetSelections
}
| {
type: 'Delete selection'
}
| { type: 'Sketch no face' }
| { type: 'Toggle gui mode' }
| { type: 'Cancel' }
| { type: 'CancelSketch' }
Client sketch scene (#1271) * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * make tsc happ * better error msg * fix control point issue * basic code gen working for tangentialArc * partical fix for move with arcs * tangential arc move * fix * make eslint rules less annoying * inital refactor of some xstate stuff * more old tangential arc clean up stuff * more tweaks * add testing * tweak xstate inspect * temp remove test * update formating for less conflicts * fix state machine layout after merge * shrug, something weird with xstate typegen * renaming some xstate events * tweak numbers to make CI playwright happ * CI hacks * more CI hacks * more CI hacks * new hack strategy * run tests agian * make cmd bar less flaky * ci hacks * CI hacks * CI hacks * CI hacks * clean up * fix * still have constraint stuff to deal with * progress on move rules * update source ranges after no execute code-mod * typo * mvp working * hide show sketch overlay * match scaling * update arrow head style * animate line tool * bypass xstate for animations, much smoother * add new segment working with refactor needed for setup paper sketch * refactor setup paper sketch * tangantialArcTo drag animations working * tangential arc polish * cargo fmt * clippy * more clippy * mock canvas * last of clippy? * typo * more clippy stuff * move util function so they are shareable with typescript * migrate a bunch to rust and only rust * add arc center point for draft tangential ac * clippy tweak * delete uneeded test * Rough start to scaling arrow heads. The tangent arrow heads are basically nuked and replaced while the straight line sections are just rotated and repositioned, this means they miss out on updating scaling number after a screen size changes. Needs fixing * fix bug with tool tips * fix draft line start position Having drag the end of teh path before selecting a tooltip would result in the draft line starting where the path used to end, stale data * some progress with pan maybe * fmt * inital camera sync working For perspective camera at least * change three.js to use z-up * add grid * orthographic camera working with polish items TODO * fix zoom level when swapping camera * fix up camera/orbit changing on cam change (pan wasn't being respected) * tidy up * use orbit target instead of assuming scene center * dynamic fov working * animate orthographic to perspective and reverse * fix import * temp fix for batch commands * initial client side scene sketch working * remove hover log * FOV adjust fix * fix comment * tear down sketch and small tweaks * some progress with camera tweening * combine dollyZoom engine commands see https://github.com/KittyCAD/modeling-api/compare/kurt-perspective-settings?expand=1 and https://github.com/KittyCAD/engine/compare/kurt-perspective-settings?expand=1 * make tests happy (mocks) * fix tween to vertical/camera-up bug * tween to each axis with hacky solutions in there * fix startSketchOn planes * tidy startSketchOn * tweening okay for now I think * get sketching on default planes working * allow editing on all default planes * clean up enter and exit sketch logic * tidy * tidy * remove more default plane stuff * start of draft line * remove some annoying parts of the paper.js implementation * fix drag than equip line bug * comment * don't animate on skech tear down since it's used for draft line * remove more default plane shit * style draft line * refine dashed line * draft line set up and tear down mostly happy * add on click logic ready for draft lines * sketch mode with drag and draft mode working solidly now, straight segments only * default planes match colors, hover and select still TODO * hover and click logic working for default planes Now just need the code mode to fire to 'startSketchOn(...)' * select default planes * remove some logs * fix update infinite loop * start of orbitControls port to Franks control guards * hiding scenes at different times * scene hide on camera move should be respected by scroll zoom * basic hover working * Hook up user camera settings to ClientSideScene (#1334) * Refactor to not import utilities from Router.tsx * Stop tracking changes or formatting *.typegen.ts * Hook up cameraControls to ClientSideScene * Remove camera controls toggle from temp debug panel --------- Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> * add select segment moves cursor * highlight segments yellow on hover * cursor ranges effect 2d line colors * fix constrainst i.e. make sure the sketch is rejiged * selecting nothing should remove selections * remove hardcoded strings * update get_tangential_arc_to_info rust util * initial drawing of tangential arcs in client scene * fix tangentialArc arrow head direction * correct userData types for tangential arcs * get tangential arc updates working Doesn't include draging the head of the tangential arc itself yet * spot of clean up * make selections work with tangential arcs * get draft tangential segment animated * fix initial click weirdness for adding new tangential line * couple tweaks * add grace pixels /threshold to raycast * redo arc dashes so that they spawn from the ccenter of the arc * fix multi drag bug * fmt * add temp solution for close * add default axis hover colors, still needs select logic * selection of axis works, just with out selection color * get axis selection colors working * fix outdate source ranges after drag problem * update moreNodePathFromSourceRange * fix ts-rs issue/workaround * fix default plane weirdness * fix tangential arc rounding issue * review clean up part 1 * review clean up part 2 Big state-diagram cull * clippy * typo * clippy * fix xstate types with typegen * fix types * clippy * catch error * fix test import issue Not sure exactly what was happening but guessing circular import that vite didn't like * add axis/plane info to sketch group tests * case changes because of rs-ts bug, can probably revert this later * start of playwright test fixes * reduce geo complexity for straight segments * fix cam adjust tests * Revert "Clean up vite build warnings (#1332)" This reverts commit c1f661ab5254458c3e9fdb396a31860a22c790f1. * selection e2e test fixed< * remove camToggle to allow playwright tests to pass * remove drag test too brittle and needs to be redone from the ground up anyway * trigger CI * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * fix last test * clean up part 3 * clean up part 4 * clean up part 5 * clean up sketch enter exit logic * fix engine side selections * default plane should not be selected form 'onDragEnd' i.e. rotating the camera should not mean the user acidently selects a plane * clean up state diagram around animating to sketch mode Embracing that the animation is async and puting the interdiate steps in the state diagram clean up some logic and solved some bugs at the same time * add test for multiple sketches * typo * make highlight more robust * type tweak * scale segmenst with distance from camera so they have a consistent pixel size/ screenspace size * Jess's advice * tsc and fmt * clean up part 6 remove integer from xstate names * clean up part 7 * integrate sequency in to camera moves * fix tests * update snapshot e2e * small snapshot change * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * trigger ci * Fix HomeLoaderData types * update std stuff * update kittycad rs client lib --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-02-11 12:59:00 +11:00
| { type: 'Add start point' }
| { type: 'Make segment horizontal' }
| { type: 'Make segment vertical' }
| { type: 'Constrain horizontal distance' }
| { type: 'Constrain ABS X' }
| { type: 'Constrain ABS Y' }
| { type: 'Constrain vertical distance' }
| { type: 'Constrain angle' }
| { type: 'Constrain perpendicular distance' }
| { type: 'Constrain horizontally align' }
| { type: 'Constrain vertically align' }
| { type: 'Constrain snap to X' }
| { type: 'Constrain snap to Y' }
| { type: 'Constrain length' }
| { type: 'Constrain equal length' }
| { type: 'Constrain parallel' }
| { type: 'Constrain remove constraints'; data?: PathToNode }
| { type: 'Re-execute' }
| { type: 'Export'; data: ModelingCommandSchema['Export'] }
Add print button (#3133) * add print button Signed-off-by: Jess Frazelle <github@jessfraz.com> * cleanup Signed-off-by: Jess Frazelle <github@jessfraz.com> * generate more types Signed-off-by: Jess Frazelle <github@jessfraz.com> * add a github action to generate machine api-types Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix Signed-off-by: Jess Frazelle <github@jessfraz.com> * New machine-api types * actually print on the real machine Signed-off-by: Jess Frazelle <github@jessfraz.com> * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * add more Signed-off-by: Jess Frazelle <github@jessfraz.com> * New machine-api types * get the current machine Signed-off-by: Jess Frazelle <github@jessfraz.com> * New machine-api types * know when error Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fmt Signed-off-by: Jess Frazelle <github@jessfraz.com> * add fmt Signed-off-by: Jess Frazelle <github@jessfraz.com> * New machine-api types * empty * empty * update machine api Signed-off-by: Jess Frazelle <github@jessfraz.com> * New machine-api types * empty * New machine-api types * emptuy * no circular deps Signed-off-by: Jess Frazelle <github@jessfraz.com> * New machine-api types * remove recursive dep Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
2024-08-04 00:51:30 -04:00
| { type: 'Make'; data: ModelingCommandSchema['Make'] }
Command bar: add extrude command, nonlinear editing, etc (#1204) * Tweak toaster look and feel * Add icons, tweak plus icon names * Rename commandBarMeta to commandBarConfig * Refactor command bar, add support for icons * Create a tailwind plugin for aria-pressed button state * Remove overlay from behind command bar * Clean up toolbar * Button and other style tweaks * Icon tweaks follow-up: make old icons work with new sizing * Delete unused static icons * More CSS tweaks * Small CSS tweak to project sidebar * Add command bar E2E test * fumpt * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * fix typo in a comment * Fix icon padding (built version only) * Update onboarding and warning banner icons padding * Misc minor style fixes * Get Extrude opening and canceling from command bar * Iconography tweaks * Get extrude kind of working * Refactor command bar config types and organization * Move command bar configs to be co-located with each other * Start building a state machine for the command bar * Start converting command bar to state machine * Add support for multiple args, confirmation step * Submission behavior, hotkeys, code organization * Add new test for extruding from command bar * Polish step back and selection hotkeys, CSS tweaks * Loading style tweaks * Validate selection inputs, polish UX of args re-editing * Prevent submission with multiple selection on singlular arg * Remove stray console logs * Tweak test, CSS nit, remove extrude "result" argument * Fix linting warnings * Show Ctrl+/ instead of ⌘K on all platforms but Mac * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * Add "Enter sketch" to command bar * fix command bar test * Fix flaky cmd bar extrude test by waiting for engine select response * Cover both button labels '⌘K' and 'Ctrl+/' in test --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-12-13 12:49:01 -05:00
| { type: 'Extrude'; data?: ModelingCommandSchema['Extrude'] }
| { type: 'Revolve'; data?: ModelingCommandSchema['Revolve'] }
| { type: 'Fillet'; data?: ModelingCommandSchema['Fillet'] }
Text-to-CAD with alpha model (might have issues) integration (#3299) * Add close dismiss button to Infinite duration non-loading toasts * Add text-to-cad icon candidates * Add a way to silently create files * Add text-to-cad command with mock backend * add the actual endpoint Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix the response Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixups Signed-off-by: Jess Frazelle <github@jessfraz.com> * Add `credentials: include` * add headers Signed-off-by: Jess Frazelle <github@jessfraz.com> * Mostly working? Just getting CORS on desktop * Merge goof * fixups Signed-off-by: Jess Frazelle <github@jessfraz.com> * create cross platform fetch; Signed-off-by: Jess Frazelle <github@jessfraz.com> * send the token; Signed-off-by: Jess Frazelle <github@jessfraz.com> * send the token; Signed-off-by: Jess Frazelle <github@jessfraz.com> * better names for files Signed-off-by: Jess Frazelle <github@jessfraz.com> * Commit broken THREEjs success toast * base64 decode Signed-off-by: Jess Frazelle <github@jessfraz.com> * send telemetry on reject / accept Signed-off-by: Jess Frazelle <github@jessfraz.com> * start of tests Signed-off-by: Jess Frazelle <github@jessfraz.com> * more tests Signed-off-by: Jess Frazelle <github@jessfraz.com> * basic tests; Signed-off-by: Jess Frazelle <github@jessfraz.com> * lego Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fmt Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * Get model stylized based on settings * Don't need automatic dismiss button for Infinity-duration toasts anymore * Stylize loaded model, add OrbitControls, polish button behavior * Allow user to retry prompt if one fails * Add an auto-grow textarea input type to the command bar, set text-to-cad to use it * Delete the created file in desktop if user rejects it * Submit with meta+Enter * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * add more tests and various fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * Set `prompt` arg defaultValue to failed prompt value on retry * Add missing `awaits` to playwright tests to get them passing * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * empty --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-08-14 14:26:44 -04:00
| { type: 'Text-to-CAD'; data: ModelingCommandSchema['Text-to-CAD'] }
| {
type: 'Add rectangle origin'
data: [x: number, y: number]
}
Client sketch scene (#1271) * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * make tsc happ * better error msg * fix control point issue * basic code gen working for tangentialArc * partical fix for move with arcs * tangential arc move * fix * make eslint rules less annoying * inital refactor of some xstate stuff * more old tangential arc clean up stuff * more tweaks * add testing * tweak xstate inspect * temp remove test * update formating for less conflicts * fix state machine layout after merge * shrug, something weird with xstate typegen * renaming some xstate events * tweak numbers to make CI playwright happ * CI hacks * more CI hacks * more CI hacks * new hack strategy * run tests agian * make cmd bar less flaky * ci hacks * CI hacks * CI hacks * CI hacks * clean up * fix * still have constraint stuff to deal with * progress on move rules * update source ranges after no execute code-mod * typo * mvp working * hide show sketch overlay * match scaling * update arrow head style * animate line tool * bypass xstate for animations, much smoother * add new segment working with refactor needed for setup paper sketch * refactor setup paper sketch * tangantialArcTo drag animations working * tangential arc polish * cargo fmt * clippy * more clippy * mock canvas * last of clippy? * typo * more clippy stuff * move util function so they are shareable with typescript * migrate a bunch to rust and only rust * add arc center point for draft tangential ac * clippy tweak * delete uneeded test * Rough start to scaling arrow heads. The tangent arrow heads are basically nuked and replaced while the straight line sections are just rotated and repositioned, this means they miss out on updating scaling number after a screen size changes. Needs fixing * fix bug with tool tips * fix draft line start position Having drag the end of teh path before selecting a tooltip would result in the draft line starting where the path used to end, stale data * some progress with pan maybe * fmt * inital camera sync working For perspective camera at least * change three.js to use z-up * add grid * orthographic camera working with polish items TODO * fix zoom level when swapping camera * fix up camera/orbit changing on cam change (pan wasn't being respected) * tidy up * use orbit target instead of assuming scene center * dynamic fov working * animate orthographic to perspective and reverse * fix import * temp fix for batch commands * initial client side scene sketch working * remove hover log * FOV adjust fix * fix comment * tear down sketch and small tweaks * some progress with camera tweening * combine dollyZoom engine commands see https://github.com/KittyCAD/modeling-api/compare/kurt-perspective-settings?expand=1 and https://github.com/KittyCAD/engine/compare/kurt-perspective-settings?expand=1 * make tests happy (mocks) * fix tween to vertical/camera-up bug * tween to each axis with hacky solutions in there * fix startSketchOn planes * tidy startSketchOn * tweening okay for now I think * get sketching on default planes working * allow editing on all default planes * clean up enter and exit sketch logic * tidy * tidy * remove more default plane stuff * start of draft line * remove some annoying parts of the paper.js implementation * fix drag than equip line bug * comment * don't animate on skech tear down since it's used for draft line * remove more default plane shit * style draft line * refine dashed line * draft line set up and tear down mostly happy * add on click logic ready for draft lines * sketch mode with drag and draft mode working solidly now, straight segments only * default planes match colors, hover and select still TODO * hover and click logic working for default planes Now just need the code mode to fire to 'startSketchOn(...)' * select default planes * remove some logs * fix update infinite loop * start of orbitControls port to Franks control guards * hiding scenes at different times * scene hide on camera move should be respected by scroll zoom * basic hover working * Hook up user camera settings to ClientSideScene (#1334) * Refactor to not import utilities from Router.tsx * Stop tracking changes or formatting *.typegen.ts * Hook up cameraControls to ClientSideScene * Remove camera controls toggle from temp debug panel --------- Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> * add select segment moves cursor * highlight segments yellow on hover * cursor ranges effect 2d line colors * fix constrainst i.e. make sure the sketch is rejiged * selecting nothing should remove selections * remove hardcoded strings * update get_tangential_arc_to_info rust util * initial drawing of tangential arcs in client scene * fix tangentialArc arrow head direction * correct userData types for tangential arcs * get tangential arc updates working Doesn't include draging the head of the tangential arc itself yet * spot of clean up * make selections work with tangential arcs * get draft tangential segment animated * fix initial click weirdness for adding new tangential line * couple tweaks * add grace pixels /threshold to raycast * redo arc dashes so that they spawn from the ccenter of the arc * fix multi drag bug * fmt * add temp solution for close * add default axis hover colors, still needs select logic * selection of axis works, just with out selection color * get axis selection colors working * fix outdate source ranges after drag problem * update moreNodePathFromSourceRange * fix ts-rs issue/workaround * fix default plane weirdness * fix tangential arc rounding issue * review clean up part 1 * review clean up part 2 Big state-diagram cull * clippy * typo * clippy * fix xstate types with typegen * fix types * clippy * catch error * fix test import issue Not sure exactly what was happening but guessing circular import that vite didn't like * add axis/plane info to sketch group tests * case changes because of rs-ts bug, can probably revert this later * start of playwright test fixes * reduce geo complexity for straight segments * fix cam adjust tests * Revert "Clean up vite build warnings (#1332)" This reverts commit c1f661ab5254458c3e9fdb396a31860a22c790f1. * selection e2e test fixed< * remove camToggle to allow playwright tests to pass * remove drag test too brittle and needs to be redone from the ground up anyway * trigger CI * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * fix last test * clean up part 3 * clean up part 4 * clean up part 5 * clean up sketch enter exit logic * fix engine side selections * default plane should not be selected form 'onDragEnd' i.e. rotating the camera should not mean the user acidently selects a plane * clean up state diagram around animating to sketch mode Embracing that the animation is async and puting the interdiate steps in the state diagram clean up some logic and solved some bugs at the same time * add test for multiple sketches * typo * make highlight more robust * type tweak * scale segmenst with distance from camera so they have a consistent pixel size/ screenspace size * Jess's advice * tsc and fmt * clean up part 6 remove integer from xstate names * clean up part 7 * integrate sequency in to camera moves * fix tests * update snapshot e2e * small snapshot change * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * trigger ci * Fix HomeLoaderData types * update std stuff * update kittycad rs client lib --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-02-11 12:59:00 +11:00
| {
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
type: 'xstate.done.actor.animate-to-face'
output: SketchDetails
Client sketch scene (#1271) * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * make tsc happ * better error msg * fix control point issue * basic code gen working for tangentialArc * partical fix for move with arcs * tangential arc move * fix * make eslint rules less annoying * inital refactor of some xstate stuff * more old tangential arc clean up stuff * more tweaks * add testing * tweak xstate inspect * temp remove test * update formating for less conflicts * fix state machine layout after merge * shrug, something weird with xstate typegen * renaming some xstate events * tweak numbers to make CI playwright happ * CI hacks * more CI hacks * more CI hacks * new hack strategy * run tests agian * make cmd bar less flaky * ci hacks * CI hacks * CI hacks * CI hacks * clean up * fix * still have constraint stuff to deal with * progress on move rules * update source ranges after no execute code-mod * typo * mvp working * hide show sketch overlay * match scaling * update arrow head style * animate line tool * bypass xstate for animations, much smoother * add new segment working with refactor needed for setup paper sketch * refactor setup paper sketch * tangantialArcTo drag animations working * tangential arc polish * cargo fmt * clippy * more clippy * mock canvas * last of clippy? * typo * more clippy stuff * move util function so they are shareable with typescript * migrate a bunch to rust and only rust * add arc center point for draft tangential ac * clippy tweak * delete uneeded test * Rough start to scaling arrow heads. The tangent arrow heads are basically nuked and replaced while the straight line sections are just rotated and repositioned, this means they miss out on updating scaling number after a screen size changes. Needs fixing * fix bug with tool tips * fix draft line start position Having drag the end of teh path before selecting a tooltip would result in the draft line starting where the path used to end, stale data * some progress with pan maybe * fmt * inital camera sync working For perspective camera at least * change three.js to use z-up * add grid * orthographic camera working with polish items TODO * fix zoom level when swapping camera * fix up camera/orbit changing on cam change (pan wasn't being respected) * tidy up * use orbit target instead of assuming scene center * dynamic fov working * animate orthographic to perspective and reverse * fix import * temp fix for batch commands * initial client side scene sketch working * remove hover log * FOV adjust fix * fix comment * tear down sketch and small tweaks * some progress with camera tweening * combine dollyZoom engine commands see https://github.com/KittyCAD/modeling-api/compare/kurt-perspective-settings?expand=1 and https://github.com/KittyCAD/engine/compare/kurt-perspective-settings?expand=1 * make tests happy (mocks) * fix tween to vertical/camera-up bug * tween to each axis with hacky solutions in there * fix startSketchOn planes * tidy startSketchOn * tweening okay for now I think * get sketching on default planes working * allow editing on all default planes * clean up enter and exit sketch logic * tidy * tidy * remove more default plane stuff * start of draft line * remove some annoying parts of the paper.js implementation * fix drag than equip line bug * comment * don't animate on skech tear down since it's used for draft line * remove more default plane shit * style draft line * refine dashed line * draft line set up and tear down mostly happy * add on click logic ready for draft lines * sketch mode with drag and draft mode working solidly now, straight segments only * default planes match colors, hover and select still TODO * hover and click logic working for default planes Now just need the code mode to fire to 'startSketchOn(...)' * select default planes * remove some logs * fix update infinite loop * start of orbitControls port to Franks control guards * hiding scenes at different times * scene hide on camera move should be respected by scroll zoom * basic hover working * Hook up user camera settings to ClientSideScene (#1334) * Refactor to not import utilities from Router.tsx * Stop tracking changes or formatting *.typegen.ts * Hook up cameraControls to ClientSideScene * Remove camera controls toggle from temp debug panel --------- Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> * add select segment moves cursor * highlight segments yellow on hover * cursor ranges effect 2d line colors * fix constrainst i.e. make sure the sketch is rejiged * selecting nothing should remove selections * remove hardcoded strings * update get_tangential_arc_to_info rust util * initial drawing of tangential arcs in client scene * fix tangentialArc arrow head direction * correct userData types for tangential arcs * get tangential arc updates working Doesn't include draging the head of the tangential arc itself yet * spot of clean up * make selections work with tangential arcs * get draft tangential segment animated * fix initial click weirdness for adding new tangential line * couple tweaks * add grace pixels /threshold to raycast * redo arc dashes so that they spawn from the ccenter of the arc * fix multi drag bug * fmt * add temp solution for close * add default axis hover colors, still needs select logic * selection of axis works, just with out selection color * get axis selection colors working * fix outdate source ranges after drag problem * update moreNodePathFromSourceRange * fix ts-rs issue/workaround * fix default plane weirdness * fix tangential arc rounding issue * review clean up part 1 * review clean up part 2 Big state-diagram cull * clippy * typo * clippy * fix xstate types with typegen * fix types * clippy * catch error * fix test import issue Not sure exactly what was happening but guessing circular import that vite didn't like * add axis/plane info to sketch group tests * case changes because of rs-ts bug, can probably revert this later * start of playwright test fixes * reduce geo complexity for straight segments * fix cam adjust tests * Revert "Clean up vite build warnings (#1332)" This reverts commit c1f661ab5254458c3e9fdb396a31860a22c790f1. * selection e2e test fixed< * remove camToggle to allow playwright tests to pass * remove drag test too brittle and needs to be redone from the ground up anyway * trigger CI * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * fix last test * clean up part 3 * clean up part 4 * clean up part 5 * clean up sketch enter exit logic * fix engine side selections * default plane should not be selected form 'onDragEnd' i.e. rotating the camera should not mean the user acidently selects a plane * clean up state diagram around animating to sketch mode Embracing that the animation is async and puting the interdiate steps in the state diagram clean up some logic and solved some bugs at the same time * add test for multiple sketches * typo * make highlight more robust * type tweak * scale segmenst with distance from camera so they have a consistent pixel size/ screenspace size * Jess's advice * tsc and fmt * clean up part 6 remove integer from xstate names * clean up part 7 * integrate sequency in to camera moves * fix tests * update snapshot e2e * small snapshot change * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * trigger ci * Fix HomeLoaderData types * update std stuff * update kittycad rs client lib --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-02-11 12:59:00 +11:00
}
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
| { type: 'xstate.done.actor.animate-to-sketch'; output: SketchDetails }
| { type: `xstate.done.actor.do-constrain${string}`; output: SetSelections }
| { type: 'Set mouse state'; data: MouseState }
| { type: 'Set context'; data: Partial<Store> }
Symbols overlay (#2033) * start of overlay work * add new icons * add constraint symbols * add three dots * add primary colours * refactor how we get constraint info for overlays * refactor how we get constraint info for overlays * get symbols working for tangential arc too * extra data on constraint info * add initial delete * fix types and circular dep issue after rebase * fix quirk with horz vert line overlays * fix setup and tear down of overlays * remove overlays that are too small * throttle overlay updates and prove tests selecting html instead of hardcoded px coords * initial show overaly on segment hover * remove overlays when tool is equipped * dounce overlay updates * tsc * make higlighting robust to small changes in source ranges * replace with variable for unconstrained values, and improve styles for popover * background tweak * make overlays unconstrain inputs * fix small regression * write query for finding related tag references * make delete segment safe * typo * un used imports * test deleteSegmentFromPipeExpression * add getConstraintInfo test * test removeSingleConstraintInfo * more tests * tsc * add tests for overlay buttons * rename tests * fmt * better naming structure * more reliablity * more test tweaks * fix selection test * add delete segments with overlays tests * dependant tag tests for segment delet * typo * test clean up * fix some perf issus * clean up * clean up * make things a little more dry * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * trigger ci * Make constraint hover popovers readable on light mode * Touch up the new variable dialog * Little touch-up to three-dot menu style * fix highlight issue * fmt * use optional chain * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)" This reverts commit be3d61e4a303b0d9a792dddbfe8430cc58d46451. * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * disable var panel in sketch mode * fix overlay tests after mergi in main * test tweak * try fix ubuntu * fmt * more test tweaks * tweak * tweaks --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Frank Noirot <frank@kittycad.io>
2024-05-24 20:54:42 +10:00
| {
type: 'Set Segment Overlays'
data: SegmentOverlayPayload
}
| {
type: 'Delete segment'
data: PathToNode
}
| {
type: 'code edit during sketch'
}
Symbols overlay (#2033) * start of overlay work * add new icons * add constraint symbols * add three dots * add primary colours * refactor how we get constraint info for overlays * refactor how we get constraint info for overlays * get symbols working for tangential arc too * extra data on constraint info * add initial delete * fix types and circular dep issue after rebase * fix quirk with horz vert line overlays * fix setup and tear down of overlays * remove overlays that are too small * throttle overlay updates and prove tests selecting html instead of hardcoded px coords * initial show overaly on segment hover * remove overlays when tool is equipped * dounce overlay updates * tsc * make higlighting robust to small changes in source ranges * replace with variable for unconstrained values, and improve styles for popover * background tweak * make overlays unconstrain inputs * fix small regression * write query for finding related tag references * make delete segment safe * typo * un used imports * test deleteSegmentFromPipeExpression * add getConstraintInfo test * test removeSingleConstraintInfo * more tests * tsc * add tests for overlay buttons * rename tests * fmt * better naming structure * more reliablity * more test tweaks * fix selection test * add delete segments with overlays tests * dependant tag tests for segment delet * typo * test clean up * fix some perf issus * clean up * clean up * make things a little more dry * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * trigger ci * Make constraint hover popovers readable on light mode * Touch up the new variable dialog * Little touch-up to three-dot menu style * fix highlight issue * fmt * use optional chain * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)" This reverts commit be3d61e4a303b0d9a792dddbfe8430cc58d46451. * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * disable var panel in sketch mode * fix overlay tests after mergi in main * test tweak * try fix ubuntu * fmt * more test tweaks * tweak * tweaks --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Frank Noirot <frank@kittycad.io>
2024-05-24 20:54:42 +10:00
| {
type: 'Convert to variable'
data: {
pathToNode: PathToNode
variableName: string
}
}
| {
type: 'change tool'
data: {
tool: SketchTool
}
}
| { type: 'Finish rectangle' }
| { type: 'Artifact graph populated' }
| { type: 'Artifact graph emptied' }
Client sketch scene (#1271) * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * make tsc happ * better error msg * fix control point issue * basic code gen working for tangentialArc * partical fix for move with arcs * tangential arc move * fix * make eslint rules less annoying * inital refactor of some xstate stuff * more old tangential arc clean up stuff * more tweaks * add testing * tweak xstate inspect * temp remove test * update formating for less conflicts * fix state machine layout after merge * shrug, something weird with xstate typegen * renaming some xstate events * tweak numbers to make CI playwright happ * CI hacks * more CI hacks * more CI hacks * new hack strategy * run tests agian * make cmd bar less flaky * ci hacks * CI hacks * CI hacks * CI hacks * clean up * fix * still have constraint stuff to deal with * progress on move rules * update source ranges after no execute code-mod * typo * mvp working * hide show sketch overlay * match scaling * update arrow head style * animate line tool * bypass xstate for animations, much smoother * add new segment working with refactor needed for setup paper sketch * refactor setup paper sketch * tangantialArcTo drag animations working * tangential arc polish * cargo fmt * clippy * more clippy * mock canvas * last of clippy? * typo * more clippy stuff * move util function so they are shareable with typescript * migrate a bunch to rust and only rust * add arc center point for draft tangential ac * clippy tweak * delete uneeded test * Rough start to scaling arrow heads. The tangent arrow heads are basically nuked and replaced while the straight line sections are just rotated and repositioned, this means they miss out on updating scaling number after a screen size changes. Needs fixing * fix bug with tool tips * fix draft line start position Having drag the end of teh path before selecting a tooltip would result in the draft line starting where the path used to end, stale data * some progress with pan maybe * fmt * inital camera sync working For perspective camera at least * change three.js to use z-up * add grid * orthographic camera working with polish items TODO * fix zoom level when swapping camera * fix up camera/orbit changing on cam change (pan wasn't being respected) * tidy up * use orbit target instead of assuming scene center * dynamic fov working * animate orthographic to perspective and reverse * fix import * temp fix for batch commands * initial client side scene sketch working * remove hover log * FOV adjust fix * fix comment * tear down sketch and small tweaks * some progress with camera tweening * combine dollyZoom engine commands see https://github.com/KittyCAD/modeling-api/compare/kurt-perspective-settings?expand=1 and https://github.com/KittyCAD/engine/compare/kurt-perspective-settings?expand=1 * make tests happy (mocks) * fix tween to vertical/camera-up bug * tween to each axis with hacky solutions in there * fix startSketchOn planes * tidy startSketchOn * tweening okay for now I think * get sketching on default planes working * allow editing on all default planes * clean up enter and exit sketch logic * tidy * tidy * remove more default plane stuff * start of draft line * remove some annoying parts of the paper.js implementation * fix drag than equip line bug * comment * don't animate on skech tear down since it's used for draft line * remove more default plane shit * style draft line * refine dashed line * draft line set up and tear down mostly happy * add on click logic ready for draft lines * sketch mode with drag and draft mode working solidly now, straight segments only * default planes match colors, hover and select still TODO * hover and click logic working for default planes Now just need the code mode to fire to 'startSketchOn(...)' * select default planes * remove some logs * fix update infinite loop * start of orbitControls port to Franks control guards * hiding scenes at different times * scene hide on camera move should be respected by scroll zoom * basic hover working * Hook up user camera settings to ClientSideScene (#1334) * Refactor to not import utilities from Router.tsx * Stop tracking changes or formatting *.typegen.ts * Hook up cameraControls to ClientSideScene * Remove camera controls toggle from temp debug panel --------- Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> * add select segment moves cursor * highlight segments yellow on hover * cursor ranges effect 2d line colors * fix constrainst i.e. make sure the sketch is rejiged * selecting nothing should remove selections * remove hardcoded strings * update get_tangential_arc_to_info rust util * initial drawing of tangential arcs in client scene * fix tangentialArc arrow head direction * correct userData types for tangential arcs * get tangential arc updates working Doesn't include draging the head of the tangential arc itself yet * spot of clean up * make selections work with tangential arcs * get draft tangential segment animated * fix initial click weirdness for adding new tangential line * couple tweaks * add grace pixels /threshold to raycast * redo arc dashes so that they spawn from the ccenter of the arc * fix multi drag bug * fmt * add temp solution for close * add default axis hover colors, still needs select logic * selection of axis works, just with out selection color * get axis selection colors working * fix outdate source ranges after drag problem * update moreNodePathFromSourceRange * fix ts-rs issue/workaround * fix default plane weirdness * fix tangential arc rounding issue * review clean up part 1 * review clean up part 2 Big state-diagram cull * clippy * typo * clippy * fix xstate types with typegen * fix types * clippy * catch error * fix test import issue Not sure exactly what was happening but guessing circular import that vite didn't like * add axis/plane info to sketch group tests * case changes because of rs-ts bug, can probably revert this later * start of playwright test fixes * reduce geo complexity for straight segments * fix cam adjust tests * Revert "Clean up vite build warnings (#1332)" This reverts commit c1f661ab5254458c3e9fdb396a31860a22c790f1. * selection e2e test fixed< * remove camToggle to allow playwright tests to pass * remove drag test too brittle and needs to be redone from the ground up anyway * trigger CI * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * fix last test * clean up part 3 * clean up part 4 * clean up part 5 * clean up sketch enter exit logic * fix engine side selections * default plane should not be selected form 'onDragEnd' i.e. rotating the camera should not mean the user acidently selects a plane * clean up state diagram around animating to sketch mode Embracing that the animation is async and puting the interdiate steps in the state diagram clean up some logic and solved some bugs at the same time * add test for multiple sketches * typo * make highlight more robust * type tweak * scale segmenst with distance from camera so they have a consistent pixel size/ screenspace size * Jess's advice * tsc and fmt * clean up part 6 remove integer from xstate names * clean up part 7 * integrate sequency in to camera moves * fix tests * update snapshot e2e * small snapshot change * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * trigger ci * Fix HomeLoaderData types * update std stuff * update kittycad rs client lib --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-02-11 12:59:00 +11:00
export type MoveDesc = { line: number; snippet: string }
export const PERSIST_MODELING_CONTEXT = 'persistModelingContext'
interface PersistedModelingContext {
openPanes: Store['openPanes']
}
type PersistedKeys = keyof PersistedModelingContext
export const PersistedValues: PersistedKeys[] = ['openPanes']
export const getPersistedContext = (): Partial<PersistedModelingContext> => {
const c = (typeof window !== 'undefined' &&
JSON.parse(localStorage.getItem(PERSIST_MODELING_CONTEXT) || '{}')) || {
openPanes: ['code'],
}
return c
}
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
export interface ModelingMachineContext {
currentMode: ToolbarModeName
currentTool: SketchTool
selection: string[]
selectionRanges: Selections
sketchDetails: SketchDetails | null
sketchPlaneId: string
sketchEnginePathId: string
moveDescs: MoveDesc[]
mouseState: MouseState
segmentOverlays: SegmentOverlays
segmentHoverMap: { [pathToNodeString: string]: number }
store: Store
}
export const modelingMachineDefaultContext: ModelingMachineContext = {
currentMode: 'modeling',
currentTool: 'none',
selection: [],
selectionRanges: {
otherSelections: [],
codeBasedSelections: [],
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
},
sketchDetails: {
sketchPathToNode: [],
zAxis: [0, 0, 1],
yAxis: [0, 1, 0],
origin: [0, 0, 0],
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
},
sketchPlaneId: '',
sketchEnginePathId: '',
moveDescs: [],
mouseState: { type: 'idle' },
segmentOverlays: {},
segmentHoverMap: {},
store: {
openPanes: getPersistedContext().openPanes || ['code'],
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
},
}
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
export const modelingMachine = setup({
types: {
context: {} as ModelingMachineContext,
events: {} as ModelingMachineEvent,
input: {} as ModelingMachineContext,
},
guards: {
'Selection is on face': () => false,
'has valid extrude selection': () => false,
'has valid revolve selection': () => false,
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
'has valid fillet selection': () => false,
'Has exportable geometry': () => false,
'has valid selection for deletion': () => false,
'has made first point': ({ context }) => {
if (!context.sketchDetails?.sketchPathToNode) return false
const variableDeclaration = getNodeFromPath<VariableDeclarator>(
kclManager.ast,
context.sketchDetails.sketchPathToNode,
'VariableDeclarator'
)
if (err(variableDeclaration)) return false
if (variableDeclaration.node.type !== 'VariableDeclarator') return false
const pipeExpression = variableDeclaration.node.init
if (pipeExpression.type !== 'PipeExpression') return false
const hasStartSketchOn = pipeExpression.body.some(
(item) =>
item.type === 'CallExpression' && item.callee.name === 'startSketchOn'
)
return hasStartSketchOn && pipeExpression.body.length > 1
xstate migration (#713) * Add basic Popover functionality * Fix up light mode of basic bar * Add support for 2D and 3D mode styling * Turn toolbar buttons back on * Remove ActionButton until after tool logic refactor * Add transitions * Add initial modeling machine This is not a full description of how the modelingMachine should work, but begins to replicate all of the features of our useStore in XState instead of zustand. * Add fillet tool flow * Refactor: break out engine manager setup into hook Preparing for making a wrapper component around the App that will manage the engine manager at the same level as the modelingMachine. * Create modeling provider, move engine management to it * Refactor: move other engine-related useEffect into hook * Add TS schema, selection actions to modelingMachine * Add barebones modeling machine to app Only implementing adding to code-based selections in the text editor so far * Update moved useEffect hook after merge * give myself reminder TODO * fix engineCommandManager waitForReady Promise * enable devtools * make utility class for handling default planes * progresson startNewSketch and EditSketch * add provider to tests * too large of a commit put all of the lang state into another singleton, but did lots of work on xstate too * fix edit sketch ast issue * re-execute on sketch exit * prettierignore xstate typegen file * add move tool button back in * handle mouse commands with xState states * fix move * remove old imports * big useStore delete * fix some destructuring bugs * start of constraint actions * add horizontal/vertical distance constraints * fix more destructuring errors * fix * add angle constaints * add align vertically/horizontally constraints * add length and equal length constraints * rename modal states to be more cmd bar friendly * add doesPipeHave query * add another query * add extrude states * state machine clean up * xstate layout tweak * make xstate types happy * Revamp cursor logic and place curors after ast mod * Xstate merge (#796) * turning back on all planes (#720) * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix more tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> fix stdlib Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> compile Signed-off-by: Jess Frazelle <github@jessfraz.com> update sample code Signed-off-by: Jess Frazelle <github@jessfraz.com> re-enable the planes Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> fix all tests Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> boilerplate Signed-off-by: Jess Frazelle <github@jessfraz.com> Cut release v0.9.2 (#714) rust make default planes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> use the planes from engine Signed-off-by: Jess Frazelle <github@jessfraz.com> fixups Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> negative args Signed-off-by: Jess Frazelle <github@jessfraz.com> diable camera Signed-off-by: Jess Frazelle <github@jessfraz.com> hide planes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updatress Signed-off-by: Jess Frazelle <github@jessfraz.com> fmt Signed-off-by: Jess Frazelle <github@jessfraz.com> Update src/hooks/useAppMode.ts Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch> Update src/hooks/useAppMode.ts Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch> cleanups Signed-off-by: Jess Frazelle <github@jessfraz.com> Bump kittycad from 0.2.26 to 0.2.27 in /src-tauri (#726) Bumps [kittycad](https://github.com/KittyCAD/kittycad.rs) from 0.2.26 to 0.2.27. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/v0.2.26...v0.2.27) --- updated-dependencies: - dependency-name: kittycad dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump tauri-plugin-fs-extra from `b04bde3` to `6c7a4c0` in /src-tauri (#725) Bumps [tauri-plugin-fs-extra](https://github.com/tauri-apps/plugins-workspace) from `b04bde3` to `6c7a4c0`. - [Release notes](https://github.com/tauri-apps/plugins-workspace/releases) - [Commits](https://github.com/tauri-apps/plugins-workspace/compare/b04bde3461066c709d6801cf9ca305cf889a8394...6c7a4c09847f9659f9393a1412fa59bebd7c2004) --- updated-dependencies: - dependency-name: tauri-plugin-fs-extra dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump toml from 0.8.0 to 0.8.1 in /src-tauri (#724) Bumps [toml](https://github.com/toml-rs/toml) from 0.8.0 to 0.8.1. - [Commits](https://github.com/toml-rs/toml/compare/toml-v0.8.0...toml-v0.8.1) --- updated-dependencies: - dependency-name: toml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump openapitor from `61a1605` to `d3e98c4` in /src/wasm-lib (#723) Bumps [openapitor](https://github.com/KittyCAD/kittycad.rs) from `61a1605` to `d3e98c4`. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/61a16059b3eaf8793a2a2e1edbc0d770f284fea3...d3e98c4ec0ff7c307d66378eab1c4630250ec210) --- updated-dependencies: - dependency-name: openapitor dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump kittycad from 0.2.26 to 0.2.27 in /src/wasm-lib (#722) Bumps [kittycad](https://github.com/KittyCAD/kittycad.rs) from 0.2.26 to 0.2.27. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/v0.2.26...v0.2.27) --- updated-dependencies: - dependency-name: kittycad dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump thiserror from 1.0.48 to 1.0.49 in /src/wasm-lib (#721) Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.48 to 1.0.49. - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](https://github.com/dtolnay/thiserror/compare/1.0.48...1.0.49) --- updated-dependencies: - dependency-name: thiserror dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump expectorate from 1.0.7 to 1.1.0 in /src/wasm-lib (#712) Bumps [expectorate](https://github.com/oxidecomputer/expectorate) from 1.0.7 to 1.1.0. - [Release notes](https://github.com/oxidecomputer/expectorate/releases) - [Commits](https://github.com/oxidecomputer/expectorate/compare/v1.0.7...v1.1.0) --- updated-dependencies: - dependency-name: expectorate dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump clap from 4.4.4 to 4.4.5 in /src/wasm-lib (#711) Bumps [clap](https://github.com/clap-rs/clap) from 4.4.4 to 4.4.5. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.4.4...v4.4.5) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> refactor cleanup Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> type improvements * use new sketchmode no camera Signed-off-by: Jess Frazelle <github@jessfraz.com> * js working better Signed-off-by: Jess Frazelle <github@jessfraz.com> * start of negative planes Signed-off-by: Jess Frazelle <github@jessfraz.com> * tests and neg Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * images Signed-off-by: Jess Frazelle <github@jessfraz.com> * norma;s Signed-off-by: Jess Frazelle <github@jessfraz.com> * better initial load of planes Signed-off-by: Jess Frazelle <github@jessfraz.com> * ts Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix tsc Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix edit sketch Signed-off-by: Jess Frazelle <github@jessfraz.com> * add regression test for 2d solid issue Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * show planes Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix clippy Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> * canecel in progress Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix ci as well Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> * stopping point Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * refactor Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * it works Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * Hide planes (#797) * hide planes in one go Signed-off-by: Jess Frazelle <github@jessfraz.com> * update hide; Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> * make tsc happy * Make "Replay Onboarding" button available on home settings page (#804) * Fix unrelated bug, settings button in the home sidebar doesn't go to the home settings after my previous fixes to routes * Turn on "Replay Onboarding" button in home settings * Use ONBOARDING_PROJECT_NAME in both places * Fix formatting * Cut release v0.10.0 (#803) Co-authored-by: Frank Noirot <frank@kittycad.io> * Bump kittycad from 0.2.28 to 0.2.31 in /src-tauri (#798) Bumps [kittycad](https://github.com/KittyCAD/kittycad.rs) from 0.2.28 to 0.2.31. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/v0.2.28...v0.2.31) --- updated-dependencies: - dependency-name: kittycad dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump openapitor from `fa0345c` to `c122a9b` in /src/wasm-lib (#800) Bumps [openapitor](https://github.com/KittyCAD/kittycad.rs) from `fa0345c` to `c122a9b`. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/fa0345c514fcc9ae6cd74ae35c8e5c2800fec34f...c122a9b1d6afe51c25e545b5e0bbeb91d367e6d2) --- updated-dependencies: - dependency-name: openapitor dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump syn from 2.0.37 to 2.0.38 in /src/wasm-lib (#801) Bumps [syn](https://github.com/dtolnay/syn) from 2.0.37 to 2.0.38. - [Release notes](https://github.com/dtolnay/syn/releases) - [Commits](https://github.com/dtolnay/syn/compare/2.0.37...2.0.38) --- updated-dependencies: - dependency-name: syn dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump winnow from 0.5.15 to 0.5.16 in /src/wasm-lib (#799) Bumps [winnow](https://github.com/winnow-rs/winnow) from 0.5.15 to 0.5.16. - [Changelog](https://github.com/winnow-rs/winnow/blob/main/CHANGELOG.md) - [Commits](https://github.com/winnow-rs/winnow/compare/v0.5.15...v0.5.16) --- updated-dependencies: - dependency-name: winnow dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump tauri-plugin-fs-extra from `fa32d1a` to `9f27e6e` in /src-tauri (#802) Bumps [tauri-plugin-fs-extra](https://github.com/tauri-apps/plugins-workspace) from `fa32d1a` to `9f27e6e`. - [Release notes](https://github.com/tauri-apps/plugins-workspace/releases) - [Commits](https://github.com/tauri-apps/plugins-workspace/compare/fa32d1afa97f52f74d814c5619b8d95da3268e3e...9f27e6e4415ddf6c40f846d50c0d95c768cded77) --- updated-dependencies: - dependency-name: tauri-plugin-fs-extra dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * better plane selection Signed-off-by: Jess Frazelle <github@jessfraz.com> * use the sketch plane id Signed-off-by: Jess Frazelle <github@jessfraz.com> * add todo w bug Signed-off-by: Jess Frazelle <github@jessfraz.com> * Improve Prop Typings for Modals. Remove instances of `any`. (#792) * Update typings for modals. Remove instances of `any` * Fix generic type for creating modals * cleanup other stuffs Signed-off-by: Jess Frazelle <github@jessfraz.com> * make plane id available when selecting default plane * few clean up things * change enter sketch action order to make sure plane id is available to 'enter edit mode' * Revert "Improve Prop Typings for Modals. Remove instances of `any`. (… (#813) Revert "Improve Prop Typings for Modals. Remove instances of `any`. (#792)" This reverts commit 629f326f4cdf13d83a62f471b4b9a40d3c3a2a88. * ffmpeg instructions (#814) * fix some tsc stuff * small tweak --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jason Rametta <rametta@outlook.com> * clean up * fix test and tsc * remove one more thing from useStore * tweak state digrame layout * fmt --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Frank Johnson <frankjohnson1993@gmail.com> Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jason Rametta <rametta@outlook.com>
2023-10-11 13:36:54 +11:00
},
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
'is editing existing sketch': ({ context: { sketchDetails } }) =>
isEditingExistingSketch({ sketchDetails }),
'Can make selection horizontal': ({ context: { selectionRanges } }) => {
const info = horzVertInfo(selectionRanges, 'horizontal')
if (trap(info)) return false
return info.enabled
},
'Can make selection vertical': ({ context: { selectionRanges } }) => {
const info = horzVertInfo(selectionRanges, 'vertical')
if (trap(info)) return false
return info.enabled
},
'Can constrain horizontal distance': ({ context: { selectionRanges } }) => {
const info = horzVertDistanceInfo({
selectionRanges,
constraint: 'setHorzDistance',
})
if (trap(info)) return false
return info.enabled
},
'Can constrain vertical distance': ({ context: { selectionRanges } }) => {
const info = horzVertDistanceInfo({
selectionRanges,
constraint: 'setVertDistance',
})
if (trap(info)) return false
return info.enabled
},
'Can constrain ABS X': ({ context: { selectionRanges } }) => {
const info = absDistanceInfo({ selectionRanges, constraint: 'xAbs' })
if (trap(info)) return false
return info.enabled
},
'Can constrain ABS Y': ({ context: { selectionRanges } }) => {
const info = absDistanceInfo({ selectionRanges, constraint: 'yAbs' })
if (trap(info)) return false
return info.enabled
},
'Can constrain angle': ({ context: { selectionRanges } }) => {
const angleBetween = angleBetweenInfo({ selectionRanges })
if (trap(angleBetween)) return false
const angleLength = angleLengthInfo({
selectionRanges,
angleOrLength: 'setAngle',
})
if (trap(angleLength)) return false
return angleBetween.enabled || angleLength.enabled
},
'Can constrain length': ({ context: { selectionRanges } }) => {
const angleLength = angleLengthInfo({ selectionRanges })
if (trap(angleLength)) return false
return angleLength.enabled
},
'Can constrain perpendicular distance': ({
context: { selectionRanges },
}) => {
const info = intersectInfo({ selectionRanges })
if (trap(info)) return false
return info.enabled
},
'Can constrain horizontally align': ({ context: { selectionRanges } }) => {
const info = horzVertDistanceInfo({
selectionRanges,
constraint: 'setHorzDistance',
})
if (trap(info)) return false
return info.enabled
},
'Can constrain vertically align': ({ context: { selectionRanges } }) => {
const info = horzVertDistanceInfo({
selectionRanges,
constraint: 'setHorzDistance',
})
if (trap(info)) return false
return info.enabled
},
'Can constrain snap to X': ({ context: { selectionRanges } }) => {
const info = absDistanceInfo({
selectionRanges,
constraint: 'snapToXAxis',
})
if (trap(info)) return false
return info.enabled
},
'Can constrain snap to Y': ({ context: { selectionRanges } }) => {
const info = absDistanceInfo({
selectionRanges,
constraint: 'snapToYAxis',
})
if (trap(info)) return false
return info.enabled
},
'Can constrain equal length': ({ context: { selectionRanges } }) => {
const info = setEqualLengthInfo({ selectionRanges })
if (trap(info)) return false
return info.enabled
},
'Can canstrain parallel': ({ context: { selectionRanges } }) => {
const info = equalAngleInfo({ selectionRanges })
if (err(info)) return false
return info.enabled
},
'Can constrain remove constraints': ({
context: { selectionRanges },
event,
}) => {
if (event.type !== 'Constrain remove constraints') return false
const info = removeConstrainingValuesInfo({
selectionRanges,
pathToNodes: event.data && [event.data],
})
if (trap(info)) return false
return info.enabled
},
'Can convert to variable': ({ event }) => {
if (event.type !== 'Convert to variable') return false
if (!event.data) return false
const ast = parse(recast(kclManager.ast))
if (err(ast)) return false
const isSafeRetVal = isNodeSafeToReplacePath(ast, event.data.pathToNode)
if (err(isSafeRetVal)) return false
return isSafeRetVal.isSafe
},
'next is tangential arc': ({ context: { sketchDetails, currentTool } }) =>
currentTool === 'tangentialArc' &&
isEditingExistingSketch({ sketchDetails }),
'next is rectangle': ({ context: { sketchDetails, currentTool } }) =>
currentTool === 'rectangle' && canRectangleTool({ sketchDetails }),
'next is line': ({ context }) => context.currentTool === 'line',
2024-09-11 06:09:39 +10:00
'next is none': ({ context }) => context.currentTool === 'none',
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
},
// end guards
actions: {
'assign tool in context': assign({
currentTool: ({ event }) =>
'data' in event && event.data && 'tool' in event.data
? event.data.tool
: 'none',
}),
'enter sketching mode': assign({ currentMode: 'sketching' }),
'enter modeling mode': assign({ currentMode: 'modeling' }),
'set sketchMetadata from pathToNode': assign(
({ context: { sketchDetails } }) => {
if (!sketchDetails?.sketchPathToNode || !sketchDetails) return {}
return {
sketchDetails: {
...sketchDetails,
sketchPathToNode: sketchDetails.sketchPathToNode,
Text-to-CAD with alpha model (might have issues) integration (#3299) * Add close dismiss button to Infinite duration non-loading toasts * Add text-to-cad icon candidates * Add a way to silently create files * Add text-to-cad command with mock backend * add the actual endpoint Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix the response Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixups Signed-off-by: Jess Frazelle <github@jessfraz.com> * Add `credentials: include` * add headers Signed-off-by: Jess Frazelle <github@jessfraz.com> * Mostly working? Just getting CORS on desktop * Merge goof * fixups Signed-off-by: Jess Frazelle <github@jessfraz.com> * create cross platform fetch; Signed-off-by: Jess Frazelle <github@jessfraz.com> * send the token; Signed-off-by: Jess Frazelle <github@jessfraz.com> * send the token; Signed-off-by: Jess Frazelle <github@jessfraz.com> * better names for files Signed-off-by: Jess Frazelle <github@jessfraz.com> * Commit broken THREEjs success toast * base64 decode Signed-off-by: Jess Frazelle <github@jessfraz.com> * send telemetry on reject / accept Signed-off-by: Jess Frazelle <github@jessfraz.com> * start of tests Signed-off-by: Jess Frazelle <github@jessfraz.com> * more tests Signed-off-by: Jess Frazelle <github@jessfraz.com> * basic tests; Signed-off-by: Jess Frazelle <github@jessfraz.com> * lego Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fmt Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * Get model stylized based on settings * Don't need automatic dismiss button for Infinity-duration toasts anymore * Stylize loaded model, add OrbitControls, polish button behavior * Allow user to retry prompt if one fails * Add an auto-grow textarea input type to the command bar, set text-to-cad to use it * Delete the created file in desktop if user rejects it * Submit with meta+Enter * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * add more tests and various fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * Set `prompt` arg defaultValue to failed prompt value on retry * Add missing `awaits` to playwright tests to get them passing * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * empty --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-08-14 14:26:44 -04:00
},
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
}
}
),
// eslint-disable-next-line @typescript-eslint/no-misused-promises
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
'hide default planes': () => kclManager.hidePlanes(),
'reset sketch metadata': assign({
sketchDetails: null,
sketchEnginePathId: '',
sketchPlaneId: '',
}),
'reset camera position': () => {
// eslint-disable-next-line @typescript-eslint/no-floating-promises
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
engineCommandManager.sendSceneCommand({
type: 'modeling_cmd_req',
cmd_id: uuidv4(),
cmd: {
type: 'default_camera_look_at',
center: { x: 0, y: 0, z: 0 },
vantage: { x: 0, y: -1250, z: 580 },
up: { x: 0, y: 0, z: 1 },
xstate migration (#713) * Add basic Popover functionality * Fix up light mode of basic bar * Add support for 2D and 3D mode styling * Turn toolbar buttons back on * Remove ActionButton until after tool logic refactor * Add transitions * Add initial modeling machine This is not a full description of how the modelingMachine should work, but begins to replicate all of the features of our useStore in XState instead of zustand. * Add fillet tool flow * Refactor: break out engine manager setup into hook Preparing for making a wrapper component around the App that will manage the engine manager at the same level as the modelingMachine. * Create modeling provider, move engine management to it * Refactor: move other engine-related useEffect into hook * Add TS schema, selection actions to modelingMachine * Add barebones modeling machine to app Only implementing adding to code-based selections in the text editor so far * Update moved useEffect hook after merge * give myself reminder TODO * fix engineCommandManager waitForReady Promise * enable devtools * make utility class for handling default planes * progresson startNewSketch and EditSketch * add provider to tests * too large of a commit put all of the lang state into another singleton, but did lots of work on xstate too * fix edit sketch ast issue * re-execute on sketch exit * prettierignore xstate typegen file * add move tool button back in * handle mouse commands with xState states * fix move * remove old imports * big useStore delete * fix some destructuring bugs * start of constraint actions * add horizontal/vertical distance constraints * fix more destructuring errors * fix * add angle constaints * add align vertically/horizontally constraints * add length and equal length constraints * rename modal states to be more cmd bar friendly * add doesPipeHave query * add another query * add extrude states * state machine clean up * xstate layout tweak * make xstate types happy * Revamp cursor logic and place curors after ast mod * Xstate merge (#796) * turning back on all planes (#720) * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix more tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> fix stdlib Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> compile Signed-off-by: Jess Frazelle <github@jessfraz.com> update sample code Signed-off-by: Jess Frazelle <github@jessfraz.com> re-enable the planes Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> fix all tests Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> boilerplate Signed-off-by: Jess Frazelle <github@jessfraz.com> Cut release v0.9.2 (#714) rust make default planes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> use the planes from engine Signed-off-by: Jess Frazelle <github@jessfraz.com> fixups Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> negative args Signed-off-by: Jess Frazelle <github@jessfraz.com> diable camera Signed-off-by: Jess Frazelle <github@jessfraz.com> hide planes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updatress Signed-off-by: Jess Frazelle <github@jessfraz.com> fmt Signed-off-by: Jess Frazelle <github@jessfraz.com> Update src/hooks/useAppMode.ts Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch> Update src/hooks/useAppMode.ts Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch> cleanups Signed-off-by: Jess Frazelle <github@jessfraz.com> Bump kittycad from 0.2.26 to 0.2.27 in /src-tauri (#726) Bumps [kittycad](https://github.com/KittyCAD/kittycad.rs) from 0.2.26 to 0.2.27. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/v0.2.26...v0.2.27) --- updated-dependencies: - dependency-name: kittycad dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump tauri-plugin-fs-extra from `b04bde3` to `6c7a4c0` in /src-tauri (#725) Bumps [tauri-plugin-fs-extra](https://github.com/tauri-apps/plugins-workspace) from `b04bde3` to `6c7a4c0`. - [Release notes](https://github.com/tauri-apps/plugins-workspace/releases) - [Commits](https://github.com/tauri-apps/plugins-workspace/compare/b04bde3461066c709d6801cf9ca305cf889a8394...6c7a4c09847f9659f9393a1412fa59bebd7c2004) --- updated-dependencies: - dependency-name: tauri-plugin-fs-extra dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump toml from 0.8.0 to 0.8.1 in /src-tauri (#724) Bumps [toml](https://github.com/toml-rs/toml) from 0.8.0 to 0.8.1. - [Commits](https://github.com/toml-rs/toml/compare/toml-v0.8.0...toml-v0.8.1) --- updated-dependencies: - dependency-name: toml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump openapitor from `61a1605` to `d3e98c4` in /src/wasm-lib (#723) Bumps [openapitor](https://github.com/KittyCAD/kittycad.rs) from `61a1605` to `d3e98c4`. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/61a16059b3eaf8793a2a2e1edbc0d770f284fea3...d3e98c4ec0ff7c307d66378eab1c4630250ec210) --- updated-dependencies: - dependency-name: openapitor dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump kittycad from 0.2.26 to 0.2.27 in /src/wasm-lib (#722) Bumps [kittycad](https://github.com/KittyCAD/kittycad.rs) from 0.2.26 to 0.2.27. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/v0.2.26...v0.2.27) --- updated-dependencies: - dependency-name: kittycad dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump thiserror from 1.0.48 to 1.0.49 in /src/wasm-lib (#721) Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.48 to 1.0.49. - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](https://github.com/dtolnay/thiserror/compare/1.0.48...1.0.49) --- updated-dependencies: - dependency-name: thiserror dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump expectorate from 1.0.7 to 1.1.0 in /src/wasm-lib (#712) Bumps [expectorate](https://github.com/oxidecomputer/expectorate) from 1.0.7 to 1.1.0. - [Release notes](https://github.com/oxidecomputer/expectorate/releases) - [Commits](https://github.com/oxidecomputer/expectorate/compare/v1.0.7...v1.1.0) --- updated-dependencies: - dependency-name: expectorate dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump clap from 4.4.4 to 4.4.5 in /src/wasm-lib (#711) Bumps [clap](https://github.com/clap-rs/clap) from 4.4.4 to 4.4.5. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.4.4...v4.4.5) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> refactor cleanup Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> type improvements * use new sketchmode no camera Signed-off-by: Jess Frazelle <github@jessfraz.com> * js working better Signed-off-by: Jess Frazelle <github@jessfraz.com> * start of negative planes Signed-off-by: Jess Frazelle <github@jessfraz.com> * tests and neg Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * images Signed-off-by: Jess Frazelle <github@jessfraz.com> * norma;s Signed-off-by: Jess Frazelle <github@jessfraz.com> * better initial load of planes Signed-off-by: Jess Frazelle <github@jessfraz.com> * ts Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix tsc Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix edit sketch Signed-off-by: Jess Frazelle <github@jessfraz.com> * add regression test for 2d solid issue Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * show planes Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix clippy Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> * canecel in progress Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix ci as well Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> * stopping point Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * refactor Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * it works Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * Hide planes (#797) * hide planes in one go Signed-off-by: Jess Frazelle <github@jessfraz.com> * update hide; Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> * make tsc happy * Make "Replay Onboarding" button available on home settings page (#804) * Fix unrelated bug, settings button in the home sidebar doesn't go to the home settings after my previous fixes to routes * Turn on "Replay Onboarding" button in home settings * Use ONBOARDING_PROJECT_NAME in both places * Fix formatting * Cut release v0.10.0 (#803) Co-authored-by: Frank Noirot <frank@kittycad.io> * Bump kittycad from 0.2.28 to 0.2.31 in /src-tauri (#798) Bumps [kittycad](https://github.com/KittyCAD/kittycad.rs) from 0.2.28 to 0.2.31. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/v0.2.28...v0.2.31) --- updated-dependencies: - dependency-name: kittycad dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump openapitor from `fa0345c` to `c122a9b` in /src/wasm-lib (#800) Bumps [openapitor](https://github.com/KittyCAD/kittycad.rs) from `fa0345c` to `c122a9b`. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/fa0345c514fcc9ae6cd74ae35c8e5c2800fec34f...c122a9b1d6afe51c25e545b5e0bbeb91d367e6d2) --- updated-dependencies: - dependency-name: openapitor dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump syn from 2.0.37 to 2.0.38 in /src/wasm-lib (#801) Bumps [syn](https://github.com/dtolnay/syn) from 2.0.37 to 2.0.38. - [Release notes](https://github.com/dtolnay/syn/releases) - [Commits](https://github.com/dtolnay/syn/compare/2.0.37...2.0.38) --- updated-dependencies: - dependency-name: syn dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump winnow from 0.5.15 to 0.5.16 in /src/wasm-lib (#799) Bumps [winnow](https://github.com/winnow-rs/winnow) from 0.5.15 to 0.5.16. - [Changelog](https://github.com/winnow-rs/winnow/blob/main/CHANGELOG.md) - [Commits](https://github.com/winnow-rs/winnow/compare/v0.5.15...v0.5.16) --- updated-dependencies: - dependency-name: winnow dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump tauri-plugin-fs-extra from `fa32d1a` to `9f27e6e` in /src-tauri (#802) Bumps [tauri-plugin-fs-extra](https://github.com/tauri-apps/plugins-workspace) from `fa32d1a` to `9f27e6e`. - [Release notes](https://github.com/tauri-apps/plugins-workspace/releases) - [Commits](https://github.com/tauri-apps/plugins-workspace/compare/fa32d1afa97f52f74d814c5619b8d95da3268e3e...9f27e6e4415ddf6c40f846d50c0d95c768cded77) --- updated-dependencies: - dependency-name: tauri-plugin-fs-extra dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * better plane selection Signed-off-by: Jess Frazelle <github@jessfraz.com> * use the sketch plane id Signed-off-by: Jess Frazelle <github@jessfraz.com> * add todo w bug Signed-off-by: Jess Frazelle <github@jessfraz.com> * Improve Prop Typings for Modals. Remove instances of `any`. (#792) * Update typings for modals. Remove instances of `any` * Fix generic type for creating modals * cleanup other stuffs Signed-off-by: Jess Frazelle <github@jessfraz.com> * make plane id available when selecting default plane * few clean up things * change enter sketch action order to make sure plane id is available to 'enter edit mode' * Revert "Improve Prop Typings for Modals. Remove instances of `any`. (… (#813) Revert "Improve Prop Typings for Modals. Remove instances of `any`. (#792)" This reverts commit 629f326f4cdf13d83a62f471b4b9a40d3c3a2a88. * ffmpeg instructions (#814) * fix some tsc stuff * small tweak --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jason Rametta <rametta@outlook.com> * clean up * fix test and tsc * remove one more thing from useStore * tweak state digrame layout * fmt --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Frank Johnson <frankjohnson1993@gmail.com> Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jason Rametta <rametta@outlook.com>
2023-10-11 13:36:54 +11:00
},
})
},
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
'set new sketch metadata': assign(({ event }) => {
if (
event.type !== 'xstate.done.actor.animate-to-sketch' &&
event.type !== 'xstate.done.actor.animate-to-face'
)
return {}
return {
sketchDetails: event.output,
}
}),
'AST extrude': ({ context: { store }, event }) => {
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
if (event.type !== 'Extrude') return
;(async () => {
if (!event.data) return
const { selection, distance } = event.data
let ast = kclManager.ast
if (
'variableName' in distance &&
distance.variableName &&
distance.insertIndex !== undefined
) {
const newBody = [...ast.body]
newBody.splice(
distance.insertIndex,
0,
distance.variableDeclarationAst
)
ast.body = newBody
}
const pathToNode = getNodePathFromSourceRange(
ast,
selection.codeBasedSelections[0].range
)
const extrudeSketchRes = extrudeSketch(
ast,
pathToNode,
false,
'variableName' in distance
? distance.variableIdentifierAst
: distance.valueAst
)
if (trap(extrudeSketchRes)) return
const { modifiedAst, pathToExtrudeArg } = extrudeSketchRes
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
store.videoElement?.pause()
const updatedAst = await kclManager.updateAst(modifiedAst, true, {
focusPath: [pathToExtrudeArg],
zoomToFit: true,
zoomOnRangeAndType: {
range: selection.codeBasedSelections[0].range,
type: 'path',
},
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
})
if (!engineCommandManager.engineConnection?.idleMode) {
store.videoElement?.play().catch((e) => {
console.warn('Video playing was prevented', e)
})
}
if (updatedAst?.selections) {
editorManager.selectRange(updatedAst?.selections)
}
})().catch(reportRejection)
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
},
'AST revolve': ({ context: { store }, event }) => {
if (event.type !== 'Revolve') return
;(async () => {
if (!event.data) return
const { selection, angle } = event.data
let ast = kclManager.ast
if (
'variableName' in angle &&
angle.variableName &&
angle.insertIndex !== undefined
) {
const newBody = [...ast.body]
newBody.splice(angle.insertIndex, 0, angle.variableDeclarationAst)
ast.body = newBody
}
const pathToNode = getNodePathFromSourceRange(
ast,
selection.codeBasedSelections[0].range
)
const revolveSketchRes = revolveSketch(
ast,
pathToNode,
false,
'variableName' in angle ? angle.variableIdentifierAst : angle.valueAst
)
if (trap(revolveSketchRes)) return
const { modifiedAst, pathToRevolveArg } = revolveSketchRes
store.videoElement?.pause()
const updatedAst = await kclManager.updateAst(modifiedAst, true, {
focusPath: [pathToRevolveArg],
zoomToFit: true,
zoomOnRangeAndType: {
range: selection.codeBasedSelections[0].range,
type: 'path',
},
})
if (!engineCommandManager.engineConnection?.idleMode) {
store.videoElement?.play().catch((e) => {
console.warn('Video playing was prevented', e)
})
}
if (updatedAst?.selections) {
editorManager.selectRange(updatedAst?.selections)
}
})().catch(reportRejection)
},
'AST delete selection': ({ context: { selectionRanges } }) => {
;(async () => {
let ast = kclManager.ast
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
const modifiedAst = await deleteFromSelection(
ast,
selectionRanges.codeBasedSelections[0],
kclManager.programMemory,
getFaceDetails
)
if (err(modifiedAst)) return
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
const testExecute = await executeAst({
ast: modifiedAst,
useFakeExecutor: true,
engineCommandManager,
})
if (testExecute.errors.length) {
toast.error('Unable to delete part')
return
}
await kclManager.updateAst(modifiedAst, true)
})().catch(reportRejection)
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
},
'AST fillet': ({ event }) => {
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
if (event.type !== 'Fillet') return
if (!event.data) return
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
// Extract inputs
const ast = kclManager.ast
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
const { selection, radius } = event.data
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
// Apply fillet to selection
const applyFilletToSelectionResult = applyFilletToSelection(
ast,
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
selection,
radius
)
if (err(applyFilletToSelectionResult)) return applyFilletToSelectionResult
},
'set selection filter to curves only': () => {
;(async () => {
await engineCommandManager.sendSceneCommand({
type: 'modeling_cmd_req',
cmd_id: uuidv4(),
cmd: {
type: 'set_selection_filter',
filter: ['curve'],
},
})
})().catch(reportRejection)
},
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
'conditionally equip line tool': ({ event: { type } }) => {
if (type === 'xstate.done.actor.animate-to-face') {
sceneInfra.modelingSend({
type: 'change tool',
data: { tool: 'line' },
})
}
},
'setup client side sketch segments': ({
context: { sketchDetails, selectionRanges },
}) => {
if (!sketchDetails) return
;(async () => {
if (Object.keys(sceneEntitiesManager.activeSegments).length > 0) {
await sceneEntitiesManager.tearDownSketch({ removeAxis: false })
}
sceneInfra.resetMouseListeners()
await sceneEntitiesManager.setupSketch({
sketchPathToNode: sketchDetails?.sketchPathToNode || [],
forward: sketchDetails.zAxis,
up: sketchDetails.yAxis,
position: sketchDetails.origin,
maybeModdedAst: kclManager.ast,
selectionRanges,
})
sceneInfra.resetMouseListeners()
sceneEntitiesManager.setupSketchIdleCallbacks({
pathToNode: sketchDetails?.sketchPathToNode || [],
forward: sketchDetails.zAxis,
up: sketchDetails.yAxis,
position: sketchDetails.origin,
})
})().catch(reportRejection)
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
},
'tear down client sketch': () => {
if (sceneEntitiesManager.activeSegments) {
// eslint-disable-next-line @typescript-eslint/no-floating-promises
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
sceneEntitiesManager.tearDownSketch({ removeAxis: false })
}
},
'remove sketch grid': () => sceneEntitiesManager.removeSketchGrid(),
'set up draft line': ({ context: { sketchDetails } }) => {
if (!sketchDetails) return
// eslint-disable-next-line @typescript-eslint/no-floating-promises
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
sceneEntitiesManager.setUpDraftSegment(
sketchDetails.sketchPathToNode,
sketchDetails.zAxis,
sketchDetails.yAxis,
sketchDetails.origin,
'line'
)
},
'set up draft arc': ({ context: { sketchDetails } }) => {
if (!sketchDetails) return
// eslint-disable-next-line @typescript-eslint/no-floating-promises
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
sceneEntitiesManager.setUpDraftSegment(
sketchDetails.sketchPathToNode,
sketchDetails.zAxis,
sketchDetails.yAxis,
sketchDetails.origin,
'tangentialArcTo'
)
},
'listen for rectangle origin': ({ context: { sketchDetails } }) => {
if (!sketchDetails) return
sceneEntitiesManager.setupNoPointsListener({
sketchDetails,
afterClick: (args) => {
const twoD = args.intersectionPoint?.twoD
if (twoD) {
sceneInfra.modelingSend({
type: 'Add rectangle origin',
data: [twoD.x, twoD.y],
})
} else {
console.error('No intersection point found')
}
},
})
},
'set up draft rectangle': ({ context: { sketchDetails }, event }) => {
if (event.type !== 'Add rectangle origin') return
if (!sketchDetails || !event.data) return
// eslint-disable-next-line @typescript-eslint/no-floating-promises
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
sceneEntitiesManager.setupDraftRectangle(
sketchDetails.sketchPathToNode,
sketchDetails.zAxis,
sketchDetails.yAxis,
sketchDetails.origin,
event.data
)
},
'set up draft line without teardown': ({ context: { sketchDetails } }) => {
if (!sketchDetails) return
// eslint-disable-next-line @typescript-eslint/no-floating-promises
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
sceneEntitiesManager.setUpDraftSegment(
sketchDetails.sketchPathToNode,
sketchDetails.zAxis,
sketchDetails.yAxis,
sketchDetails.origin,
'line',
false
)
},
'show default planes': () => {
// eslint-disable-next-line @typescript-eslint/no-floating-promises
kclManager.showPlanes()
},
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
'setup noPoints onClick listener': ({ context: { sketchDetails } }) => {
if (!sketchDetails) return
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
sceneEntitiesManager.setupNoPointsListener({
sketchDetails,
afterClick: () => sceneInfra.modelingSend({ type: 'Add start point' }),
})
},
'add axis n grid': ({ context: { sketchDetails } }) => {
if (!sketchDetails) return
if (localStorage.getItem('disableAxis')) return
sceneEntitiesManager.createSketchAxis(
sketchDetails.sketchPathToNode || [],
sketchDetails.zAxis,
sketchDetails.yAxis,
sketchDetails.origin
)
},
'reset client scene mouse handlers': () => {
// when not in sketch mode we don't need any mouse listeners
// (note the orbit controls are always active though)
sceneInfra.resetMouseListeners()
},
'clientToEngine cam sync direction': () => {
sceneInfra.camControls.syncDirection = 'clientToEngine'
},
'engineToClient cam sync direction': () => {
sceneInfra.camControls.syncDirection = 'engineToClient'
},
'set selection filter to faces only': () => {
// eslint-disable-next-line @typescript-eslint/no-floating-promises
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
engineCommandManager.sendSceneCommand({
type: 'modeling_cmd_req',
cmd_id: uuidv4(),
cmd: {
type: 'set_selection_filter',
filter: ['face', 'object'],
},
})
},
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
'set selection filter to defaults': () =>
kclManager.defaultSelectionFilter(),
'Delete segment': ({ context: { sketchDetails }, event }) => {
if (event.type !== 'Delete segment') return
if (!sketchDetails || !event.data) return
// eslint-disable-next-line @typescript-eslint/no-floating-promises
deleteSegment({
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
pathToNode: event.data,
sketchDetails,
})
},
'Reset Segment Overlays': () => sceneEntitiesManager.resetOverlays(),
'Set context': assign({
store: ({ context: { store }, event }) => {
if (event.type !== 'Set context') return store
if (!event.data) return store
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
const result = {
...store,
...event.data,
}
const persistedContext: Partial<PersistedModelingContext> = {}
for (const key of PersistedValues) {
persistedContext[key] = result[key]
}
if (typeof window !== 'undefined') {
window.localStorage.setItem(
PERSIST_MODELING_CONTEXT,
JSON.stringify(persistedContext)
)
}
return result
xstate migration (#713) * Add basic Popover functionality * Fix up light mode of basic bar * Add support for 2D and 3D mode styling * Turn toolbar buttons back on * Remove ActionButton until after tool logic refactor * Add transitions * Add initial modeling machine This is not a full description of how the modelingMachine should work, but begins to replicate all of the features of our useStore in XState instead of zustand. * Add fillet tool flow * Refactor: break out engine manager setup into hook Preparing for making a wrapper component around the App that will manage the engine manager at the same level as the modelingMachine. * Create modeling provider, move engine management to it * Refactor: move other engine-related useEffect into hook * Add TS schema, selection actions to modelingMachine * Add barebones modeling machine to app Only implementing adding to code-based selections in the text editor so far * Update moved useEffect hook after merge * give myself reminder TODO * fix engineCommandManager waitForReady Promise * enable devtools * make utility class for handling default planes * progresson startNewSketch and EditSketch * add provider to tests * too large of a commit put all of the lang state into another singleton, but did lots of work on xstate too * fix edit sketch ast issue * re-execute on sketch exit * prettierignore xstate typegen file * add move tool button back in * handle mouse commands with xState states * fix move * remove old imports * big useStore delete * fix some destructuring bugs * start of constraint actions * add horizontal/vertical distance constraints * fix more destructuring errors * fix * add angle constaints * add align vertically/horizontally constraints * add length and equal length constraints * rename modal states to be more cmd bar friendly * add doesPipeHave query * add another query * add extrude states * state machine clean up * xstate layout tweak * make xstate types happy * Revamp cursor logic and place curors after ast mod * Xstate merge (#796) * turning back on all planes (#720) * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix more tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> fix stdlib Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> compile Signed-off-by: Jess Frazelle <github@jessfraz.com> update sample code Signed-off-by: Jess Frazelle <github@jessfraz.com> re-enable the planes Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> fix all tests Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> boilerplate Signed-off-by: Jess Frazelle <github@jessfraz.com> Cut release v0.9.2 (#714) rust make default planes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> use the planes from engine Signed-off-by: Jess Frazelle <github@jessfraz.com> fixups Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> negative args Signed-off-by: Jess Frazelle <github@jessfraz.com> diable camera Signed-off-by: Jess Frazelle <github@jessfraz.com> hide planes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updatress Signed-off-by: Jess Frazelle <github@jessfraz.com> fmt Signed-off-by: Jess Frazelle <github@jessfraz.com> Update src/hooks/useAppMode.ts Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch> Update src/hooks/useAppMode.ts Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch> cleanups Signed-off-by: Jess Frazelle <github@jessfraz.com> Bump kittycad from 0.2.26 to 0.2.27 in /src-tauri (#726) Bumps [kittycad](https://github.com/KittyCAD/kittycad.rs) from 0.2.26 to 0.2.27. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/v0.2.26...v0.2.27) --- updated-dependencies: - dependency-name: kittycad dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump tauri-plugin-fs-extra from `b04bde3` to `6c7a4c0` in /src-tauri (#725) Bumps [tauri-plugin-fs-extra](https://github.com/tauri-apps/plugins-workspace) from `b04bde3` to `6c7a4c0`. - [Release notes](https://github.com/tauri-apps/plugins-workspace/releases) - [Commits](https://github.com/tauri-apps/plugins-workspace/compare/b04bde3461066c709d6801cf9ca305cf889a8394...6c7a4c09847f9659f9393a1412fa59bebd7c2004) --- updated-dependencies: - dependency-name: tauri-plugin-fs-extra dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump toml from 0.8.0 to 0.8.1 in /src-tauri (#724) Bumps [toml](https://github.com/toml-rs/toml) from 0.8.0 to 0.8.1. - [Commits](https://github.com/toml-rs/toml/compare/toml-v0.8.0...toml-v0.8.1) --- updated-dependencies: - dependency-name: toml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump openapitor from `61a1605` to `d3e98c4` in /src/wasm-lib (#723) Bumps [openapitor](https://github.com/KittyCAD/kittycad.rs) from `61a1605` to `d3e98c4`. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/61a16059b3eaf8793a2a2e1edbc0d770f284fea3...d3e98c4ec0ff7c307d66378eab1c4630250ec210) --- updated-dependencies: - dependency-name: openapitor dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump kittycad from 0.2.26 to 0.2.27 in /src/wasm-lib (#722) Bumps [kittycad](https://github.com/KittyCAD/kittycad.rs) from 0.2.26 to 0.2.27. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/v0.2.26...v0.2.27) --- updated-dependencies: - dependency-name: kittycad dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump thiserror from 1.0.48 to 1.0.49 in /src/wasm-lib (#721) Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.48 to 1.0.49. - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](https://github.com/dtolnay/thiserror/compare/1.0.48...1.0.49) --- updated-dependencies: - dependency-name: thiserror dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump expectorate from 1.0.7 to 1.1.0 in /src/wasm-lib (#712) Bumps [expectorate](https://github.com/oxidecomputer/expectorate) from 1.0.7 to 1.1.0. - [Release notes](https://github.com/oxidecomputer/expectorate/releases) - [Commits](https://github.com/oxidecomputer/expectorate/compare/v1.0.7...v1.1.0) --- updated-dependencies: - dependency-name: expectorate dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump clap from 4.4.4 to 4.4.5 in /src/wasm-lib (#711) Bumps [clap](https://github.com/clap-rs/clap) from 4.4.4 to 4.4.5. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.4.4...v4.4.5) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> refactor cleanup Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> type improvements * use new sketchmode no camera Signed-off-by: Jess Frazelle <github@jessfraz.com> * js working better Signed-off-by: Jess Frazelle <github@jessfraz.com> * start of negative planes Signed-off-by: Jess Frazelle <github@jessfraz.com> * tests and neg Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * images Signed-off-by: Jess Frazelle <github@jessfraz.com> * norma;s Signed-off-by: Jess Frazelle <github@jessfraz.com> * better initial load of planes Signed-off-by: Jess Frazelle <github@jessfraz.com> * ts Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix tsc Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix edit sketch Signed-off-by: Jess Frazelle <github@jessfraz.com> * add regression test for 2d solid issue Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * show planes Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix clippy Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> * canecel in progress Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix ci as well Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> * stopping point Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * refactor Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * it works Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * Hide planes (#797) * hide planes in one go Signed-off-by: Jess Frazelle <github@jessfraz.com> * update hide; Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> * make tsc happy * Make "Replay Onboarding" button available on home settings page (#804) * Fix unrelated bug, settings button in the home sidebar doesn't go to the home settings after my previous fixes to routes * Turn on "Replay Onboarding" button in home settings * Use ONBOARDING_PROJECT_NAME in both places * Fix formatting * Cut release v0.10.0 (#803) Co-authored-by: Frank Noirot <frank@kittycad.io> * Bump kittycad from 0.2.28 to 0.2.31 in /src-tauri (#798) Bumps [kittycad](https://github.com/KittyCAD/kittycad.rs) from 0.2.28 to 0.2.31. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/v0.2.28...v0.2.31) --- updated-dependencies: - dependency-name: kittycad dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump openapitor from `fa0345c` to `c122a9b` in /src/wasm-lib (#800) Bumps [openapitor](https://github.com/KittyCAD/kittycad.rs) from `fa0345c` to `c122a9b`. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/fa0345c514fcc9ae6cd74ae35c8e5c2800fec34f...c122a9b1d6afe51c25e545b5e0bbeb91d367e6d2) --- updated-dependencies: - dependency-name: openapitor dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump syn from 2.0.37 to 2.0.38 in /src/wasm-lib (#801) Bumps [syn](https://github.com/dtolnay/syn) from 2.0.37 to 2.0.38. - [Release notes](https://github.com/dtolnay/syn/releases) - [Commits](https://github.com/dtolnay/syn/compare/2.0.37...2.0.38) --- updated-dependencies: - dependency-name: syn dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump winnow from 0.5.15 to 0.5.16 in /src/wasm-lib (#799) Bumps [winnow](https://github.com/winnow-rs/winnow) from 0.5.15 to 0.5.16. - [Changelog](https://github.com/winnow-rs/winnow/blob/main/CHANGELOG.md) - [Commits](https://github.com/winnow-rs/winnow/compare/v0.5.15...v0.5.16) --- updated-dependencies: - dependency-name: winnow dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump tauri-plugin-fs-extra from `fa32d1a` to `9f27e6e` in /src-tauri (#802) Bumps [tauri-plugin-fs-extra](https://github.com/tauri-apps/plugins-workspace) from `fa32d1a` to `9f27e6e`. - [Release notes](https://github.com/tauri-apps/plugins-workspace/releases) - [Commits](https://github.com/tauri-apps/plugins-workspace/compare/fa32d1afa97f52f74d814c5619b8d95da3268e3e...9f27e6e4415ddf6c40f846d50c0d95c768cded77) --- updated-dependencies: - dependency-name: tauri-plugin-fs-extra dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * better plane selection Signed-off-by: Jess Frazelle <github@jessfraz.com> * use the sketch plane id Signed-off-by: Jess Frazelle <github@jessfraz.com> * add todo w bug Signed-off-by: Jess Frazelle <github@jessfraz.com> * Improve Prop Typings for Modals. Remove instances of `any`. (#792) * Update typings for modals. Remove instances of `any` * Fix generic type for creating modals * cleanup other stuffs Signed-off-by: Jess Frazelle <github@jessfraz.com> * make plane id available when selecting default plane * few clean up things * change enter sketch action order to make sure plane id is available to 'enter edit mode' * Revert "Improve Prop Typings for Modals. Remove instances of `any`. (… (#813) Revert "Improve Prop Typings for Modals. Remove instances of `any`. (#792)" This reverts commit 629f326f4cdf13d83a62f471b4b9a40d3c3a2a88. * ffmpeg instructions (#814) * fix some tsc stuff * small tweak --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jason Rametta <rametta@outlook.com> * clean up * fix test and tsc * remove one more thing from useStore * tweak state digrame layout * fmt --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Frank Johnson <frankjohnson1993@gmail.com> Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jason Rametta <rametta@outlook.com>
2023-10-11 13:36:54 +11:00
},
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
}),
Make: () => {},
'enable copilot': () => {},
'disable copilot': () => {},
'Set selection': () => {},
'Set mouse state': () => {},
'Set Segment Overlays': () => {},
'Engine export': () => {},
'Submit to Text-to-CAD API': () => {},
'Set sketchDetails': () => {},
'sketch exit execute': () => {},
xstate migration (#713) * Add basic Popover functionality * Fix up light mode of basic bar * Add support for 2D and 3D mode styling * Turn toolbar buttons back on * Remove ActionButton until after tool logic refactor * Add transitions * Add initial modeling machine This is not a full description of how the modelingMachine should work, but begins to replicate all of the features of our useStore in XState instead of zustand. * Add fillet tool flow * Refactor: break out engine manager setup into hook Preparing for making a wrapper component around the App that will manage the engine manager at the same level as the modelingMachine. * Create modeling provider, move engine management to it * Refactor: move other engine-related useEffect into hook * Add TS schema, selection actions to modelingMachine * Add barebones modeling machine to app Only implementing adding to code-based selections in the text editor so far * Update moved useEffect hook after merge * give myself reminder TODO * fix engineCommandManager waitForReady Promise * enable devtools * make utility class for handling default planes * progresson startNewSketch and EditSketch * add provider to tests * too large of a commit put all of the lang state into another singleton, but did lots of work on xstate too * fix edit sketch ast issue * re-execute on sketch exit * prettierignore xstate typegen file * add move tool button back in * handle mouse commands with xState states * fix move * remove old imports * big useStore delete * fix some destructuring bugs * start of constraint actions * add horizontal/vertical distance constraints * fix more destructuring errors * fix * add angle constaints * add align vertically/horizontally constraints * add length and equal length constraints * rename modal states to be more cmd bar friendly * add doesPipeHave query * add another query * add extrude states * state machine clean up * xstate layout tweak * make xstate types happy * Revamp cursor logic and place curors after ast mod * Xstate merge (#796) * turning back on all planes (#720) * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix more tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> fix stdlib Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> compile Signed-off-by: Jess Frazelle <github@jessfraz.com> update sample code Signed-off-by: Jess Frazelle <github@jessfraz.com> re-enable the planes Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> fix all tests Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> boilerplate Signed-off-by: Jess Frazelle <github@jessfraz.com> Cut release v0.9.2 (#714) rust make default planes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> use the planes from engine Signed-off-by: Jess Frazelle <github@jessfraz.com> fixups Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> negative args Signed-off-by: Jess Frazelle <github@jessfraz.com> diable camera Signed-off-by: Jess Frazelle <github@jessfraz.com> hide planes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updatress Signed-off-by: Jess Frazelle <github@jessfraz.com> fmt Signed-off-by: Jess Frazelle <github@jessfraz.com> Update src/hooks/useAppMode.ts Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch> Update src/hooks/useAppMode.ts Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch> cleanups Signed-off-by: Jess Frazelle <github@jessfraz.com> Bump kittycad from 0.2.26 to 0.2.27 in /src-tauri (#726) Bumps [kittycad](https://github.com/KittyCAD/kittycad.rs) from 0.2.26 to 0.2.27. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/v0.2.26...v0.2.27) --- updated-dependencies: - dependency-name: kittycad dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump tauri-plugin-fs-extra from `b04bde3` to `6c7a4c0` in /src-tauri (#725) Bumps [tauri-plugin-fs-extra](https://github.com/tauri-apps/plugins-workspace) from `b04bde3` to `6c7a4c0`. - [Release notes](https://github.com/tauri-apps/plugins-workspace/releases) - [Commits](https://github.com/tauri-apps/plugins-workspace/compare/b04bde3461066c709d6801cf9ca305cf889a8394...6c7a4c09847f9659f9393a1412fa59bebd7c2004) --- updated-dependencies: - dependency-name: tauri-plugin-fs-extra dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump toml from 0.8.0 to 0.8.1 in /src-tauri (#724) Bumps [toml](https://github.com/toml-rs/toml) from 0.8.0 to 0.8.1. - [Commits](https://github.com/toml-rs/toml/compare/toml-v0.8.0...toml-v0.8.1) --- updated-dependencies: - dependency-name: toml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump openapitor from `61a1605` to `d3e98c4` in /src/wasm-lib (#723) Bumps [openapitor](https://github.com/KittyCAD/kittycad.rs) from `61a1605` to `d3e98c4`. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/61a16059b3eaf8793a2a2e1edbc0d770f284fea3...d3e98c4ec0ff7c307d66378eab1c4630250ec210) --- updated-dependencies: - dependency-name: openapitor dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump kittycad from 0.2.26 to 0.2.27 in /src/wasm-lib (#722) Bumps [kittycad](https://github.com/KittyCAD/kittycad.rs) from 0.2.26 to 0.2.27. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/v0.2.26...v0.2.27) --- updated-dependencies: - dependency-name: kittycad dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump thiserror from 1.0.48 to 1.0.49 in /src/wasm-lib (#721) Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.48 to 1.0.49. - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](https://github.com/dtolnay/thiserror/compare/1.0.48...1.0.49) --- updated-dependencies: - dependency-name: thiserror dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump expectorate from 1.0.7 to 1.1.0 in /src/wasm-lib (#712) Bumps [expectorate](https://github.com/oxidecomputer/expectorate) from 1.0.7 to 1.1.0. - [Release notes](https://github.com/oxidecomputer/expectorate/releases) - [Commits](https://github.com/oxidecomputer/expectorate/compare/v1.0.7...v1.1.0) --- updated-dependencies: - dependency-name: expectorate dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump clap from 4.4.4 to 4.4.5 in /src/wasm-lib (#711) Bumps [clap](https://github.com/clap-rs/clap) from 4.4.4 to 4.4.5. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.4.4...v4.4.5) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> refactor cleanup Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> type improvements * use new sketchmode no camera Signed-off-by: Jess Frazelle <github@jessfraz.com> * js working better Signed-off-by: Jess Frazelle <github@jessfraz.com> * start of negative planes Signed-off-by: Jess Frazelle <github@jessfraz.com> * tests and neg Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * images Signed-off-by: Jess Frazelle <github@jessfraz.com> * norma;s Signed-off-by: Jess Frazelle <github@jessfraz.com> * better initial load of planes Signed-off-by: Jess Frazelle <github@jessfraz.com> * ts Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix tsc Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix edit sketch Signed-off-by: Jess Frazelle <github@jessfraz.com> * add regression test for 2d solid issue Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * show planes Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix clippy Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> * canecel in progress Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix ci as well Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> * stopping point Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * refactor Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * it works Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * Hide planes (#797) * hide planes in one go Signed-off-by: Jess Frazelle <github@jessfraz.com> * update hide; Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> * make tsc happy * Make "Replay Onboarding" button available on home settings page (#804) * Fix unrelated bug, settings button in the home sidebar doesn't go to the home settings after my previous fixes to routes * Turn on "Replay Onboarding" button in home settings * Use ONBOARDING_PROJECT_NAME in both places * Fix formatting * Cut release v0.10.0 (#803) Co-authored-by: Frank Noirot <frank@kittycad.io> * Bump kittycad from 0.2.28 to 0.2.31 in /src-tauri (#798) Bumps [kittycad](https://github.com/KittyCAD/kittycad.rs) from 0.2.28 to 0.2.31. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/v0.2.28...v0.2.31) --- updated-dependencies: - dependency-name: kittycad dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump openapitor from `fa0345c` to `c122a9b` in /src/wasm-lib (#800) Bumps [openapitor](https://github.com/KittyCAD/kittycad.rs) from `fa0345c` to `c122a9b`. - [Release notes](https://github.com/KittyCAD/kittycad.rs/releases) - [Commits](https://github.com/KittyCAD/kittycad.rs/compare/fa0345c514fcc9ae6cd74ae35c8e5c2800fec34f...c122a9b1d6afe51c25e545b5e0bbeb91d367e6d2) --- updated-dependencies: - dependency-name: openapitor dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump syn from 2.0.37 to 2.0.38 in /src/wasm-lib (#801) Bumps [syn](https://github.com/dtolnay/syn) from 2.0.37 to 2.0.38. - [Release notes](https://github.com/dtolnay/syn/releases) - [Commits](https://github.com/dtolnay/syn/compare/2.0.37...2.0.38) --- updated-dependencies: - dependency-name: syn dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump winnow from 0.5.15 to 0.5.16 in /src/wasm-lib (#799) Bumps [winnow](https://github.com/winnow-rs/winnow) from 0.5.15 to 0.5.16. - [Changelog](https://github.com/winnow-rs/winnow/blob/main/CHANGELOG.md) - [Commits](https://github.com/winnow-rs/winnow/compare/v0.5.15...v0.5.16) --- updated-dependencies: - dependency-name: winnow dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump tauri-plugin-fs-extra from `fa32d1a` to `9f27e6e` in /src-tauri (#802) Bumps [tauri-plugin-fs-extra](https://github.com/tauri-apps/plugins-workspace) from `fa32d1a` to `9f27e6e`. - [Release notes](https://github.com/tauri-apps/plugins-workspace/releases) - [Commits](https://github.com/tauri-apps/plugins-workspace/compare/fa32d1afa97f52f74d814c5619b8d95da3268e3e...9f27e6e4415ddf6c40f846d50c0d95c768cded77) --- updated-dependencies: - dependency-name: tauri-plugin-fs-extra dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * better plane selection Signed-off-by: Jess Frazelle <github@jessfraz.com> * use the sketch plane id Signed-off-by: Jess Frazelle <github@jessfraz.com> * add todo w bug Signed-off-by: Jess Frazelle <github@jessfraz.com> * Improve Prop Typings for Modals. Remove instances of `any`. (#792) * Update typings for modals. Remove instances of `any` * Fix generic type for creating modals * cleanup other stuffs Signed-off-by: Jess Frazelle <github@jessfraz.com> * make plane id available when selecting default plane * few clean up things * change enter sketch action order to make sure plane id is available to 'enter edit mode' * Revert "Improve Prop Typings for Modals. Remove instances of `any`. (… (#813) Revert "Improve Prop Typings for Modals. Remove instances of `any`. (#792)" This reverts commit 629f326f4cdf13d83a62f471b4b9a40d3c3a2a88. * ffmpeg instructions (#814) * fix some tsc stuff * small tweak --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jason Rametta <rametta@outlook.com> * clean up * fix test and tsc * remove one more thing from useStore * tweak state digrame layout * fmt --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Frank Johnson <frankjohnson1993@gmail.com> Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jason Rametta <rametta@outlook.com>
2023-10-11 13:36:54 +11:00
},
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
// end actions
actors: {
'do-constrain-remove-constraint': fromPromise(
async ({
input: { selectionRanges, sketchDetails, data },
}: {
input: Pick<
ModelingMachineContext,
'selectionRanges' | 'sketchDetails'
> & { data?: PathToNode }
}) => {
const constraint = applyRemoveConstrainingValues({
selectionRanges,
pathToNodes: data && [data],
})
if (trap(constraint)) return
const { pathToNodeMap } = constraint
if (!sketchDetails) return
let updatedAst = await sceneEntitiesManager.updateAstAndRejigSketch(
pathToNodeMap[0],
constraint.modifiedAst,
sketchDetails.zAxis,
sketchDetails.yAxis,
sketchDetails.origin
)
if (trap(updatedAst, { suppress: true })) return
if (!updatedAst) return
return {
selectionType: 'completeSelection',
selection: updateSelections(
pathToNodeMap,
selectionRanges,
updatedAst.newAst
),
}
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
}
),
'do-constrain-horizontally': fromPromise(
async ({
input: { selectionRanges, sketchDetails },
}: {
input: Pick<ModelingMachineContext, 'selectionRanges' | 'sketchDetails'>
}) => {
const constraint = applyConstraintHorzVert(
selectionRanges,
'horizontal',
kclManager.ast,
kclManager.programMemory
)
if (trap(constraint)) return false
const { modifiedAst, pathToNodeMap } = constraint
if (!sketchDetails) return
const updatedAst = await sceneEntitiesManager.updateAstAndRejigSketch(
sketchDetails.sketchPathToNode,
modifiedAst,
sketchDetails.zAxis,
sketchDetails.yAxis,
sketchDetails.origin
)
if (trap(updatedAst, { suppress: true })) return
if (!updatedAst) return
return {
selectionType: 'completeSelection',
selection: updateSelections(
pathToNodeMap,
selectionRanges,
updatedAst.newAst
),
}
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
}
),
'do-constrain-vertically': fromPromise(
async ({
input: { selectionRanges, sketchDetails },
}: {
input: Pick<ModelingMachineContext, 'selectionRanges' | 'sketchDetails'>
}) => {
const constraint = applyConstraintHorzVert(
selectionRanges,
'vertical',
kclManager.ast,
kclManager.programMemory
)
if (trap(constraint)) return false
const { modifiedAst, pathToNodeMap } = constraint
if (!sketchDetails) return
const updatedAst = await sceneEntitiesManager.updateAstAndRejigSketch(
sketchDetails.sketchPathToNode || [],
modifiedAst,
sketchDetails.zAxis,
sketchDetails.yAxis,
sketchDetails.origin
)
if (trap(updatedAst, { suppress: true })) return
if (!updatedAst) return
return {
selectionType: 'completeSelection',
selection: updateSelections(
pathToNodeMap,
selectionRanges,
updatedAst.newAst
),
}
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
}
),
'do-constrain-horizontally-align': fromPromise(
async ({
input: { selectionRanges, sketchDetails },
}: {
input: Pick<ModelingMachineContext, 'selectionRanges' | 'sketchDetails'>
}) => {
const constraint = applyConstraintHorzVertAlign({
selectionRanges,
constraint: 'setVertDistance',
})
if (trap(constraint)) return
const { modifiedAst, pathToNodeMap } = constraint
if (!sketchDetails) return
const updatedAst = await sceneEntitiesManager.updateAstAndRejigSketch(
sketchDetails?.sketchPathToNode || [],
modifiedAst,
sketchDetails.zAxis,
sketchDetails.yAxis,
sketchDetails.origin
)
if (trap(updatedAst, { suppress: true })) return
if (!updatedAst) return
const updatedSelectionRanges = updateSelections(
pathToNodeMap,
selectionRanges,
updatedAst.newAst
)
return {
selectionType: 'completeSelection',
selection: updatedSelectionRanges,
}
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
}
),
'do-constrain-vertically-align': fromPromise(
async ({
input: { selectionRanges, sketchDetails },
}: {
input: Pick<ModelingMachineContext, 'selectionRanges' | 'sketchDetails'>
}) => {
const constraint = applyConstraintHorzVertAlign({
selectionRanges,
constraint: 'setHorzDistance',
})
if (trap(constraint)) return
const { modifiedAst, pathToNodeMap } = constraint
if (!sketchDetails) return
const updatedAst = await sceneEntitiesManager.updateAstAndRejigSketch(
sketchDetails?.sketchPathToNode || [],
modifiedAst,
sketchDetails.zAxis,
sketchDetails.yAxis,
sketchDetails.origin
)
if (trap(updatedAst, { suppress: true })) return
if (!updatedAst) return
const updatedSelectionRanges = updateSelections(
pathToNodeMap,
selectionRanges,
updatedAst.newAst
)
return {
selectionType: 'completeSelection',
selection: updatedSelectionRanges,
}
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
}
),
'do-constrain-snap-to-x': fromPromise(
async ({
input: { selectionRanges, sketchDetails },
}: {
input: Pick<ModelingMachineContext, 'selectionRanges' | 'sketchDetails'>
}) => {
const constraint = applyConstraintAxisAlign({
selectionRanges,
constraint: 'snapToXAxis',
})
if (err(constraint)) return false
const { modifiedAst, pathToNodeMap } = constraint
if (!sketchDetails) return
const updatedAst = await sceneEntitiesManager.updateAstAndRejigSketch(
sketchDetails?.sketchPathToNode || [],
modifiedAst,
sketchDetails.zAxis,
sketchDetails.yAxis,
sketchDetails.origin
)
if (trap(updatedAst, { suppress: true })) return
if (!updatedAst) return
const updatedSelectionRanges = updateSelections(
pathToNodeMap,
selectionRanges,
updatedAst.newAst
)
return {
selectionType: 'completeSelection',
selection: updatedSelectionRanges,
}
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
}
),
'do-constrain-snap-to-y': fromPromise(
async ({
input: { selectionRanges, sketchDetails },
}: {
input: Pick<ModelingMachineContext, 'selectionRanges' | 'sketchDetails'>
}) => {
const constraint = applyConstraintAxisAlign({
selectionRanges,
constraint: 'snapToYAxis',
})
if (trap(constraint)) return false
const { modifiedAst, pathToNodeMap } = constraint
if (!sketchDetails) return
const updatedAst = await sceneEntitiesManager.updateAstAndRejigSketch(
sketchDetails?.sketchPathToNode || [],
modifiedAst,
sketchDetails.zAxis,
sketchDetails.yAxis,
sketchDetails.origin
)
if (trap(updatedAst, { suppress: true })) return
if (!updatedAst) return
const updatedSelectionRanges = updateSelections(
pathToNodeMap,
selectionRanges,
updatedAst.newAst
)
return {
selectionType: 'completeSelection',
selection: updatedSelectionRanges,
}
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
}
),
'do-constrain-parallel': fromPromise(
async ({
input: { selectionRanges, sketchDetails },
}: {
input: Pick<ModelingMachineContext, 'selectionRanges' | 'sketchDetails'>
}) => {
const constraint = applyConstraintEqualAngle({
selectionRanges,
})
if (trap(constraint)) return false
const { modifiedAst, pathToNodeMap } = constraint
if (!sketchDetails) {
trap(new Error('No sketch details'))
return
}
const updatedAst = await sceneEntitiesManager.updateAstAndRejigSketch(
sketchDetails?.sketchPathToNode || [],
parse(recast(modifiedAst)),
sketchDetails.zAxis,
sketchDetails.yAxis,
sketchDetails.origin
)
if (trap(updatedAst, { suppress: true })) return
if (!updatedAst) return
const updatedSelectionRanges = updateSelections(
pathToNodeMap,
selectionRanges,
updatedAst.newAst
)
return {
selectionType: 'completeSelection',
selection: updatedSelectionRanges,
}
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
}
),
'do-constrain-equal-length': fromPromise(
async ({
input: { selectionRanges, sketchDetails },
}: {
input: Pick<ModelingMachineContext, 'selectionRanges' | 'sketchDetails'>
}) => {
const constraint = applyConstraintEqualLength({
selectionRanges,
})
if (trap(constraint)) return false
const { modifiedAst, pathToNodeMap } = constraint
if (!sketchDetails) return
const updatedAst = await sceneEntitiesManager.updateAstAndRejigSketch(
sketchDetails?.sketchPathToNode || [],
modifiedAst,
sketchDetails.zAxis,
sketchDetails.yAxis,
sketchDetails.origin
)
if (trap(updatedAst, { suppress: true })) return
if (!updatedAst) return
const updatedSelectionRanges = updateSelections(
pathToNodeMap,
selectionRanges,
updatedAst.newAst
)
return {
selectionType: 'completeSelection',
selection: updatedSelectionRanges,
}
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
}
),
'Get vertical info': fromPromise(
async (_: {
input: Pick<ModelingMachineContext, 'selectionRanges' | 'sketchDetails'>
}) => {
return {} as SetSelections
}
),
'Get ABS X info': fromPromise(
async (_: {
input: Pick<ModelingMachineContext, 'selectionRanges' | 'sketchDetails'>
}) => {
return {} as SetSelections
}
),
'Get ABS Y info': fromPromise(
async (_: {
input: Pick<ModelingMachineContext, 'selectionRanges' | 'sketchDetails'>
}) => {
return {} as SetSelections
}
),
'Get angle info': fromPromise(
async (_: {
input: Pick<ModelingMachineContext, 'selectionRanges' | 'sketchDetails'>
}) => {
return {} as SetSelections
}
),
'Get perpendicular distance info': fromPromise(
async (_: {
input: Pick<ModelingMachineContext, 'selectionRanges' | 'sketchDetails'>
}) => {
return {} as SetSelections
}
),
'AST-undo-startSketchOn': fromPromise(
async (_: { input: Pick<ModelingMachineContext, 'sketchDetails'> }) => {
return undefined
}
),
'animate-to-face': fromPromise(
async (_: { input?: ExtrudeFacePlane | DefaultPlane }) => {
return {} as
| undefined
| {
sketchPathToNode: PathToNode
zAxis: [number, number, number]
yAxis: [number, number, number]
origin: [number, number, number]
}
}
),
'animate-to-sketch': fromPromise(
async (_: { input: Pick<ModelingMachineContext, 'selectionRanges'> }) => {
return {} as {
sketchPathToNode: PathToNode
zAxis: [number, number, number]
yAxis: [number, number, number]
origin: [number, number, number]
}
}
),
'Get horizontal info': fromPromise(
async (_: {
input: Pick<ModelingMachineContext, 'sketchDetails' | 'selectionRanges'>
}) => {
return {} as SetSelections
}
),
'Get length info': fromPromise(
async (_: {
input: Pick<ModelingMachineContext, 'sketchDetails' | 'selectionRanges'>
}) => {
return {} as SetSelections
}
),
'Get convert to variable info': fromPromise(
async (_: {
input: Pick<
ModelingMachineContext,
'sketchDetails' | 'selectionRanges'
> & {
data?: {
variableName: string
pathToNode: PathToNode
}
}
}) => {
return {} as SetSelections
}
),
},
// end services
}).createMachine({
/** @xstate-layout N4IgpgJg5mDOIC5QFkD2EwBsCWA7KAxAMICGuAxlgNoAMAuoqAA6qzYAu2qujIAHogC0ANhoBWAHQAOAMwB2KQEY5AFgCcGqWqkAaEAE9Ew0RLEqa64TIBMKmTUXCAvk71oMOfAQDKYdgAJYLDByTm5aBiQQFjYwniiBBEEpYSkJOUUaOWsxeylrWzk9QwQClQkrVOsZNWExFItnVxB3LDxCXwCAW1QAVyDA9hJ2MAjeGI4ueNBE5KkaCWspZfMM+XE1YsQZMQWxNQtxao0ZeRc3dDavTv9ybhG+djGoibjeRJothBpzlsvPDp+fy+KBdMC4AIAeQAbmAAE6YEj6WDPZisSbcd6IT4GbG-VoAiTYCCYMAEACiEPhgQA1n5yAALVHRdFvBJCJYLHZKawHczVBxfeySRTmOpqMRyNSZapNC4edpEklkykjOG0+lMxSRNGxKZYpK2BbmWrqcQ0URiJZCkxyGgyYTKfZSK28sT4-6K4mkimPOG9DDM1769lJSUyCQSlTKGQqXKKF3CL6KaoRjKpORieM1RQehX4JU+gBi2EwpKe9HGrJDMyEWYjdhdYkcdsl1iKuIQiljwgkMakchsMmUDjzVyghZVfBYcIrOpZesxocEYjq6XbohoKVFUsUyZUjokNUzSmE1gT57HhO9ZOQJDpQerS9rCBU1gqWjfakH0ay+y+wgKOk3IqComZmLGUhXl6yoEAAIsEIyBMEoRTI+i7TPwQiOuU2hmCOCbRooYjJpK5Q1GevKKI41FStBBY3gQAAqYCPII7CoIIRAAIJwehGKYbMzbvmYKRZhK4YHsmqi9lY2Q5No1jCNGcj0RON4SAyxJgAACoiuBwAQ3GztgABmJChP4UBwiQTAMv4LBML0iIjBA-Fsi+ggHmoEjiDG35aIFDpfN+EYOKJA7dtRUgqGpk4SLADKoAA7npZCGcZnDmZZ1m2fZYBdEwnCQO5NZYUkYFyOkLqZkpgExWBJGdtRBR9lo1H2BaObWHF3h0uwjLEGQlCYH1mqlc+5Upqcix2G+dSOkptjJooBy+cpVhZnIUr2r1-WDQh5ZgMhoLgnOVYYQa22SGobpLOodrLDIXxxlVGjmPWuzKRae2agQdwYP4kAcP4EC9HC7QagNTKVi8T6CYg3a3aYYEBVoylmB2JRqDUvmrsstRZNRaixc0BKKmN0MSJTjIAJKwXedInWCEL+LCJnkCQmATQjXanGkw7LEpjgqOj+6tbY9TqPMQuyL9VM0wy9M+ozx1BKdrNJRDABe9xczzBrdue6SgfUOw45UKjJjYxrSla+xEzQo5k56BaK9T+1K7BRDcLA7A2Xg-ha9gusQlzoPYH7w2jLDuoCYb9iKH2ChLLIxEKLonZGpITtG2BOzp3Kfz5hO7uK8rZI+7gfsB7gbPwpwnOYBHUcUDH87BpNiRRb2W5PQ454SrGXwFPkEhgU7NAHLkw7y4yHuahXxC+-7JCB9xABC3j+AAGgbobdjYpg-jj0bno6TUlLyViRjQSkWPY1gOFBLslwvCue0vVc12vdeb9vABNfeL5D7vnkEoE0tR7ZW07PYb8FQ1gnhihnIu5M3ae3fnTb2K9a7+DIFAUkwCpo1D2KteYrY+T5BHs2XsT9QJ33tPdUCc8GSYK9j6b+q9A6knwOwGGHd4YJxiqYcKA5HSCzsCPM8VUMhWjfAUPuxEWFsK-jg3+Dl4RMHBBAbA5BnIkHVDo1ulAiHd3bJITavI+7tl5JnK++QIzGDbE-J26geqv3HGwlR2Dq5cLrsHUOQwyz6DwTgKAuBTGIzgZGEmB4ZD5GkVmUiORZothcQ6LcMhlHlx8T-QO7NG5c0wCErm2BwmRL5kpUwqQaoaGyMpZ6zUrDlFyKuAoEoDhDmyZ-XJfjAi4Fsv4Diu8KndhMDUAKqh9iZCoVnPyydRQHGWKtZQ3TF69NwbAAZTAhmoH8EA2OC544HwyYsFM19zxSkHI0q+xFezqDjLsVaOwp5rOhqo3xuCwAAEdejhx4VAPhozYwLDqH+JQ252nSVxvIRadgbA4TeVgjhajA5MAMUU6ghzO6827KoPsZ59iAUyKKbsyYJS9izFLBwyluyk3lJ4suPSUWfPUXCAqqBYS3FRRCFE2LBEHzdCbGKsY5BgvMcmWQPlajtlAnaaUw5cweMJEy9ZPoABKYBBCsRCL0EYozHRpG0NGcUhNvzJnNOPWQoEKXCBOO4hlKqME5J9ADY6wMAhgwhvgKGjJgXI0dNKZQA4H6rQtfaXyYrNqrhxlmJVjqKbOuZZXbgBTdlswMdgEgAAjQh-LLonI0NILICSSarSsNYIU58jyrhwk-fY9Li6MqTWqskjJ8HHQ4qgbm+bjkvhyHfaQVjboO1CpW5qxF3xZE3O02QVgX4JvQZqCQ3FkprwCAEvWzcjFDDbv4PAplUAEAgNwMARJcDQlQHSCQMB2CCE3WHTAggD2oAqdUZspgHFCyfjFOoI83xpClCkMCptE6NrQaXDBq711B1QDrLdLdd2UH3bgQ9BB4RwjgxIJgLlD1wi6Devw964Mhy3c+1Dr7e0eXKu+98A74mKQvpsLOJDIzAdsGeZY4hVLKsTcu6DIMCm6PDju6OKG0MnoMuey917b2CCE03cjh633m0WIODOMV5hnhHryd8+RMhipNJc5RAmAgKZE5HJDx0X3obhJhuE2HcNwYI3J8zT6X0qf2JGFSsLVzypgVfHISdqKijqg004Jm10g3-rvcTR7JNnrwDJs9cmc2wEEHwJTlGBEFv7Q6CMWggNZFjDake34k5bjPKsSr2RIswZizvOLtn7OOeGHhlzRG0sZayyp5S1TtBniJipMrKT7BysHOQnGPHF2Qf41FgIMWAFNYS9Jq9KXOvZvS-oHrVGyqJFlA2aUP5fy2HkEKad49xui1HQOOr0Wt77KaxhrDOG2vOcI3err22PO7a7ogWU5RHAOnTmBc8W4hQxl8sRUWdRZUtjuwEfBpJluntW7Jzr+BSQ7Zy32mjDpyh2AyHi8wsyr6rkkGImwEEVm2AR3gzH1mKPNZe05-DH3BBI61T9nH1H9sOgp+YTIxgHBir3FnK0vd9g1DjEpSUoo6cAr4SjqTSW1vs8VwybHF1cd87PNU2Q9SsxZHHVfO15QnbShNfITM02m1OrmzBjXT27Ms7e2zuTGutdw1y3jm+B2HTKVPqKKRH7RBp3kM2fIu1eNLqpqZjRcItG4B0XoxEhjLNiZsyt1X6O71aMT9o3R+i4SCFE23L3cdef-eHAsKedh7SZB2M2LG-3rVHmUFYgcW06f56Tyn4viHM9M+ew5177B2vs974X1PBjS8Z-L9z7XVfSg198iTewNem-KBHgoXsw5shLPArbiDXiAAyeBO2oG7f9BkHbdndrfaISlcYBwZBSDYEKSxTCy6nsL9szsZsz8L979MAJBaZcAOACA30lgIxvwbU6hMwUxZAAI1pCIxVThuwDcHU7c+MqZz8DIQCwCID2AoDtQl89t-sqJIwMh7plJCclIvgpRexvw7Ugdzx4kFBlF8DL9u0JAAA5PZHSVAPAdgWAIyCACAQYAxAIFgEQx-NaR+GoIcbQCUACbIceC+SUbaBSOiGPWbPA4ArtUAgQ-wIQkQsQ0gNuHtHnCgrsdGAlOdbjNsOxRADIY0N8EXeoLQLcZRcAyA0ZLqCoc+KPBoXfZMWwd8aMWMXYU4KwV5PQrxPwkgqgMg73HXRGKeHyO+GpRVJYO0JMZqTqYCWiQ4HIeJd0BI92JiDtCELNZuAxcgXZG-O-IwipdYPfOMcQO1J+MVLIRg+oCoCedArIJZCowA92XoZPPZKOWcRWSEXAY9VHHPM9bibwJiQQSYk9QQGY9gOYiJX7XFYHT9bQ0UeofYEmfo4LDGa7BQVGcDV2fQ+eTVUITnEA5o-AHg6w8gv7BAGvBYaHfIVQFMXfFvLsO+HyQ1QE3YJsVBB4rxZ43dAhT4ldebSGIIO4ZPblOEAyOEAgEsCAxKfwdlF4hnNo+RCoeMRoPyZsALRAAcMBWwEmYWTIEDZRBE14owlE9dSGEjKAPAcQyQ4kxE5HXkvAMkh
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
id: 'Modeling',
context: ({ input }) => ({
...modelingMachineDefaultContext,
...input,
}),
states: {
idle: {
on: {
'Enter sketch': [
{
target: 'animating to existing sketch',
guard: 'Selection is on face',
},
'Sketch no face',
],
Extrude: {
target: 'idle',
guard: 'has valid extrude selection',
actions: ['AST extrude'],
reenter: false,
},
Revolve: {
target: 'idle',
guard: 'has valid revolve selection',
actions: ['AST revolve'],
reenter: false,
},
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
Fillet: {
target: 'idle',
guard: 'has valid fillet selection', // TODO: fix selections
actions: ['AST fillet'],
reenter: false,
},
Export: {
target: 'idle',
reenter: false,
guard: 'Has exportable geometry',
actions: 'Engine export',
},
Make: {
target: 'idle',
reenter: false,
guard: 'Has exportable geometry',
actions: 'Make',
},
'Delete selection': {
target: 'idle',
guard: 'has valid selection for deletion',
actions: ['AST delete selection'],
reenter: false,
},
'Text-to-CAD': {
target: 'idle',
reenter: false,
actions: ['Submit to Text-to-CAD API'],
},
},
entry: 'reset client scene mouse handlers',
states: {
hidePlanes: {
on: {
'Artifact graph populated': 'showPlanes',
},
entry: 'hide default planes',
},
showPlanes: {
on: {
'Artifact graph emptied': 'hidePlanes',
},
entry: [
'show default planes',
'reset camera position',
'set selection filter to curves only',
],
description: `We want to disable selections and hover highlights here, because users can't do anything with that information until they actually add something to the scene. The planes are just for orientation here.`,
exit: 'set selection filter to defaults',
Migrate to XState v5 (#3735) * migrate settingsMachine * Guard events with properties instead * migrate settingsMachine * Migrate auth machine * Migrate file machine * Migrate depracated types * Migrate home machine * Migrate command bar machine * Version fixes * Migrate command bar machine * Migrate modeling machine * Migrate types, state.can, state.matches and state.nextEvents * Fix syntax * Pass in modelingState into editor manager instead of modeling event * Fix issue with missing command bar provider * Fix state transition * Fix type issue in Home * Make sure no guards rely on event type * Fix up command bar submission logic * Home machine tweaks to get things running * Fix AST fillet function args * Handle "Set selection" when it is called by actor onDone * Remove unused imports * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Fix injectin project to the fileTree machine * Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)" This reverts commit 4b43ff69d1572c10992ed4c29678acbb9abf96d7. * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * Re-run CI * Restore success toasts on file/folder deletion * Replace casting with guarding against event.type * Remove console.log Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Replace all instances of event casting with guards against event.type --------- Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2024-09-09 19:59:36 +03:00
},
},
initial: 'hidePlanes',
},
Sketch: {
states: {
SketchIdle: {
on: {
'Make segment vertical': {
guard: 'Can make selection vertical',
target: 'Await constrain vertically',
},
'Make segment horizontal': {
guard: 'Can make selection horizontal',
target: 'Await constrain horizontally',
},
'Constrain horizontal distance': {
target: 'Await horizontal distance info',
guard: 'Can constrain horizontal distance',
},
'Constrain vertical distance': {
target: 'Await vertical distance info',
guard: 'Can constrain vertical distance',
},
'Constrain ABS X': {
target: 'Await ABS X info',
guard: 'Can constrain ABS X',
},
'Constrain ABS Y': {
target: 'Await ABS Y info',
guard: 'Can constrain ABS Y',
},
'Constrain angle': {
target: 'Await angle info',
guard: 'Can constrain angle',
},
'Constrain length': {
target: 'Await length info',
guard: 'Can constrain length',
},
'Constrain perpendicular distance': {
target: 'Await perpendicular distance info',
guard: 'Can constrain perpendicular distance',
},
'Constrain horizontally align': {
guard: 'Can constrain horizontally align',
target: 'Await constrain horizontally align',
},
'Constrain vertically align': {
guard: 'Can constrain vertically align',
target: 'Await constrain vertically align',
},
'Constrain snap to X': {
guard: 'Can constrain snap to X',
target: 'Await constrain snap to X',
},
'Constrain snap to Y': {
guard: 'Can constrain snap to Y',
target: 'Await constrain snap to Y',
},
'Constrain equal length': {
guard: 'Can constrain equal length',
target: 'Await constrain equal length',
},
'Constrain parallel': {
target: 'Await constrain parallel',
guard: 'Can canstrain parallel',
},
'Constrain remove constraints': {
guard: 'Can constrain remove constraints',
target: 'Await constrain remove constraints',
},
'Re-execute': {
target: 'SketchIdle',
reenter: false,
actions: ['set sketchMetadata from pathToNode'],
},
'code edit during sketch': 'clean slate',
'Convert to variable': {
target: 'Await convert to variable',
guard: 'Can convert to variable',
},
'change tool': {
target: 'Change Tool',
},
},
entry: 'setup client side sketch segments',
},
'Await horizontal distance info': {
invoke: {
src: 'Get horizontal info',
id: 'get-horizontal-info',
input: ({ context: { selectionRanges, sketchDetails } }) => ({
selectionRanges,
sketchDetails,
}),
onDone: {
target: 'SketchIdle',
actions: 'Set selection',
},
onError: 'SketchIdle',
},
},
'Await vertical distance info': {
invoke: {
src: 'Get vertical info',
id: 'get-vertical-info',
input: ({ context: { selectionRanges, sketchDetails } }) => ({
selectionRanges,
sketchDetails,
}),
onDone: {
target: 'SketchIdle',
actions: 'Set selection',
},
onError: 'SketchIdle',
},
},
'Await ABS X info': {
invoke: {
src: 'Get ABS X info',
id: 'get-abs-x-info',
input: ({ context: { selectionRanges, sketchDetails } }) => ({
selectionRanges,
sketchDetails,
}),
onDone: {
target: 'SketchIdle',
actions: 'Set selection',
},
onError: 'SketchIdle',
},
},
'Await ABS Y info': {
invoke: {
src: 'Get ABS Y info',
id: 'get-abs-y-info',
input: ({ context: { selectionRanges, sketchDetails } }) => ({
selectionRanges,
sketchDetails,
}),
onDone: {
target: 'SketchIdle',
actions: 'Set selection',
},
onError: 'SketchIdle',
},
},
'Await angle info': {
invoke: {
src: 'Get angle info',
id: 'get-angle-info',
input: ({ context: { selectionRanges, sketchDetails } }) => ({
selectionRanges,
sketchDetails,
}),
onDone: {
target: 'SketchIdle',
actions: 'Set selection',
},
onError: 'SketchIdle',
},
},
'Await length info': {
invoke: {
src: 'Get length info',
id: 'get-length-info',
input: ({ context: { selectionRanges, sketchDetails } }) => ({
selectionRanges,
sketchDetails,
}),
onDone: {
target: 'SketchIdle',
actions: 'Set selection',
},
onError: 'SketchIdle',
},
},
'Await perpendicular distance info': {
invoke: {
src: 'Get perpendicular distance info',
id: 'get-perpendicular-distance-info',
input: ({ context: { selectionRanges, sketchDetails } }) => ({
selectionRanges,
sketchDetails,
}),
onDone: {
target: 'SketchIdle',
actions: 'Set selection',
},
onError: 'SketchIdle',
},
},
'Line tool': {
exit: [],
states: {
Init: {
always: [
{
target: 'normal',
guard: 'has made first point',
actions: 'set up draft line',
},
'No Points',
],
},
normal: {},
'No Points': {
entry: 'setup noPoints onClick listener',
on: {
'Add start point': {
target: 'normal',
actions: 'set up draft line without teardown',
},
Cancel: '#Modeling.Sketch.undo startSketchOn',
},
},
},
initial: 'Init',
on: {
'change tool': {
target: 'Change Tool',
},
},
},
Init: {
always: [
{
target: 'SketchIdle',
guard: 'is editing existing sketch',
},
'Line tool',
],
},
'Tangential arc to': {
entry: 'set up draft arc',
on: {
'change tool': {
target: 'Change Tool',
},
},
},
'undo startSketchOn': {
invoke: {
src: 'AST-undo-startSketchOn',
id: 'AST-undo-startSketchOn',
input: ({ context: { sketchDetails } }) => ({ sketchDetails }),
onDone: {
target: '#Modeling.idle',
actions: 'enter modeling mode',
},
},
},
'Rectangle tool': {
entry: ['listen for rectangle origin'],
states: {
'Awaiting second corner': {
on: {
'Finish rectangle': 'Finished Rectangle',
},
},
'Awaiting origin': {
on: {
'Add rectangle origin': {
target: 'Awaiting second corner',
actions: 'set up draft rectangle',
},
},
},
'Finished Rectangle': {
always: '#Modeling.Sketch.SketchIdle',
},
},
initial: 'Awaiting origin',
on: {
'change tool': {
target: 'Change Tool',
},
},
},
'clean slate': {
always: 'SketchIdle',
},
'Await convert to variable': {
invoke: {
src: 'Get convert to variable info',
id: 'get-convert-to-variable-info',
input: ({ context: { selectionRanges, sketchDetails }, event }) => {
if (event.type !== 'Convert to variable') {
return {
selectionRanges,
sketchDetails,
data: undefined,
}
}
return {
selectionRanges,
sketchDetails,
data: event.data,
}
},
onError: 'SketchIdle',
onDone: {
target: 'SketchIdle',
actions: ['Set selection'],
},
},
},
'Await constrain remove constraints': {
invoke: {
src: 'do-constrain-remove-constraint',
id: 'do-constrain-remove-constraint',
input: ({ context: { selectionRanges, sketchDetails }, event }) => {
return {
selectionRanges,
sketchDetails,
data:
event.type === 'Constrain remove constraints'
? event.data
: undefined,
}
},
onDone: {
target: 'SketchIdle',
actions: 'Set selection',
},
},
},
'Await constrain horizontally': {
invoke: {
src: 'do-constrain-horizontally',
id: 'do-constrain-horizontally',
input: ({ context: { selectionRanges, sketchDetails } }) => ({
selectionRanges,
sketchDetails,
}),
onDone: {
target: 'SketchIdle',
actions: 'Set selection',
},
},
},
'Await constrain vertically': {
invoke: {
src: 'do-constrain-vertically',
id: 'do-constrain-vertically',
input: ({ context: { selectionRanges, sketchDetails } }) => ({
selectionRanges,
sketchDetails,
}),
onDone: {
target: 'SketchIdle',
actions: 'Set selection',
},
},
},
'Await constrain horizontally align': {
invoke: {
src: 'do-constrain-horizontally-align',
id: 'do-constrain-horizontally-align',
input: ({ context }) => ({
selectionRanges: context.selectionRanges,
sketchDetails: context.sketchDetails,
}),
onDone: {
target: 'SketchIdle',
actions: 'Set selection',
},
},
},
'Await constrain vertically align': {
invoke: {
src: 'do-constrain-vertically-align',
id: 'do-constrain-vertically-align',
input: ({ context }) => ({
selectionRanges: context.selectionRanges,
sketchDetails: context.sketchDetails,
}),
onDone: {
target: 'SketchIdle',
actions: 'Set selection',
},
},
},
'Await constrain snap to X': {
invoke: {
src: 'do-constrain-snap-to-x',
id: 'do-constrain-snap-to-x',
input: ({ context }) => ({
selectionRanges: context.selectionRanges,
sketchDetails: context.sketchDetails,
}),
onDone: {
target: 'SketchIdle',
actions: 'Set selection',
},
},
},
'Await constrain snap to Y': {
invoke: {
src: 'do-constrain-snap-to-y',
id: 'do-constrain-snap-to-y',
input: ({ context }) => ({
selectionRanges: context.selectionRanges,
sketchDetails: context.sketchDetails,
}),
onDone: {
target: 'SketchIdle',
actions: 'Set selection',
},
},
},
'Await constrain equal length': {
invoke: {
src: 'do-constrain-equal-length',
id: 'do-constrain-equal-length',
input: ({ context }) => ({
selectionRanges: context.selectionRanges,
sketchDetails: context.sketchDetails,
}),
onDone: {
target: 'SketchIdle',
actions: 'Set selection',
},
},
},
'Await constrain parallel': {
invoke: {
src: 'do-constrain-parallel',
id: 'do-constrain-parallel',
input: ({ context }) => ({
selectionRanges: context.selectionRanges,
sketchDetails: context.sketchDetails,
}),
onDone: {
target: 'SketchIdle',
actions: 'Set selection',
},
},
},
'Change Tool': {
always: [
{
target: 'SketchIdle',
guard: 'next is none',
},
{
target: 'Line tool',
guard: 'next is line',
},
{
target: 'Rectangle tool',
guard: 'next is rectangle',
},
{
target: 'Tangential arc to',
guard: 'next is tangential arc',
},
],
entry: 'assign tool in context',
},
},
initial: 'Init',
on: {
CancelSketch: '.SketchIdle',
'Delete segment': {
reenter: false,
actions: ['Delete segment', 'Set sketchDetails'],
},
'code edit during sketch': '.clean slate',
},
exit: [
'sketch exit execute',
'tear down client sketch',
'remove sketch grid',
'engineToClient cam sync direction',
'Reset Segment Overlays',
'enable copilot',
],
entry: [
'add axis n grid',
'conditionally equip line tool',
'clientToEngine cam sync direction',
],
},
'Sketch no face': {
entry: [
'disable copilot',
'show default planes',
'set selection filter to faces only',
'enter sketching mode',
],
exit: ['hide default planes', 'set selection filter to defaults'],
on: {
'Select default plane': {
target: 'animating to plane',
actions: ['reset sketch metadata'],
},
},
},
'animating to plane': {
invoke: {
src: 'animate-to-face',
id: 'animate-to-face',
input: ({ event }) => {
if (event.type !== 'Select default plane') return undefined
return event.data
},
onDone: {
target: 'Sketch',
actions: 'set new sketch metadata',
},
},
},
'animating to existing sketch': {
invoke: {
src: 'animate-to-sketch',
id: 'animate-to-sketch',
input: ({ context }) => ({
selectionRanges: context.selectionRanges,
sketchDetails: context.sketchDetails,
}),
onDone: {
target: 'Sketch',
actions: [
'disable copilot',
'set new sketch metadata',
'enter sketching mode',
],
},
},
},
},
initial: 'idle',
on: {
Cancel: {
target: '.idle',
// TODO what if we're existing extrude equipped, should these actions still be fired?
// maybe cancel needs to have a guard for if else logic?
actions: [
'reset sketch metadata',
'enable copilot',
'enter modeling mode',
],
},
'Set selection': {
reenter: false,
actions: 'Set selection',
},
'Set mouse state': {
reenter: false,
actions: 'Set mouse state',
},
'Set context': {
reenter: false,
actions: 'Set context',
},
'Set Segment Overlays': {
reenter: false,
actions: 'Set Segment Overlays',
},
},
})
export function isEditingExistingSketch({
sketchDetails,
}: {
sketchDetails: SketchDetails | null
}): boolean {
// should check that the variable declaration is a pipeExpression
// and that the pipeExpression contains a "startProfileAt" callExpression
if (!sketchDetails?.sketchPathToNode) return false
const variableDeclaration = getNodeFromPath<VariableDeclarator>(
kclManager.ast,
sketchDetails.sketchPathToNode,
'VariableDeclarator'
)
if (err(variableDeclaration)) return false
if (variableDeclaration.node.type !== 'VariableDeclarator') return false
const pipeExpression = variableDeclaration.node.init
if (pipeExpression.type !== 'PipeExpression') return false
const hasStartProfileAt = pipeExpression.body.some(
(item) =>
item.type === 'CallExpression' && item.callee.name === 'startProfileAt'
)
return hasStartProfileAt && pipeExpression.body.length > 2
}
export function canRectangleTool({
sketchDetails,
}: {
sketchDetails: SketchDetails | null
}): boolean {
const node = getNodeFromPath<VariableDeclaration>(
kclManager.ast,
sketchDetails?.sketchPathToNode || [],
'VariableDeclaration'
)
// This should not be returning false, and it should be caught
// but we need to simulate old behavior to move on.
if (err(node)) return false
return node.node?.declarations?.[0]?.init.type !== 'PipeExpression'
}