Compare commits
1 Commits
kurt-skip-
...
remove-the
Author | SHA1 | Date | |
---|---|---|---|
f46edcddf3 |
17
.github/workflows/ci.yml
vendored
@ -138,7 +138,6 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: actions/download-artifact@v3
|
- uses: actions/download-artifact@v3
|
||||||
if: github.event_name == 'schedule'
|
|
||||||
|
|
||||||
- name: Copy updated .json files
|
- name: Copy updated .json files
|
||||||
if: github.event_name == 'schedule'
|
if: github.event_name == 'schedule'
|
||||||
@ -239,8 +238,12 @@ jobs:
|
|||||||
shell: cmd
|
shell: cmd
|
||||||
|
|
||||||
- name: Build the app (debug)
|
- name: Build the app (debug)
|
||||||
|
uses: tauri-apps/tauri-action@v0
|
||||||
if: ${{ env.BUILD_RELEASE == 'false' }}
|
if: ${{ env.BUILD_RELEASE == 'false' }}
|
||||||
run: "yarn tauri build --debug ${{ env.TAURI_ARGS_MACOS }} ${{ env.TAURI_ARGS_UBUNTU }}"
|
with:
|
||||||
|
includeRelease: false
|
||||||
|
includeDebug: true
|
||||||
|
args: "${{ env.TAURI_ARGS_MACOS }} ${{ env.TAURI_ARGS_UBUNTU }}"
|
||||||
|
|
||||||
- name: Build for Mac TestFlight (nightly)
|
- name: Build for Mac TestFlight (nightly)
|
||||||
if: ${{ github.event_name == 'schedule' && matrix.os == 'macos-14' }}
|
if: ${{ github.event_name == 'schedule' && matrix.os == 'macos-14' }}
|
||||||
@ -333,6 +336,7 @@ jobs:
|
|||||||
# specific and we want to overwrite it with the this new build after and
|
# specific and we want to overwrite it with the this new build after and
|
||||||
# not upload the apple store build to the public bucket
|
# not upload the apple store build to the public bucket
|
||||||
- name: Build the app (release) and sign
|
- name: Build the app (release) and sign
|
||||||
|
uses: tauri-apps/tauri-action@v0
|
||||||
if: ${{ env.BUILD_RELEASE == 'true' }}
|
if: ${{ env.BUILD_RELEASE == 'true' }}
|
||||||
env:
|
env:
|
||||||
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
||||||
@ -344,7 +348,8 @@ jobs:
|
|||||||
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
|
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
|
||||||
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
||||||
TAURI_CONF_ARGS: "--config ${{ matrix.os == 'windows-latest' && 'src-tauri\\tauri.release.conf.json' || 'src-tauri/tauri.release.conf.json' }}"
|
TAURI_CONF_ARGS: "--config ${{ matrix.os == 'windows-latest' && 'src-tauri\\tauri.release.conf.json' || 'src-tauri/tauri.release.conf.json' }}"
|
||||||
run: "yarn tauri build ${{ env.TAURI_CONF_ARGS }} ${{ env.TAURI_ARGS_MACOS }} ${{ env.TAURI_ARGS_UBUNTU }}"
|
with:
|
||||||
|
args: "${{ env.TAURI_CONF_ARGS }} ${{ env.TAURI_ARGS_MACOS }} ${{ env.TAURI_ARGS_UBUNTU }}"
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
if: matrix.os != 'ubuntu-latest'
|
if: matrix.os != 'ubuntu-latest'
|
||||||
@ -362,7 +367,7 @@ jobs:
|
|||||||
export VITE_KC_API_BASE_URL
|
export VITE_KC_API_BASE_URL
|
||||||
xvfb-run yarn test:e2e:tauri
|
xvfb-run yarn test:e2e:tauri
|
||||||
env:
|
env:
|
||||||
E2E_APPLICATION: "./src-tauri/target/${{ env.BUILD_RELEASE == 'true' && 'release' || 'debug' }}/zoo-modeling-app"
|
E2E_APPLICATION: "./src-tauri/target/${{ env.BUILD_RELEASE == 'true' && 'release' || 'debug' }}/app"
|
||||||
KITTYCAD_API_TOKEN: ${{ env.BUILD_RELEASE == 'true' && secrets.KITTYCAD_API_TOKEN || secrets.KITTYCAD_API_TOKEN_DEV }}
|
KITTYCAD_API_TOKEN: ${{ env.BUILD_RELEASE == 'true' && secrets.KITTYCAD_API_TOKEN || secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||||
|
|
||||||
- name: Run e2e tests (windows only)
|
- name: Run e2e tests (windows only)
|
||||||
@ -371,15 +376,13 @@ jobs:
|
|||||||
cargo install tauri-driver --force
|
cargo install tauri-driver --force
|
||||||
yarn wdio run wdio.conf.ts
|
yarn wdio run wdio.conf.ts
|
||||||
env:
|
env:
|
||||||
E2E_APPLICATION: ".\\src-tauri\\target\\${{ env.BUILD_RELEASE == 'true' && 'release' || 'debug' }}\\Zoo Modeling App.exe"
|
E2E_APPLICATION: ".\\src-tauri\\target\\${{ env.BUILD_RELEASE == 'true' && 'release' || 'debug' }}\\app.exe"
|
||||||
KITTYCAD_API_TOKEN: ${{ env.BUILD_RELEASE == 'true' && secrets.KITTYCAD_API_TOKEN || secrets.KITTYCAD_API_TOKEN_DEV }}
|
KITTYCAD_API_TOKEN: ${{ env.BUILD_RELEASE == 'true' && secrets.KITTYCAD_API_TOKEN || secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||||
VITE_KC_API_BASE_URL: ${{ env.BUILD_RELEASE == 'true' && 'https://api.zoo.dev' || 'https://api.dev.zoo.dev' }}
|
VITE_KC_API_BASE_URL: ${{ env.BUILD_RELEASE == 'true' && 'https://api.zoo.dev' || 'https://api.dev.zoo.dev' }}
|
||||||
E2E_TAURI_ENABLED: true
|
E2E_TAURI_ENABLED: true
|
||||||
TS_NODE_COMPILER_OPTIONS: '{"module": "commonjs"}'
|
TS_NODE_COMPILER_OPTIONS: '{"module": "commonjs"}'
|
||||||
|
|
||||||
publish-apps-release:
|
publish-apps-release:
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name == 'release' || github.event_name == 'schedule' }}
|
if: ${{ github.event_name == 'release' || github.event_name == 'schedule' }}
|
||||||
needs: [check-format, check-types, check-typos, build-test-web, prepare-json-files, build-test-apps]
|
needs: [check-format, check-types, check-typos, build-test-web, prepare-json-files, build-test-apps]
|
||||||
|
2
.gitignore
vendored
@ -56,5 +56,3 @@ src-tauri/gen
|
|||||||
|
|
||||||
src/wasm-lib/grackle/stdlib_cube_partial.json
|
src/wasm-lib/grackle/stdlib_cube_partial.json
|
||||||
Mac_App_Distribution.provisionprofile
|
Mac_App_Distribution.provisionprofile
|
||||||
|
|
||||||
*.tsbuildinfo
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
# Ignore artifacts:
|
# Ignore artifacts:
|
||||||
build
|
build
|
||||||
dist
|
|
||||||
coverage
|
coverage
|
||||||
|
|
||||||
# Ignore Rust projects:
|
# Ignore Rust projects:
|
||||||
@ -10,6 +9,5 @@ src/wasm-lib/pkg
|
|||||||
src/wasm-lib/kcl/bindings
|
src/wasm-lib/kcl/bindings
|
||||||
e2e/playwright/export-snapshots
|
e2e/playwright/export-snapshots
|
||||||
|
|
||||||
|
|
||||||
# XState generated files
|
# XState generated files
|
||||||
src/machines/**.typegen.ts
|
src/machines/**.typegen.ts
|
||||||
|
7
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"cSpell.words": [
|
||||||
|
"geos"
|
||||||
|
],
|
||||||
|
"editor.tabSize": 2,
|
||||||
|
"editor.insertSpaces": true,
|
||||||
|
}
|
26
README.md
@ -124,20 +124,36 @@ Before you submit a contribution PR to this repo, please ensure that:
|
|||||||
|
|
||||||
## Release a new version
|
## Release a new version
|
||||||
|
|
||||||
1. Bump the versions by running `./make-realease.sh` while on a fresh pull of main
|
1. Bump the versions in the .json files by creating a `Cut release v{x}.{y}.{z}` PR, committing the changes from
|
||||||
|
|
||||||
That will create the branch with the updated json files for you.
|
```bash
|
||||||
|
VERSION=x.y.z yarn run bump-jsons
|
||||||
|
```
|
||||||
|
|
||||||
|
Alternatively you can try the experimental `make-release.sh` bash script that will create the branch with the updated json files for you.
|
||||||
run `./make-release.sh` for a patch update
|
run `./make-release.sh` for a patch update
|
||||||
run `./make-release.sh "minor"` for minor
|
run `./make-release.sh "minor"` for minor
|
||||||
run `./make-release.sh "major"` for major
|
run `./make-release.sh "major"` for major
|
||||||
|
|
||||||
After it runs you should just need to push the push the branch and open a PR (it will suggest a changelog for you too, delete any that are not user facing)
|
The PR may serve as a place to discuss the human-readable changelog and extra QA. A quick way of getting PR's merged since the last bump is to [use this PR filter](https://github.com/KittyCAD/modeling-app/pulls?q=is%3Apr+sort%3Aupdated-desc+is%3Amerged+), open up the browser console and paste in the following
|
||||||
|
|
||||||
The PR may serve as a place to discuss the human-readable changelog and extra QA.
|
```typescript
|
||||||
|
console.log(
|
||||||
|
'- ' +
|
||||||
|
Array.from(
|
||||||
|
document.querySelectorAll('[data-hovercard-type="pull_request"]')
|
||||||
|
).map((a) => `[${a.innerText}](${a.href})`).join(`
|
||||||
|
- `)
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
grab the md list and delete any that are older than the last bump
|
||||||
|
|
||||||
2. Merge the PR
|
2. Merge the PR
|
||||||
|
|
||||||
3. Profit (A new Action kicks in at https://github.com/KittyCAD/modeling-app/actions if the PR was correctly named)
|
3. Create a new release and tag pointing to the bump version commit using semantic versioning `v{x}.{y}.{z}`
|
||||||
|
|
||||||
|
4. A new Action kicks in at https://github.com/KittyCAD/modeling-app/actions, uploading artifacts to the release
|
||||||
|
|
||||||
## Fuzzing the parser
|
## Fuzzing the parser
|
||||||
|
|
||||||
|
@ -121,9 +121,6 @@ const extrusion = extrude(5, sketch001)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -285,9 +282,6 @@ const extrusion = extrude(5, sketch001)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -125,9 +125,6 @@ const extrusion = extrude(5, sketch001)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -289,9 +286,6 @@ const extrusion = extrude(5, sketch001)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -126,9 +126,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -290,9 +287,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -482,9 +476,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -646,9 +637,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -125,9 +125,6 @@ const extrusion = extrude(10, sketch001)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -289,9 +286,6 @@ const extrusion = extrude(10, sketch001)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -481,9 +475,6 @@ const extrusion = extrude(10, sketch001)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -645,9 +636,6 @@ const extrusion = extrude(10, sketch001)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -133,9 +133,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -297,9 +294,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -489,9 +483,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -653,9 +644,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -124,9 +124,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -288,9 +285,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -480,9 +474,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -644,9 +635,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -124,9 +124,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -288,9 +285,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -480,9 +474,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -644,9 +635,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -135,9 +135,6 @@ const exampleSketch = startSketchOn('XZ')
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -299,9 +296,6 @@ const exampleSketch = startSketchOn('XZ')
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -491,9 +485,6 @@ const exampleSketch = startSketchOn('XZ')
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -655,9 +646,6 @@ const exampleSketch = startSketchOn('XZ')
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -130,9 +130,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -294,9 +291,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -486,9 +480,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -650,9 +641,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -225,9 +225,6 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -535,9 +532,6 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -123,9 +123,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -413,9 +410,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -605,9 +599,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -769,9 +760,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -125,9 +125,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -289,9 +286,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -481,9 +475,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -645,9 +636,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -150,9 +150,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -314,9 +311,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
type: "sketchGroup",
|
type: "sketchGroup",
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
@ -586,9 +580,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -225,9 +225,6 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -527,9 +524,6 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -215,9 +215,6 @@ const revolution = startSketchOn(box, "revolveAxis")
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -211,9 +211,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -211,9 +211,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -213,9 +213,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -213,9 +213,6 @@ const part001 = startSketchOn('XY')
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -515,9 +512,6 @@ const part001 = startSketchOn('XY')
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -136,9 +136,6 @@ const example = extrude(1, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -300,9 +297,6 @@ const example = extrude(1, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
type: "sketchGroup",
|
type: "sketchGroup",
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
@ -485,9 +479,6 @@ const example = extrude(1, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -649,9 +640,6 @@ const example = extrude(1, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -833,9 +821,6 @@ const example = extrude(1, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -997,9 +982,6 @@ const example = extrude(1, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -116,9 +116,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -280,9 +277,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -116,9 +116,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -280,9 +277,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -129,9 +129,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -293,9 +290,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -485,9 +479,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -649,9 +640,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -116,9 +116,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -280,9 +277,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -472,9 +466,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -636,9 +627,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -134,9 +134,6 @@ const example = extrude(1, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -298,9 +295,6 @@ const example = extrude(1, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
type: "sketchGroup",
|
type: "sketchGroup",
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
|
@ -217,9 +217,6 @@ const example = extrude(-5, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -127,9 +127,6 @@ const example = extrude(1, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -291,9 +288,6 @@ const example = extrude(1, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
type: "sketchGroup",
|
type: "sketchGroup",
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
|
@ -215,9 +215,6 @@ const example = extrude(1, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -217,9 +217,6 @@ let vase = layer()
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -117,9 +117,6 @@ const sketch001 = startSketchOn('XY')
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -281,9 +278,6 @@ const sketch001 = startSketchOn('XY')
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -112,9 +112,6 @@ const sketch001 = startSketchOn('XY')
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -276,9 +273,6 @@ const sketch001 = startSketchOn('XY')
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -111,9 +111,6 @@ const sketch001 = startSketchOn('XY')
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -275,9 +272,6 @@ const sketch001 = startSketchOn('XY')
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -247,9 +247,6 @@ uuid |
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -411,9 +408,6 @@ uuid |
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -679,9 +673,6 @@ uuid |
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -124,9 +124,6 @@ const example = extrude(4, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -288,9 +285,6 @@ const example = extrude(4, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -122,9 +122,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -286,9 +283,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -123,9 +123,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -287,9 +284,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -121,9 +121,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -285,9 +282,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -213,9 +213,6 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -515,9 +512,6 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -195,9 +195,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -445,9 +442,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -609,9 +603,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -142,9 +142,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -306,9 +303,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -264,9 +264,6 @@ const a1 = startSketchOn({
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -542,9 +539,6 @@ const a1 = startSketchOn({
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
5655
docs/kcl/std.json
@ -125,9 +125,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -289,9 +286,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -481,9 +475,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -645,9 +636,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -116,9 +116,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -280,9 +277,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -472,9 +466,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -636,9 +627,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -74,107 +74,6 @@ You can nest expressions in parenthesis as well:
|
|||||||
let myMathExpression = 3 + (1 * 2 / (3 - 7))
|
let myMathExpression = 3 + (1 * 2 / (3 - 7))
|
||||||
```
|
```
|
||||||
|
|
||||||
## Tags
|
Please if you find any issues using any of the above expressions or syntax
|
||||||
|
|
||||||
Tags are used to give a name (tag) to a specific path.
|
|
||||||
|
|
||||||
### Tag Declaration
|
|
||||||
|
|
||||||
The syntax for declaring a tag is `$myTag` you would use it in the following
|
|
||||||
way:
|
|
||||||
|
|
||||||
```
|
|
||||||
startSketchOn('XZ')
|
|
||||||
|> startProfileAt(origin, %)
|
|
||||||
|> angledLine([0, 191.26], %, $rectangleSegmentA001)
|
|
||||||
|> angledLine([
|
|
||||||
segAng(rectangleSegmentA001, %) - 90,
|
|
||||||
196.99
|
|
||||||
], %, $rectangleSegmentB001)
|
|
||||||
|> angledLine([
|
|
||||||
segAng(rectangleSegmentA001, %),
|
|
||||||
-segLen(rectangleSegmentA001, %)
|
|
||||||
], %, $rectangleSegmentC001)
|
|
||||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
|
||||||
|> close(%)
|
|
||||||
```
|
|
||||||
|
|
||||||
### Tag Identifier
|
|
||||||
|
|
||||||
As per the example above you can use the tag identifier to get a reference to the
|
|
||||||
tagged object. The syntax for this is `myTag`.
|
|
||||||
|
|
||||||
In the example above we use the tag identifier to get the angle of the segment
|
|
||||||
`segAng(rectangleSegmentA001, %)`.
|
|
||||||
|
|
||||||
|
|
||||||
### Tag Scope
|
|
||||||
|
|
||||||
Tags are scoped globally if in the root context meaning in this example you can
|
|
||||||
use the tag `rectangleSegmentA001` in any function or expression in the file.
|
|
||||||
|
|
||||||
However if the code was written like this:
|
|
||||||
|
|
||||||
```
|
|
||||||
fn rect = (origin) => {
|
|
||||||
return startSketchOn('XZ')
|
|
||||||
|> startProfileAt(origin, %)
|
|
||||||
|> angledLine([0, 191.26], %, $rectangleSegmentA001)
|
|
||||||
|> angledLine([
|
|
||||||
segAng(rectangleSegmentA001, %) - 90,
|
|
||||||
196.99
|
|
||||||
], %, $rectangleSegmentB001)
|
|
||||||
|> angledLine([
|
|
||||||
segAng(rectangleSegmentA001, %),
|
|
||||||
-segLen(rectangleSegmentA001, %)
|
|
||||||
], %, $rectangleSegmentC001)
|
|
||||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
|
||||||
|> close(%)
|
|
||||||
}
|
|
||||||
|
|
||||||
rect([0, 0])
|
|
||||||
rect([20, 0])
|
|
||||||
```
|
|
||||||
|
|
||||||
Those tags would only be available in the `rect` function and not globally.
|
|
||||||
|
|
||||||
However you likely want to use those tags somewhere outside the `rect` function.
|
|
||||||
|
|
||||||
Tags are accessible through the sketch group they are declared in.
|
|
||||||
For example the following code works.
|
|
||||||
|
|
||||||
```
|
|
||||||
fn rect = (origin) => {
|
|
||||||
return startSketchOn('XZ')
|
|
||||||
|> startProfileAt(origin, %)
|
|
||||||
|> angledLine([0, 191.26], %, $rectangleSegmentA001)
|
|
||||||
|> angledLine([
|
|
||||||
segAng(rectangleSegmentA001, %) - 90,
|
|
||||||
196.99
|
|
||||||
], %, $rectangleSegmentB001)
|
|
||||||
|> angledLine([
|
|
||||||
segAng(rectangleSegmentA001, %),
|
|
||||||
-segLen(rectangleSegmentA001, %)
|
|
||||||
], %, $rectangleSegmentC001)
|
|
||||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
|
||||||
|> close(%)
|
|
||||||
}
|
|
||||||
|
|
||||||
rect([0, 0])
|
|
||||||
const myRect = rect([20, 0])
|
|
||||||
|
|
||||||
myRect
|
|
||||||
|> extrude(10, %)
|
|
||||||
|> fillet({radius: 0.5, tags: [myRect.tags.rectangleSegmentA001]}, %)
|
|
||||||
```
|
|
||||||
|
|
||||||
See how we use the tag `rectangleSegmentA001` in the `fillet` function outside
|
|
||||||
the `rect` function. This is because the `rect` function is returning the
|
|
||||||
sketch group that contains the tags.
|
|
||||||
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
If you find any issues using any of the above expressions or syntax,
|
|
||||||
please file an issue with the `ast` label on the [modeling-app
|
please file an issue with the `ast` label on the [modeling-app
|
||||||
repo](https://github.com/KittyCAD/modeling-app/issues/new).
|
repo](https://github.com/KittyCAD/modeling-app/issues/new).
|
||||||
|
@ -119,9 +119,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -283,9 +280,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -475,9 +469,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -639,9 +630,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -119,9 +119,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -283,9 +280,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -475,9 +469,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -639,9 +630,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -117,9 +117,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -281,9 +278,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -473,9 +467,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -637,9 +628,6 @@ const example = extrude(10, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -115,9 +115,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -279,9 +276,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -471,9 +465,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
@ -635,9 +626,6 @@ const example = extrude(5, exampleSketch)
|
|||||||
},
|
},
|
||||||
// The to point.
|
// The to point.
|
||||||
to: [number, number],
|
to: [number, number],
|
||||||
},
|
|
||||||
// Tag identifiers that have been declared in this sketch group.
|
|
||||||
tags: {
|
|
||||||
},
|
},
|
||||||
// The paths in the sketch group.
|
// The paths in the sketch group.
|
||||||
value: [{
|
value: [{
|
||||||
|
@ -91,9 +91,8 @@ const part001 = startSketchOn('-XZ')
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
await page.setViewportSize({ width: 1200, height: 500 })
|
await page.setViewportSize({ width: 1200, height: 500 })
|
||||||
|
await page.goto('/')
|
||||||
await u.waitForAuthSkipAppStart()
|
await u.waitForAuthSkipAppStart()
|
||||||
|
|
||||||
await u.openDebugPanel()
|
await u.openDebugPanel()
|
||||||
await u.expectCmdLog('[data-message-type="execution-done"]')
|
await u.expectCmdLog('[data-message-type="execution-done"]')
|
||||||
await u.waitForCmdReceive('extrude')
|
await u.waitForCmdReceive('extrude')
|
||||||
@ -331,7 +330,7 @@ const extrudeDefaultPlane = async (context: any, page: any, plane: string) => {
|
|||||||
|
|
||||||
const u = await getUtils(page)
|
const u = await getUtils(page)
|
||||||
await page.setViewportSize({ width: 1200, height: 500 })
|
await page.setViewportSize({ width: 1200, height: 500 })
|
||||||
|
await page.goto('/')
|
||||||
await u.waitForAuthSkipAppStart()
|
await u.waitForAuthSkipAppStart()
|
||||||
|
|
||||||
// wait for execution done
|
// wait for execution done
|
||||||
@ -387,8 +386,8 @@ test('Draft segments should look right', async ({ page, context }) => {
|
|||||||
const u = await getUtils(page)
|
const u = await getUtils(page)
|
||||||
await page.setViewportSize({ width: 1200, height: 500 })
|
await page.setViewportSize({ width: 1200, height: 500 })
|
||||||
const PUR = 400 / 37.5 //pixeltoUnitRatio
|
const PUR = 400 / 37.5 //pixeltoUnitRatio
|
||||||
|
await page.goto('/')
|
||||||
await u.waitForAuthSkipAppStart()
|
await u.waitForAuthSkipAppStart()
|
||||||
|
|
||||||
await u.openDebugPanel()
|
await u.openDebugPanel()
|
||||||
|
|
||||||
await expect(
|
await expect(
|
||||||
@ -444,7 +443,7 @@ test('Draft rectangles should look right', async ({ page, context }) => {
|
|||||||
const u = await getUtils(page)
|
const u = await getUtils(page)
|
||||||
await page.setViewportSize({ width: 1200, height: 500 })
|
await page.setViewportSize({ width: 1200, height: 500 })
|
||||||
const PUR = 400 / 37.5 //pixeltoUnitRatio
|
const PUR = 400 / 37.5 //pixeltoUnitRatio
|
||||||
|
await page.goto('/')
|
||||||
await u.waitForAuthSkipAppStart()
|
await u.waitForAuthSkipAppStart()
|
||||||
await u.openDebugPanel()
|
await u.openDebugPanel()
|
||||||
|
|
||||||
@ -491,7 +490,7 @@ test.describe('Client side scene scale should match engine scale', () => {
|
|||||||
const u = await getUtils(page)
|
const u = await getUtils(page)
|
||||||
await page.setViewportSize({ width: 1200, height: 500 })
|
await page.setViewportSize({ width: 1200, height: 500 })
|
||||||
const PUR = 400 / 37.5 //pixeltoUnitRatio
|
const PUR = 400 / 37.5 //pixeltoUnitRatio
|
||||||
|
await page.goto('/')
|
||||||
await u.waitForAuthSkipAppStart()
|
await u.waitForAuthSkipAppStart()
|
||||||
await u.openDebugPanel()
|
await u.openDebugPanel()
|
||||||
|
|
||||||
@ -590,7 +589,7 @@ test.describe('Client side scene scale should match engine scale', () => {
|
|||||||
const u = await getUtils(page)
|
const u = await getUtils(page)
|
||||||
await page.setViewportSize({ width: 1200, height: 500 })
|
await page.setViewportSize({ width: 1200, height: 500 })
|
||||||
const PUR = 400 / 37.5 //pixeltoUnitRatio
|
const PUR = 400 / 37.5 //pixeltoUnitRatio
|
||||||
|
await page.goto('/')
|
||||||
await u.waitForAuthSkipAppStart()
|
await u.waitForAuthSkipAppStart()
|
||||||
await u.openDebugPanel()
|
await u.openDebugPanel()
|
||||||
|
|
||||||
@ -690,7 +689,7 @@ const part002 = startSketchOn(part001, 'seg01')
|
|||||||
}, KCL_DEFAULT_LENGTH)
|
}, KCL_DEFAULT_LENGTH)
|
||||||
|
|
||||||
await page.setViewportSize({ width: 1200, height: 500 })
|
await page.setViewportSize({ width: 1200, height: 500 })
|
||||||
|
await page.goto('/')
|
||||||
await u.waitForAuthSkipAppStart()
|
await u.waitForAuthSkipAppStart()
|
||||||
|
|
||||||
await u.openDebugPanel()
|
await u.openDebugPanel()
|
||||||
@ -740,7 +739,7 @@ test('Zoom to fit on load - solid 2d', async ({ page, context }) => {
|
|||||||
}, KCL_DEFAULT_LENGTH)
|
}, KCL_DEFAULT_LENGTH)
|
||||||
|
|
||||||
await page.setViewportSize({ width: 1200, height: 500 })
|
await page.setViewportSize({ width: 1200, height: 500 })
|
||||||
|
await page.goto('/')
|
||||||
await u.waitForAuthSkipAppStart()
|
await u.waitForAuthSkipAppStart()
|
||||||
|
|
||||||
await u.openDebugPanel()
|
await u.openDebugPanel()
|
||||||
@ -777,7 +776,7 @@ test('Zoom to fit on load - solid 3d', async ({ page, context }) => {
|
|||||||
}, KCL_DEFAULT_LENGTH)
|
}, KCL_DEFAULT_LENGTH)
|
||||||
|
|
||||||
await page.setViewportSize({ width: 1200, height: 500 })
|
await page.setViewportSize({ width: 1200, height: 500 })
|
||||||
|
await page.goto('/')
|
||||||
await u.waitForAuthSkipAppStart()
|
await u.waitForAuthSkipAppStart()
|
||||||
|
|
||||||
await u.openDebugPanel()
|
await u.openDebugPanel()
|
||||||
@ -796,83 +795,3 @@ test('Zoom to fit on load - solid 3d', async ({ page, context }) => {
|
|||||||
maxDiffPixels: 100,
|
maxDiffPixels: 100,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
test.describe('Grid visibility', () => {
|
|
||||||
test('Grid turned off', async ({ page }) => {
|
|
||||||
const u = await getUtils(page)
|
|
||||||
const stream = page.getByTestId('stream')
|
|
||||||
const mask = [
|
|
||||||
page.locator('#app-header'),
|
|
||||||
page.locator('#sidebar-top-ribbon'),
|
|
||||||
page.locator('#sidebar-bottom-ribbon'),
|
|
||||||
]
|
|
||||||
|
|
||||||
await page.setViewportSize({ width: 1200, height: 500 })
|
|
||||||
await page.goto('/')
|
|
||||||
await u.waitForAuthSkipAppStart()
|
|
||||||
|
|
||||||
await u.openDebugPanel()
|
|
||||||
// wait for execution done
|
|
||||||
await expect(
|
|
||||||
page.locator('[data-message-type="execution-done"]')
|
|
||||||
).toHaveCount(2)
|
|
||||||
await u.closeDebugPanel()
|
|
||||||
await u.closeKclCodePanel()
|
|
||||||
// TODO: Find a way to truly know that the objects have finished
|
|
||||||
// rendering, because an execution-done message is not sufficient.
|
|
||||||
await page.waitForTimeout(1000)
|
|
||||||
|
|
||||||
await expect(stream).toHaveScreenshot({
|
|
||||||
maxDiffPixels: 100,
|
|
||||||
mask,
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
test('Grid turned on', async ({ page }) => {
|
|
||||||
await page.addInitScript(
|
|
||||||
async ({ settingsKey, settings }) => {
|
|
||||||
localStorage.setItem(settingsKey, settings)
|
|
||||||
},
|
|
||||||
{
|
|
||||||
settingsKey: TEST_SETTINGS_KEY,
|
|
||||||
settings: TOML.stringify({
|
|
||||||
settings: {
|
|
||||||
...TEST_SETTINGS,
|
|
||||||
modeling: {
|
|
||||||
...TEST_SETTINGS.modeling,
|
|
||||||
showScaleGrid: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
const u = await getUtils(page)
|
|
||||||
const stream = page.getByTestId('stream')
|
|
||||||
const mask = [
|
|
||||||
page.locator('#app-header'),
|
|
||||||
page.locator('#sidebar-top-ribbon'),
|
|
||||||
page.locator('#sidebar-bottom-ribbon'),
|
|
||||||
]
|
|
||||||
|
|
||||||
await page.setViewportSize({ width: 1200, height: 500 })
|
|
||||||
await page.goto('/')
|
|
||||||
await u.waitForAuthSkipAppStart()
|
|
||||||
|
|
||||||
await u.openDebugPanel()
|
|
||||||
// wait for execution done
|
|
||||||
await expect(
|
|
||||||
page.locator('[data-message-type="execution-done"]')
|
|
||||||
).toHaveCount(2)
|
|
||||||
await u.closeDebugPanel()
|
|
||||||
await u.closeKclCodePanel()
|
|
||||||
// TODO: Find a way to truly know that the objects have finished
|
|
||||||
// rendering, because an execution-done message is not sufficient.
|
|
||||||
await page.waitForTimeout(1000)
|
|
||||||
|
|
||||||
await expect(stream).toHaveScreenshot({
|
|
||||||
maxDiffPixels: 100,
|
|
||||||
mask,
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 47 KiB |
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 69 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 60 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 27 KiB |
@ -207,23 +207,6 @@ export const getMovementUtils = (opts: any) => {
|
|||||||
return { toSU, click00r }
|
return { toSU, click00r }
|
||||||
}
|
}
|
||||||
|
|
||||||
async function waitForAuthAndLsp(page: Page) {
|
|
||||||
const waitForLspPromise = page.waitForEvent('console', async (message) => {
|
|
||||||
// it would be better to wait for a message that the kcl lsp has started by looking for the message message.text().includes('[lsp] [window/logMessage]')
|
|
||||||
// but that doesn't seem to make it to the console for macos/safari :(
|
|
||||||
if (message.text().includes('start kcl lsp')) {
|
|
||||||
await new Promise((resolve) => setTimeout(resolve, 200))
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
})
|
|
||||||
|
|
||||||
await page.goto('/')
|
|
||||||
await waitForPageLoad(page)
|
|
||||||
|
|
||||||
return waitForLspPromise
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function getUtils(page: Page) {
|
export async function getUtils(page: Page) {
|
||||||
// Chrome devtools protocol session only works in Chromium
|
// Chrome devtools protocol session only works in Chromium
|
||||||
const browserType = page.context().browser()?.browserType().name()
|
const browserType = page.context().browser()?.browserType().name()
|
||||||
@ -231,8 +214,7 @@ export async function getUtils(page: Page) {
|
|||||||
browserType !== 'chromium' ? null : await page.context().newCDPSession(page)
|
browserType !== 'chromium' ? null : await page.context().newCDPSession(page)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
waitForAuthSkipAppStart: () => waitForAuthAndLsp(page),
|
waitForAuthSkipAppStart: () => waitForPageLoad(page),
|
||||||
waitForPageLoad: () => waitForPageLoad(page),
|
|
||||||
removeCurrentCode: () => removeCurrentCode(page),
|
removeCurrentCode: () => removeCurrentCode(page),
|
||||||
sendCustomCmd: (cmd: EngineCommand) => sendCustomCmd(page, cmd),
|
sendCustomCmd: (cmd: EngineCommand) => sendCustomCmd(page, cmd),
|
||||||
updateCamPosition: async (xyz: [number, number, number]) => {
|
updateCamPosition: async (xyz: [number, number, number]) => {
|
||||||
@ -312,9 +294,9 @@ export async function getUtils(page: Page) {
|
|||||||
fullPage: true,
|
fullPage: true,
|
||||||
})
|
})
|
||||||
const screenshot = await PNG.sync.read(buffer)
|
const screenshot = await PNG.sync.read(buffer)
|
||||||
const pixMultiplier: number = await page.evaluate(
|
// most likely related to pixel density but the screenshots for webkit are 2x the size
|
||||||
'window.devicePixelRatio'
|
// there might be a more robust way of doing this.
|
||||||
)
|
const pixMultiplier = browserType === 'webkit' ? 2 : 1
|
||||||
const index =
|
const index =
|
||||||
(screenshot.width * coords.y * pixMultiplier +
|
(screenshot.width * coords.y * pixMultiplier +
|
||||||
coords.x * pixMultiplier) *
|
coords.x * pixMultiplier) *
|
||||||
@ -377,13 +359,11 @@ export async function getUtils(page: Page) {
|
|||||||
emulateNetworkConditions: async (
|
emulateNetworkConditions: async (
|
||||||
networkOptions: Protocol.Network.emulateNetworkConditionsParameters
|
networkOptions: Protocol.Network.emulateNetworkConditionsParameters
|
||||||
) => {
|
) => {
|
||||||
if (browserType !== 'chromium') {
|
// Skip on non-Chromium browsers, since we need to use the CDP.
|
||||||
console.warn('emulateNetworkConditions will not work on this browser')
|
test.skip(
|
||||||
}
|
cdpSession === null,
|
||||||
if (cdpSession === null) {
|
'Network emulation is only supported in Chromium'
|
||||||
// Use a fail safe if we can't simulate disconnect (on Safari)
|
)
|
||||||
return page.evaluate('window.tearDown()')
|
|
||||||
}
|
|
||||||
|
|
||||||
cdpSession?.send('Network.emulateNetworkConditions', networkOptions)
|
cdpSession?.send('Network.emulateNetworkConditions', networkOptions)
|
||||||
},
|
},
|
||||||
|
3
examples/addition.cado
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
// comment
|
||||||
|
|
||||||
|
const hi = 5 + 4
|
81
package.json
@ -1,43 +1,50 @@
|
|||||||
{
|
{
|
||||||
"name": "untitled-app",
|
"name": "untitled-app",
|
||||||
"version": "0.23.1",
|
"version": "0.22.6",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@codemirror/autocomplete": "^6.17.0",
|
"@codemirror/autocomplete": "^6.16.0",
|
||||||
"@codemirror/commands": "^6.6.0",
|
|
||||||
"@codemirror/language": "^6.10.2",
|
|
||||||
"@codemirror/lint": "^6.8.1",
|
|
||||||
"@codemirror/search": "^6.5.6",
|
|
||||||
"@codemirror/state": "^6.4.1",
|
|
||||||
"@codemirror/theme-one-dark": "^6.1.2",
|
|
||||||
"@csstools/postcss-oklab-function": "^3.0.16",
|
|
||||||
"@fortawesome/fontawesome-svg-core": "^6.5.2",
|
"@fortawesome/fontawesome-svg-core": "^6.5.2",
|
||||||
"@fortawesome/free-brands-svg-icons": "^6.5.2",
|
"@fortawesome/free-brands-svg-icons": "^6.5.2",
|
||||||
"@fortawesome/free-solid-svg-icons": "^6.4.2",
|
"@fortawesome/free-solid-svg-icons": "^6.4.2",
|
||||||
"@fortawesome/react-fontawesome": "^0.2.0",
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
||||||
"@headlessui/react": "^1.7.19",
|
"@headlessui/react": "^1.7.19",
|
||||||
"@headlessui/tailwindcss": "^0.2.0",
|
"@headlessui/tailwindcss": "^0.2.0",
|
||||||
"@kittycad/lib": "^0.0.69",
|
"@kittycad/lib": "^0.0.67",
|
||||||
|
"@lezer/javascript": "^1.4.9",
|
||||||
|
"@open-rpc/client-js": "^1.8.1",
|
||||||
"@react-hook/resize-observer": "^2.0.1",
|
"@react-hook/resize-observer": "^2.0.1",
|
||||||
"@replit/codemirror-interact": "^6.3.1",
|
"@replit/codemirror-interact": "^6.3.1",
|
||||||
"@tauri-apps/api": "^2.0.0-beta.14",
|
"@tauri-apps/api": "2.0.0-beta.12",
|
||||||
"@tauri-apps/plugin-dialog": "^2.0.0-beta.6",
|
"@tauri-apps/plugin-dialog": "^2.0.0-beta.2",
|
||||||
"@tauri-apps/plugin-fs": "^2.0.0-beta.6",
|
"@tauri-apps/plugin-fs": "^2.0.0-beta.3",
|
||||||
"@tauri-apps/plugin-http": "^2.0.0-beta.7",
|
"@tauri-apps/plugin-http": "^2.0.0-beta.2",
|
||||||
"@tauri-apps/plugin-os": "^2.0.0-beta.6",
|
"@tauri-apps/plugin-os": "^2.0.0-beta.3",
|
||||||
"@tauri-apps/plugin-process": "^2.0.0-beta.6",
|
"@tauri-apps/plugin-process": "^2.0.0-beta.2",
|
||||||
"@tauri-apps/plugin-shell": "^2.0.0-beta.7",
|
"@tauri-apps/plugin-shell": "^2.0.0-beta.2",
|
||||||
"@tauri-apps/plugin-updater": "^2.0.0-beta.6",
|
"@tauri-apps/plugin-updater": "^2.0.0-beta.3",
|
||||||
|
"@testing-library/jest-dom": "^5.14.1",
|
||||||
|
"@testing-library/react": "^15.0.2",
|
||||||
|
"@testing-library/user-event": "^14.5.2",
|
||||||
"@ts-stack/markdown": "^1.5.0",
|
"@ts-stack/markdown": "^1.5.0",
|
||||||
"@tweenjs/tween.js": "^23.1.1",
|
"@tweenjs/tween.js": "^23.1.1",
|
||||||
|
"@types/node": "^18.19.31",
|
||||||
|
"@types/react": "^18.3.2",
|
||||||
|
"@types/react-dom": "^18.2.25",
|
||||||
|
"@uiw/react-codemirror": "^4.21.25",
|
||||||
"@xstate/inspect": "^0.8.0",
|
"@xstate/inspect": "^0.8.0",
|
||||||
"@xstate/react": "^3.2.2",
|
"@xstate/react": "^3.2.2",
|
||||||
"codemirror": "^6.0.1",
|
"crypto-js": "^4.2.0",
|
||||||
|
"debounce-promise": "^3.1.2",
|
||||||
"decamelize": "^6.0.0",
|
"decamelize": "^6.0.0",
|
||||||
|
"eslint-plugin-suggest-no-throw": "^1.0.0",
|
||||||
|
"formik": "^2.4.6",
|
||||||
"fuse.js": "^7.0.0",
|
"fuse.js": "^7.0.0",
|
||||||
"html2canvas-pro": "^1.5.2",
|
"html2canvas-pro": "^1.4.3",
|
||||||
|
"http-server": "^14.1.1",
|
||||||
"json-rpc-2.0": "^1.6.0",
|
"json-rpc-2.0": "^1.6.0",
|
||||||
"jszip": "^3.10.1",
|
"jszip": "^3.10.1",
|
||||||
|
"node-fetch": "^3.3.2",
|
||||||
"re-resizable": "^6.9.11",
|
"re-resizable": "^6.9.11",
|
||||||
"react": "^18.3.1",
|
"react": "^18.3.1",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
@ -48,15 +55,20 @@
|
|||||||
"react-modal-promise": "^1.0.2",
|
"react-modal-promise": "^1.0.2",
|
||||||
"react-router-dom": "^6.23.1",
|
"react-router-dom": "^6.23.1",
|
||||||
"sketch-helpers": "^0.0.4",
|
"sketch-helpers": "^0.0.4",
|
||||||
"three": "^0.166.1",
|
"swr": "^2.2.5",
|
||||||
|
"three": "^0.164.1",
|
||||||
|
"ts-node": "^10.9.2",
|
||||||
"typescript": "^5.4.5",
|
"typescript": "^5.4.5",
|
||||||
"ua-parser-js": "^1.0.37",
|
"ua-parser-js": "^1.0.37",
|
||||||
"uuid": "^9.0.1",
|
"uuid": "^9.0.1",
|
||||||
|
"vitest": "^1.6.0",
|
||||||
"vscode-jsonrpc": "^8.2.1",
|
"vscode-jsonrpc": "^8.2.1",
|
||||||
"vscode-languageserver-protocol": "^3.17.5",
|
"vscode-languageserver-protocol": "^3.17.5",
|
||||||
"vscode-uri": "^3.0.8",
|
"wasm-pack": "^0.12.1",
|
||||||
"web-vitals": "^3.5.2",
|
"web-vitals": "^3.5.2",
|
||||||
"xstate": "^4.38.2"
|
"ws": "^8.17.0",
|
||||||
|
"xstate": "^4.38.2",
|
||||||
|
"zustand": "^4.5.2"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "vite",
|
"start": "vite",
|
||||||
@ -73,8 +85,8 @@
|
|||||||
"test:e2e:tauri": "E2E_TAURI_ENABLED=true TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\"}' wdio run wdio.conf.ts",
|
"test:e2e:tauri": "E2E_TAURI_ENABLED=true TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\"}' wdio run wdio.conf.ts",
|
||||||
"simpleserver:ci": "yarn pretest && http-server ./public --cors -p 3000 &",
|
"simpleserver:ci": "yarn pretest && http-server ./public --cors -p 3000 &",
|
||||||
"simpleserver": "yarn pretest && http-server ./public --cors -p 3000",
|
"simpleserver": "yarn pretest && http-server ./public --cors -p 3000",
|
||||||
"fmt": "prettier --write ./src *.ts *.json *.js ./e2e ./packages",
|
"fmt": "prettier --write ./src *.ts *.json *.js ./e2e",
|
||||||
"fmt-check": "prettier --check ./src *.ts *.json *.js ./e2e ./packages",
|
"fmt-check": "prettier --check ./src *.ts *.json *.js ./e2e",
|
||||||
"fetch:wasm": "./get-latest-wasm-bundle.sh",
|
"fetch:wasm": "./get-latest-wasm-bundle.sh",
|
||||||
"build:wasm-dev": "(cd src/wasm-lib && wasm-pack build --dev --target web --out-dir pkg && cargo test -p kcl-lib export_bindings) && cp src/wasm-lib/pkg/wasm_lib_bg.wasm public && yarn fmt",
|
"build:wasm-dev": "(cd src/wasm-lib && wasm-pack build --dev --target web --out-dir pkg && cargo test -p kcl-lib export_bindings) && cp src/wasm-lib/pkg/wasm_lib_bg.wasm public && yarn fmt",
|
||||||
"build:wasm": "(cd src/wasm-lib && wasm-pack build --release --target web --out-dir pkg && cargo test -p kcl-lib export_bindings) && cp src/wasm-lib/pkg/wasm_lib_bg.wasm public && yarn fmt",
|
"build:wasm": "(cd src/wasm-lib && wasm-pack build --release --target web --out-dir pkg && cargo test -p kcl-lib export_bindings) && cp src/wasm-lib/pkg/wasm_lib_bg.wasm public && yarn fmt",
|
||||||
@ -109,16 +121,13 @@
|
|||||||
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
||||||
"@babel/preset-env": "^7.24.3",
|
"@babel/preset-env": "^7.24.3",
|
||||||
"@iarna/toml": "^2.2.5",
|
"@iarna/toml": "^2.2.5",
|
||||||
"@playwright/test": "^1.45.1",
|
"@playwright/test": "^1.44.1",
|
||||||
"@tauri-apps/cli": "==2.0.0-beta.13",
|
"@tauri-apps/cli": "^2.0.0-beta.13",
|
||||||
"@testing-library/jest-dom": "^5.14.1",
|
"@types/crypto-js": "^4.2.2",
|
||||||
"@testing-library/react": "^15.0.2",
|
"@types/debounce-promise": "^3.1.9",
|
||||||
"@types/mocha": "^10.0.6",
|
"@types/mocha": "^10.0.6",
|
||||||
"@types/node": "^18.19.31",
|
|
||||||
"@types/pixelmatch": "^5.2.6",
|
"@types/pixelmatch": "^5.2.6",
|
||||||
"@types/pngjs": "^6.0.4",
|
"@types/pngjs": "^6.0.4",
|
||||||
"@types/react": "^18.3.2",
|
|
||||||
"@types/react-dom": "^18.2.25",
|
|
||||||
"@types/react-modal": "^3.16.3",
|
"@types/react-modal": "^3.16.3",
|
||||||
"@types/three": "^0.163.0",
|
"@types/three": "^0.163.0",
|
||||||
"@types/ua-parser-js": "^0.7.39",
|
"@types/ua-parser-js": "^0.7.39",
|
||||||
@ -138,27 +147,21 @@
|
|||||||
"eslint": "^8.57.0",
|
"eslint": "^8.57.0",
|
||||||
"eslint-config-react-app": "^7.0.1",
|
"eslint-config-react-app": "^7.0.1",
|
||||||
"eslint-plugin-css-modules": "^2.12.0",
|
"eslint-plugin-css-modules": "^2.12.0",
|
||||||
"eslint-plugin-suggest-no-throw": "^1.0.0",
|
|
||||||
"happy-dom": "^14.3.10",
|
"happy-dom": "^14.3.10",
|
||||||
"http-server": "^14.1.1",
|
|
||||||
"husky": "^9.0.11",
|
"husky": "^9.0.11",
|
||||||
"node-fetch": "^3.3.2",
|
|
||||||
"pixelmatch": "^5.3.0",
|
"pixelmatch": "^5.3.0",
|
||||||
"pngjs": "^7.0.0",
|
"pngjs": "^7.0.0",
|
||||||
"postcss": "^8.4.31",
|
"postcss": "^8.4.31",
|
||||||
"postinstall-postinstall": "^2.1.0",
|
"postinstall-postinstall": "^2.1.0",
|
||||||
"prettier": "^2.8.8",
|
"prettier": "^2.8.0",
|
||||||
"setimmediate": "^1.0.5",
|
"setimmediate": "^1.0.5",
|
||||||
"tailwindcss": "^3.4.1",
|
"tailwindcss": "^3.4.1",
|
||||||
"vite": "^5.2.9",
|
"vite": "^5.2.9",
|
||||||
"vite-plugin-eslint": "^1.8.1",
|
"vite-plugin-eslint": "^1.8.1",
|
||||||
"vite-plugin-package-version": "^1.1.0",
|
"vite-plugin-package-version": "^1.1.0",
|
||||||
"vite-tsconfig-paths": "^4.3.2",
|
"vite-tsconfig-paths": "^4.3.2",
|
||||||
"vitest": "^1.6.0",
|
|
||||||
"vitest-webgl-canvas-mock": "^1.1.0",
|
"vitest-webgl-canvas-mock": "^1.1.0",
|
||||||
"wait-on": "^7.2.0",
|
"wait-on": "^7.2.0",
|
||||||
"wasm-pack": "^0.13.0",
|
|
||||||
"ws": "^8.17.0",
|
|
||||||
"yarn": "^1.22.22"
|
"yarn": "^1.22.22"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
6
packages/codemirror-lsp-client/.gitignore
vendored
@ -1,6 +0,0 @@
|
|||||||
node_modules
|
|
||||||
build
|
|
||||||
dist
|
|
||||||
tsconfig.tsbuildinfo
|
|
||||||
*.d.ts
|
|
||||||
*.js
|
|
@ -1,35 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "@kittycad/codemirror-lsp-client",
|
|
||||||
"version": "1.0.0",
|
|
||||||
"description": "An LSP client for the codemirror editor.",
|
|
||||||
"main": "src/index.ts",
|
|
||||||
"exports": {
|
|
||||||
"import": "./dist/index.js",
|
|
||||||
"require": "./dist/index.js"
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"build": "tsc"
|
|
||||||
},
|
|
||||||
"types": "dist/index.d.ts",
|
|
||||||
"module": "dist/index.js",
|
|
||||||
"type": "module",
|
|
||||||
"repository": "https://github.com/KittyCAD/modeling-app",
|
|
||||||
"author": "Zoo Engineering Team",
|
|
||||||
"license": "MIT",
|
|
||||||
"private": false,
|
|
||||||
"dependencies": {
|
|
||||||
"@codemirror/autocomplete": "^6.16.3",
|
|
||||||
"@codemirror/language": "^6.10.2",
|
|
||||||
"@codemirror/state": "^6.4.1",
|
|
||||||
"@lezer/highlight": "^1.2.0",
|
|
||||||
"@ts-stack/markdown": "^1.5.0",
|
|
||||||
"json-rpc-2.0": "^1.7.0",
|
|
||||||
"typescript": "^5.5.2",
|
|
||||||
"vscode-languageserver-protocol": "^3.17.5",
|
|
||||||
"vscode-uri": "^3.0.8"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@types/node": "^20.14.9",
|
|
||||||
"ts-node": "^10.9.2"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,13 +0,0 @@
|
|||||||
import { Message } from 'vscode-languageserver-protocol'
|
|
||||||
|
|
||||||
export default class Tracer {
|
|
||||||
static client(message: string): void {
|
|
||||||
console.log('lsp client message', message)
|
|
||||||
}
|
|
||||||
|
|
||||||
static server(input: string | Message): void {
|
|
||||||
const message: string =
|
|
||||||
typeof input === 'string' ? input : JSON.stringify(input)
|
|
||||||
console.log('lsp server message', message)
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,57 +0,0 @@
|
|||||||
import { foldService } from '@codemirror/language'
|
|
||||||
import { Extension, EditorState } from '@codemirror/state'
|
|
||||||
import { ViewPlugin } from '@codemirror/view'
|
|
||||||
|
|
||||||
import {
|
|
||||||
docPathFacet,
|
|
||||||
LanguageServerPlugin,
|
|
||||||
LanguageServerPluginSpec,
|
|
||||||
languageId,
|
|
||||||
workspaceFolders,
|
|
||||||
LanguageServerOptions,
|
|
||||||
} from './plugin/lsp'
|
|
||||||
|
|
||||||
export type { LanguageServerClientOptions } from './client'
|
|
||||||
export { LanguageServerClient } from './client'
|
|
||||||
export {
|
|
||||||
Codec,
|
|
||||||
FromServer,
|
|
||||||
IntoServer,
|
|
||||||
LspWorkerEventType,
|
|
||||||
} from './client/codec'
|
|
||||||
export type { LanguageServerOptions } from './plugin/lsp'
|
|
||||||
export {
|
|
||||||
LanguageServerPlugin,
|
|
||||||
LanguageServerPluginSpec,
|
|
||||||
docPathFacet,
|
|
||||||
languageId,
|
|
||||||
workspaceFolders,
|
|
||||||
lspSemanticTokensEvent,
|
|
||||||
lspDiagnosticsEvent,
|
|
||||||
lspFormatCodeEvent,
|
|
||||||
} from './plugin/lsp'
|
|
||||||
export { posToOffset, offsetToPos } from './plugin/util'
|
|
||||||
|
|
||||||
export function lspPlugin(options: LanguageServerOptions): Extension {
|
|
||||||
let plugin: LanguageServerPlugin | null = null
|
|
||||||
const viewPlugin = ViewPlugin.define(
|
|
||||||
(view) => (plugin = new LanguageServerPlugin(options, view)),
|
|
||||||
new LanguageServerPluginSpec()
|
|
||||||
)
|
|
||||||
|
|
||||||
let ext = [
|
|
||||||
docPathFacet.of(options.documentUri),
|
|
||||||
languageId.of('kcl'),
|
|
||||||
workspaceFolders.of(options.workspaceFolders),
|
|
||||||
viewPlugin,
|
|
||||||
foldService.of((state: EditorState, lineStart: number, lineEnd: number) => {
|
|
||||||
if (plugin == null) return null
|
|
||||||
// Get the folding ranges from the language server.
|
|
||||||
// Since this is async we directly need to update the folding ranges after.
|
|
||||||
const range = plugin?.foldingRange(lineStart, lineEnd)
|
|
||||||
return range
|
|
||||||
}),
|
|
||||||
]
|
|
||||||
|
|
||||||
return ext
|
|
||||||
}
|
|
@ -1,112 +0,0 @@
|
|||||||
import {
|
|
||||||
acceptCompletion,
|
|
||||||
autocompletion,
|
|
||||||
clearSnippet,
|
|
||||||
closeCompletion,
|
|
||||||
hasNextSnippetField,
|
|
||||||
moveCompletionSelection,
|
|
||||||
nextSnippetField,
|
|
||||||
prevSnippetField,
|
|
||||||
startCompletion,
|
|
||||||
} from '@codemirror/autocomplete'
|
|
||||||
import { Prec, Extension } from '@codemirror/state'
|
|
||||||
import { EditorView, keymap, KeyBinding, ViewPlugin } from '@codemirror/view'
|
|
||||||
|
|
||||||
import {
|
|
||||||
CompletionItemKind,
|
|
||||||
CompletionTriggerKind,
|
|
||||||
} from 'vscode-languageserver-protocol'
|
|
||||||
|
|
||||||
import { LanguageServerPlugin } from './lsp'
|
|
||||||
import { offsetToPos } from './util'
|
|
||||||
import { syntaxTree } from '@codemirror/language'
|
|
||||||
|
|
||||||
export const CompletionItemKindMap = Object.fromEntries(
|
|
||||||
Object.entries(CompletionItemKind).map(([key, value]) => [value, key])
|
|
||||||
) as Record<CompletionItemKind, string>
|
|
||||||
|
|
||||||
const lspAutocompleteKeymap: readonly KeyBinding[] = [
|
|
||||||
{ key: 'Ctrl-Space', run: startCompletion },
|
|
||||||
{
|
|
||||||
key: 'Escape',
|
|
||||||
run: (view: EditorView): boolean => {
|
|
||||||
if (clearSnippet(view)) return true
|
|
||||||
|
|
||||||
return closeCompletion(view)
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{ key: 'ArrowDown', run: moveCompletionSelection(true) },
|
|
||||||
{ key: 'ArrowUp', run: moveCompletionSelection(false) },
|
|
||||||
{ key: 'PageDown', run: moveCompletionSelection(true, 'page') },
|
|
||||||
{ key: 'PageUp', run: moveCompletionSelection(false, 'page') },
|
|
||||||
{ key: 'Enter', run: acceptCompletion },
|
|
||||||
{
|
|
||||||
key: 'Tab',
|
|
||||||
run: (view: EditorView): boolean => {
|
|
||||||
if (hasNextSnippetField(view.state)) {
|
|
||||||
const result = nextSnippetField(view)
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
return acceptCompletion(view)
|
|
||||||
},
|
|
||||||
shift: prevSnippetField,
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
const lspAutocompleteKeymapExt = Prec.highest(keymap.of(lspAutocompleteKeymap))
|
|
||||||
|
|
||||||
export default function lspAutocompleteExt(
|
|
||||||
plugin: ViewPlugin<LanguageServerPlugin>
|
|
||||||
): Extension {
|
|
||||||
return [
|
|
||||||
lspAutocompleteKeymapExt,
|
|
||||||
autocompletion({
|
|
||||||
defaultKeymap: false,
|
|
||||||
override: [
|
|
||||||
async (context) => {
|
|
||||||
const { state, pos, explicit, view } = context
|
|
||||||
let value = view?.plugin(plugin)
|
|
||||||
if (!value) return null
|
|
||||||
|
|
||||||
let nodeBefore = syntaxTree(state).resolveInner(pos, -1)
|
|
||||||
if (
|
|
||||||
nodeBefore.name === 'BlockComment' ||
|
|
||||||
nodeBefore.name === 'LineComment'
|
|
||||||
)
|
|
||||||
return null
|
|
||||||
|
|
||||||
const line = state.doc.lineAt(pos)
|
|
||||||
let trigKind: CompletionTriggerKind = CompletionTriggerKind.Invoked
|
|
||||||
let trigChar: string | undefined
|
|
||||||
if (
|
|
||||||
!explicit &&
|
|
||||||
value.client
|
|
||||||
.getServerCapabilities()
|
|
||||||
.completionProvider?.triggerCharacters?.includes(
|
|
||||||
line.text[pos - line.from - 1]
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
trigKind = CompletionTriggerKind.TriggerCharacter
|
|
||||||
trigChar = line.text[pos - line.from - 1]
|
|
||||||
}
|
|
||||||
if (
|
|
||||||
trigKind === CompletionTriggerKind.Invoked &&
|
|
||||||
!context.matchBefore(/\w+$/)
|
|
||||||
) {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
return await value.requestCompletion(
|
|
||||||
context,
|
|
||||||
offsetToPos(state.doc, pos),
|
|
||||||
{
|
|
||||||
triggerKind: trigKind,
|
|
||||||
triggerCharacter: trigChar,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}),
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,27 +0,0 @@
|
|||||||
import { Extension, Prec } from '@codemirror/state'
|
|
||||||
import { EditorView, keymap, KeyBinding, ViewPlugin } from '@codemirror/view'
|
|
||||||
|
|
||||||
import { LanguageServerPlugin } from './lsp'
|
|
||||||
|
|
||||||
export default function lspFormatExt(
|
|
||||||
plugin: ViewPlugin<LanguageServerPlugin>
|
|
||||||
): Extension {
|
|
||||||
const formatKeymap: readonly KeyBinding[] = [
|
|
||||||
{
|
|
||||||
key: 'Alt-Shift-f',
|
|
||||||
run: (view: EditorView) => {
|
|
||||||
let value = view.plugin(plugin)
|
|
||||||
if (!value) return false
|
|
||||||
value.requestFormatting()
|
|
||||||
return true
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
// Create an extension for the key mappings.
|
|
||||||
const formatKeymapExt = Prec.highest(
|
|
||||||
keymap.computeN([], () => [formatKeymap])
|
|
||||||
)
|
|
||||||
|
|
||||||
return formatKeymapExt
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
import { Extension } from '@codemirror/state'
|
|
||||||
import { hoverTooltip, tooltips, ViewPlugin } from '@codemirror/view'
|
|
||||||
|
|
||||||
import { LanguageServerPlugin } from './lsp'
|
|
||||||
import { offsetToPos } from './util'
|
|
||||||
|
|
||||||
export default function lspHoverExt(
|
|
||||||
plugin: ViewPlugin<LanguageServerPlugin>
|
|
||||||
): Extension {
|
|
||||||
return [
|
|
||||||
hoverTooltip((view, pos) => {
|
|
||||||
const value = view.plugin(plugin)
|
|
||||||
return (
|
|
||||||
value?.requestHoverTooltip(view, offsetToPos(view.state.doc, pos)) ??
|
|
||||||
null
|
|
||||||
)
|
|
||||||
}),
|
|
||||||
tooltips({
|
|
||||||
position: 'absolute',
|
|
||||||
}),
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,21 +0,0 @@
|
|||||||
import { indentService } from '@codemirror/language'
|
|
||||||
import { Extension } from '@codemirror/state'
|
|
||||||
|
|
||||||
export default function lspIndentExt(): Extension {
|
|
||||||
// Match the indentation of the previous line (if present).
|
|
||||||
return indentService.of((context, pos) => {
|
|
||||||
try {
|
|
||||||
const previousLine = context.lineAt(pos, -1)
|
|
||||||
const previousLineText = previousLine.text.replaceAll(
|
|
||||||
'\t',
|
|
||||||
' '.repeat(context.state.tabSize)
|
|
||||||
)
|
|
||||||
const match = previousLineText.match(/^(\s)*/)
|
|
||||||
if (match === null || match.length <= 0) return null
|
|
||||||
return match[0].length
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error in codemirror indentService', err)
|
|
||||||
}
|
|
||||||
return null
|
|
||||||
})
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
import { Extension } from '@codemirror/state'
|
|
||||||
import { linter, forEachDiagnostic, Diagnostic } from '@codemirror/lint'
|
|
||||||
|
|
||||||
export default function lspLintExt(): Extension {
|
|
||||||
return linter((view) => {
|
|
||||||
let diagnostics: Diagnostic[] = []
|
|
||||||
forEachDiagnostic(view.state, (d: Diagnostic, from: number, to: number) => {
|
|
||||||
diagnostics.push(d)
|
|
||||||
})
|
|
||||||
return diagnostics
|
|
||||||
})
|
|
||||||
}
|
|
@ -1,175 +0,0 @@
|
|||||||
import { highlightingFor } from '@codemirror/language'
|
|
||||||
import { StateEffect, StateField, Extension } from '@codemirror/state'
|
|
||||||
import { EditorView, Decoration, DecorationSet } from '@codemirror/view'
|
|
||||||
|
|
||||||
import { Tag, tags } from '@lezer/highlight'
|
|
||||||
|
|
||||||
import { lspSemanticTokensEvent } from './lsp'
|
|
||||||
|
|
||||||
export interface SemanticToken {
|
|
||||||
from: number
|
|
||||||
to: number
|
|
||||||
type: string
|
|
||||||
modifiers: string[]
|
|
||||||
}
|
|
||||||
|
|
||||||
export const addToken = StateEffect.define<SemanticToken>({
|
|
||||||
map: (token: SemanticToken, change) => ({
|
|
||||||
...token,
|
|
||||||
from: change.mapPos(token.from),
|
|
||||||
to: change.mapPos(token.to),
|
|
||||||
}),
|
|
||||||
})
|
|
||||||
|
|
||||||
export default function lspSemanticTokenExt(): Extension {
|
|
||||||
return StateField.define<DecorationSet>({
|
|
||||||
create() {
|
|
||||||
return Decoration.none
|
|
||||||
},
|
|
||||||
update(highlights, tr) {
|
|
||||||
// Nothing can come before this line, this is very important!
|
|
||||||
// It makes sure the highlights are updated correctly for the changes.
|
|
||||||
highlights = highlights.map(tr.changes)
|
|
||||||
|
|
||||||
const isSemanticTokensEvent = tr.annotation(lspSemanticTokensEvent.type)
|
|
||||||
if (!isSemanticTokensEvent) {
|
|
||||||
return highlights
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if any of the changes are addToken
|
|
||||||
const hasAddToken = tr.effects.some((e) => e.is(addToken))
|
|
||||||
if (hasAddToken) {
|
|
||||||
highlights = highlights.update({
|
|
||||||
filter: (from, to) => false,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const e of tr.effects)
|
|
||||||
if (e.is(addToken)) {
|
|
||||||
const tag = getTag(e.value)
|
|
||||||
const className = tag
|
|
||||||
? highlightingFor(tr.startState, [tag])
|
|
||||||
: undefined
|
|
||||||
|
|
||||||
if (e.value.from < e.value.to && tag) {
|
|
||||||
if (className) {
|
|
||||||
highlights = highlights.update({
|
|
||||||
add: [
|
|
||||||
Decoration.mark({ class: className }).range(
|
|
||||||
e.value.from,
|
|
||||||
e.value.to
|
|
||||||
),
|
|
||||||
],
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return highlights
|
|
||||||
},
|
|
||||||
provide: (f) => EditorView.decorations.from(f),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getTag(semanticToken: SemanticToken): Tag | null {
|
|
||||||
let tokenType = convertSemanticTokenTypeToCodeMirrorTag(semanticToken.type)
|
|
||||||
|
|
||||||
if (
|
|
||||||
semanticToken.modifiers === undefined ||
|
|
||||||
semanticToken.modifiers === null ||
|
|
||||||
semanticToken.modifiers.length === 0
|
|
||||||
) {
|
|
||||||
return tokenType
|
|
||||||
}
|
|
||||||
|
|
||||||
for (let modifier of semanticToken.modifiers) {
|
|
||||||
tokenType = convertSemanticTokenToCodeMirrorTag(
|
|
||||||
'',
|
|
||||||
modifier,
|
|
||||||
tokenType || undefined
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
return tokenType
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getTagName(semanticToken: SemanticToken): string {
|
|
||||||
let tokenType = semanticToken.type
|
|
||||||
|
|
||||||
if (
|
|
||||||
semanticToken.modifiers === undefined ||
|
|
||||||
semanticToken.modifiers === null ||
|
|
||||||
semanticToken.modifiers.length === 0
|
|
||||||
) {
|
|
||||||
return tokenType
|
|
||||||
}
|
|
||||||
|
|
||||||
for (let modifier of semanticToken.modifiers) {
|
|
||||||
tokenType = `${tokenType}.${modifier}`
|
|
||||||
}
|
|
||||||
|
|
||||||
return tokenType
|
|
||||||
}
|
|
||||||
|
|
||||||
function convertSemanticTokenTypeToCodeMirrorTag(
|
|
||||||
tokenType: string
|
|
||||||
): Tag | null {
|
|
||||||
switch (tokenType) {
|
|
||||||
case 'keyword':
|
|
||||||
return tags.keyword
|
|
||||||
case 'variable':
|
|
||||||
return tags.variableName
|
|
||||||
case 'string':
|
|
||||||
return tags.string
|
|
||||||
case 'number':
|
|
||||||
return tags.number
|
|
||||||
case 'comment':
|
|
||||||
return tags.comment
|
|
||||||
case 'operator':
|
|
||||||
return tags.operator
|
|
||||||
case 'function':
|
|
||||||
return tags.function(tags.name)
|
|
||||||
case 'type':
|
|
||||||
return tags.typeName
|
|
||||||
case 'property':
|
|
||||||
return tags.propertyName
|
|
||||||
case 'parameter':
|
|
||||||
return tags.local(tags.name)
|
|
||||||
default:
|
|
||||||
console.error('Unknown token type:', tokenType)
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function convertSemanticTokenToCodeMirrorTag(
|
|
||||||
tokenType: string,
|
|
||||||
tokenModifier: string,
|
|
||||||
givenTag?: Tag
|
|
||||||
): Tag | null {
|
|
||||||
let tag = givenTag
|
|
||||||
? givenTag
|
|
||||||
: convertSemanticTokenTypeToCodeMirrorTag(tokenType)
|
|
||||||
|
|
||||||
if (!tag) {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tokenModifier) {
|
|
||||||
switch (tokenModifier) {
|
|
||||||
case 'definition':
|
|
||||||
return tags.definition(tag)
|
|
||||||
case 'declaration':
|
|
||||||
return tags.definition(tag)
|
|
||||||
case 'readonly':
|
|
||||||
return tags.constant(tag)
|
|
||||||
case 'static':
|
|
||||||
return tags.constant(tag)
|
|
||||||
case 'defaultLibrary':
|
|
||||||
return tags.standard(tag)
|
|
||||||
default:
|
|
||||||
console.error('Unknown token modifier:', tokenModifier)
|
|
||||||
return tag
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return tag
|
|
||||||
}
|
|
@ -1,55 +0,0 @@
|
|||||||
import { Text } from '@codemirror/state'
|
|
||||||
import { Marked } from '@ts-stack/markdown'
|
|
||||||
|
|
||||||
import type * as LSP from 'vscode-languageserver-protocol'
|
|
||||||
|
|
||||||
// takes a function and executes it after the wait time, if the function is called again before the wait time is up, the timer is reset
|
|
||||||
export function deferExecution<T>(func: (args: T) => any, wait: number) {
|
|
||||||
let timeout: ReturnType<typeof setTimeout> | null
|
|
||||||
let latestArgs: T
|
|
||||||
|
|
||||||
function later() {
|
|
||||||
timeout = null
|
|
||||||
func(latestArgs)
|
|
||||||
}
|
|
||||||
|
|
||||||
function deferred(args: T) {
|
|
||||||
latestArgs = args
|
|
||||||
if (timeout) {
|
|
||||||
clearTimeout(timeout)
|
|
||||||
}
|
|
||||||
timeout = setTimeout(later, wait)
|
|
||||||
}
|
|
||||||
|
|
||||||
return deferred
|
|
||||||
}
|
|
||||||
|
|
||||||
export function posToOffset(
|
|
||||||
doc: Text,
|
|
||||||
pos: { line: number; character: number }
|
|
||||||
): number | undefined {
|
|
||||||
if (pos.line >= doc.lines) return
|
|
||||||
const offset = doc.line(pos.line + 1).from + pos.character
|
|
||||||
if (offset > doc.length) return
|
|
||||||
return offset
|
|
||||||
}
|
|
||||||
|
|
||||||
export function offsetToPos(doc: Text, offset: number) {
|
|
||||||
const line = doc.lineAt(offset)
|
|
||||||
return {
|
|
||||||
line: line.number - 1,
|
|
||||||
character: offset - line.from,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export function formatMarkdownContents(
|
|
||||||
contents: LSP.MarkupContent | LSP.MarkedString | LSP.MarkedString[]
|
|
||||||
): string {
|
|
||||||
if (Array.isArray(contents)) {
|
|
||||||
return contents.map((c) => formatMarkdownContents(c) + '\n\n').join('')
|
|
||||||
} else if (typeof contents === 'string') {
|
|
||||||
return Marked.parse(contents)
|
|
||||||
} else {
|
|
||||||
return Marked.parse(contents.value)
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"composite": true,
|
|
||||||
"rootDir": "src",
|
|
||||||
"outDir": "dist",
|
|
||||||
"target": "esnext",
|
|
||||||
"lib": ["dom", "dom.iterable", "esnext"],
|
|
||||||
"module": "commonjs",
|
|
||||||
"esModuleInterop": true,
|
|
||||||
"forceConsistentCasingInFileNames": true,
|
|
||||||
"strict": true,
|
|
||||||
"noImplicitAny": true,
|
|
||||||
"skipLibCheck": true,
|
|
||||||
"declaration": true
|
|
||||||
},
|
|
||||||
"include": ["src", "./*.ts"],
|
|
||||||
"exclude": ["node_modules"]
|
|
||||||
}
|
|
@ -1,231 +0,0 @@
|
|||||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
||||||
# yarn lockfile v1
|
|
||||||
|
|
||||||
|
|
||||||
"@codemirror/autocomplete@^6.16.3":
|
|
||||||
version "6.16.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/@codemirror/autocomplete/-/autocomplete-6.16.3.tgz#04d5a4e4e44ccae1ba525d47db53a5479bf46338"
|
|
||||||
integrity sha512-Vl/tIeRVVUCRDuOG48lttBasNQu8usGgXQawBXI7WJAiUDSFOfzflmEsZFZo48mAvAaa4FZ/4/yLLxFtdJaKYA==
|
|
||||||
dependencies:
|
|
||||||
"@codemirror/language" "^6.0.0"
|
|
||||||
"@codemirror/state" "^6.0.0"
|
|
||||||
"@codemirror/view" "^6.17.0"
|
|
||||||
"@lezer/common" "^1.0.0"
|
|
||||||
|
|
||||||
"@codemirror/language@^6.0.0", "@codemirror/language@^6.10.2":
|
|
||||||
version "6.10.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/@codemirror/language/-/language-6.10.2.tgz#4056dc219619627ffe995832eeb09cea6060be61"
|
|
||||||
integrity sha512-kgbTYTo0Au6dCSc/TFy7fK3fpJmgHDv1sG1KNQKJXVi+xBTEeBPY/M30YXiU6mMXeH+YIDLsbrT4ZwNRdtF+SA==
|
|
||||||
dependencies:
|
|
||||||
"@codemirror/state" "^6.0.0"
|
|
||||||
"@codemirror/view" "^6.23.0"
|
|
||||||
"@lezer/common" "^1.1.0"
|
|
||||||
"@lezer/highlight" "^1.0.0"
|
|
||||||
"@lezer/lr" "^1.0.0"
|
|
||||||
style-mod "^4.0.0"
|
|
||||||
|
|
||||||
"@codemirror/state@^6.0.0", "@codemirror/state@^6.4.0", "@codemirror/state@^6.4.1":
|
|
||||||
version "6.4.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/@codemirror/state/-/state-6.4.1.tgz#da57143695c056d9a3c38705ed34136e2b68171b"
|
|
||||||
integrity sha512-QkEyUiLhsJoZkbumGZlswmAhA7CBU02Wrz7zvH4SrcifbsqwlXShVXg65f3v/ts57W3dqyamEriMhij1Z3Zz4A==
|
|
||||||
|
|
||||||
"@codemirror/view@^6.17.0", "@codemirror/view@^6.23.0":
|
|
||||||
version "6.28.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/@codemirror/view/-/view-6.28.2.tgz#026d5d2bd315aa015c1a1573b6358eeba7acd004"
|
|
||||||
integrity sha512-A3DmyVfjgPsGIjiJqM/zvODUAPQdQl3ci0ghehYNnbt5x+o76xq+dL5+mMBuysDXnI3kapgOkoeJ0sbtL/3qPw==
|
|
||||||
dependencies:
|
|
||||||
"@codemirror/state" "^6.4.0"
|
|
||||||
style-mod "^4.1.0"
|
|
||||||
w3c-keyname "^2.2.4"
|
|
||||||
|
|
||||||
"@cspotcode/source-map-support@^0.8.0":
|
|
||||||
version "0.8.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1"
|
|
||||||
integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==
|
|
||||||
dependencies:
|
|
||||||
"@jridgewell/trace-mapping" "0.3.9"
|
|
||||||
|
|
||||||
"@jridgewell/resolve-uri@^3.0.3":
|
|
||||||
version "3.1.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz#7a0ee601f60f99a20c7c7c5ff0c80388c1189bd6"
|
|
||||||
integrity sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==
|
|
||||||
|
|
||||||
"@jridgewell/sourcemap-codec@^1.4.10":
|
|
||||||
version "1.4.15"
|
|
||||||
resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32"
|
|
||||||
integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==
|
|
||||||
|
|
||||||
"@jridgewell/trace-mapping@0.3.9":
|
|
||||||
version "0.3.9"
|
|
||||||
resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9"
|
|
||||||
integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==
|
|
||||||
dependencies:
|
|
||||||
"@jridgewell/resolve-uri" "^3.0.3"
|
|
||||||
"@jridgewell/sourcemap-codec" "^1.4.10"
|
|
||||||
|
|
||||||
"@lezer/common@^1.0.0", "@lezer/common@^1.1.0":
|
|
||||||
version "1.2.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/@lezer/common/-/common-1.2.1.tgz#198b278b7869668e1bebbe687586e12a42731049"
|
|
||||||
integrity sha512-yemX0ZD2xS/73llMZIK6KplkjIjf2EvAHcinDi/TfJ9hS25G0388+ClHt6/3but0oOxinTcQHJLDXh6w1crzFQ==
|
|
||||||
|
|
||||||
"@lezer/highlight@^1.0.0", "@lezer/highlight@^1.2.0":
|
|
||||||
version "1.2.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/@lezer/highlight/-/highlight-1.2.0.tgz#e5898c3644208b4b589084089dceeea2966f7780"
|
|
||||||
integrity sha512-WrS5Mw51sGrpqjlh3d4/fOwpEV2Hd3YOkp9DBt4k8XZQcoTHZFB7sx030A6OcahF4J1nDQAa3jXlTVVYH50IFA==
|
|
||||||
dependencies:
|
|
||||||
"@lezer/common" "^1.0.0"
|
|
||||||
|
|
||||||
"@lezer/lr@^1.0.0":
|
|
||||||
version "1.4.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/@lezer/lr/-/lr-1.4.1.tgz#fe25f051880a754e820b28148d90aa2a96b8bdd2"
|
|
||||||
integrity sha512-CHsKq8DMKBf9b3yXPDIU4DbH+ZJd/sJdYOW2llbW/HudP5u0VS6Bfq1hLYfgU7uAYGFIyGGQIsSOXGPEErZiJw==
|
|
||||||
dependencies:
|
|
||||||
"@lezer/common" "^1.0.0"
|
|
||||||
|
|
||||||
"@ts-stack/markdown@^1.5.0":
|
|
||||||
version "1.5.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/@ts-stack/markdown/-/markdown-1.5.0.tgz#5dc298a20dc3dc040143c5a5948201eb6bf5419d"
|
|
||||||
integrity sha512-ntVX2Kmb2jyTdH94plJohokvDVPvp6CwXHqsa9NVZTK8cOmHDCYNW0j6thIadUVRTStJhxhfdeovLd0owqDxLw==
|
|
||||||
dependencies:
|
|
||||||
tslib "^2.3.0"
|
|
||||||
|
|
||||||
"@tsconfig/node10@^1.0.7":
|
|
||||||
version "1.0.11"
|
|
||||||
resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.11.tgz#6ee46400685f130e278128c7b38b7e031ff5b2f2"
|
|
||||||
integrity sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==
|
|
||||||
|
|
||||||
"@tsconfig/node12@^1.0.7":
|
|
||||||
version "1.0.11"
|
|
||||||
resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d"
|
|
||||||
integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==
|
|
||||||
|
|
||||||
"@tsconfig/node14@^1.0.0":
|
|
||||||
version "1.0.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1"
|
|
||||||
integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==
|
|
||||||
|
|
||||||
"@tsconfig/node16@^1.0.2":
|
|
||||||
version "1.0.4"
|
|
||||||
resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9"
|
|
||||||
integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==
|
|
||||||
|
|
||||||
"@types/node@^20.14.9":
|
|
||||||
version "20.14.9"
|
|
||||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.14.9.tgz#12e8e765ab27f8c421a1820c99f5f313a933b420"
|
|
||||||
integrity sha512-06OCtnTXtWOZBJlRApleWndH4JsRVs1pDCc8dLSQp+7PpUpX3ePdHyeNSFTeSe7FtKyQkrlPvHwJOW3SLd8Oyg==
|
|
||||||
dependencies:
|
|
||||||
undici-types "~5.26.4"
|
|
||||||
|
|
||||||
acorn-walk@^8.1.1:
|
|
||||||
version "8.3.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.3.tgz#9caeac29eefaa0c41e3d4c65137de4d6f34df43e"
|
|
||||||
integrity sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==
|
|
||||||
dependencies:
|
|
||||||
acorn "^8.11.0"
|
|
||||||
|
|
||||||
acorn@^8.11.0, acorn@^8.4.1:
|
|
||||||
version "8.12.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.12.0.tgz#1627bfa2e058148036133b8d9b51a700663c294c"
|
|
||||||
integrity sha512-RTvkC4w+KNXrM39/lWCUaG0IbRkWdCv7W/IOW9oU6SawyxulvkQy5HQPVTKxEjczcUvapcrw3cFx/60VN/NRNw==
|
|
||||||
|
|
||||||
arg@^4.1.0:
|
|
||||||
version "4.1.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089"
|
|
||||||
integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==
|
|
||||||
|
|
||||||
create-require@^1.1.0:
|
|
||||||
version "1.1.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333"
|
|
||||||
integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==
|
|
||||||
|
|
||||||
diff@^4.0.1:
|
|
||||||
version "4.0.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d"
|
|
||||||
integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==
|
|
||||||
|
|
||||||
json-rpc-2.0@^1.7.0:
|
|
||||||
version "1.7.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/json-rpc-2.0/-/json-rpc-2.0-1.7.0.tgz#840deb0bc168463e12bceb462f7fe225e793fc17"
|
|
||||||
integrity sha512-asnLgC1qD5ytP+fvBP8uL0rvj+l8P6iYICbzZ8dVxCpESffVjzA7KkYkbKCIbavs7cllwH1ZUaNtJwphdeRqpg==
|
|
||||||
|
|
||||||
make-error@^1.1.1:
|
|
||||||
version "1.3.6"
|
|
||||||
resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2"
|
|
||||||
integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==
|
|
||||||
|
|
||||||
style-mod@^4.0.0, style-mod@^4.1.0:
|
|
||||||
version "4.1.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/style-mod/-/style-mod-4.1.2.tgz#ca238a1ad4786520f7515a8539d5a63691d7bf67"
|
|
||||||
integrity sha512-wnD1HyVqpJUI2+eKZ+eo1UwghftP6yuFheBqqe+bWCotBjC2K1YnteJILRMs3SM4V/0dLEW1SC27MWP5y+mwmw==
|
|
||||||
|
|
||||||
ts-node@^10.9.2:
|
|
||||||
version "10.9.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.2.tgz#70f021c9e185bccdca820e26dc413805c101c71f"
|
|
||||||
integrity sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==
|
|
||||||
dependencies:
|
|
||||||
"@cspotcode/source-map-support" "^0.8.0"
|
|
||||||
"@tsconfig/node10" "^1.0.7"
|
|
||||||
"@tsconfig/node12" "^1.0.7"
|
|
||||||
"@tsconfig/node14" "^1.0.0"
|
|
||||||
"@tsconfig/node16" "^1.0.2"
|
|
||||||
acorn "^8.4.1"
|
|
||||||
acorn-walk "^8.1.1"
|
|
||||||
arg "^4.1.0"
|
|
||||||
create-require "^1.1.0"
|
|
||||||
diff "^4.0.1"
|
|
||||||
make-error "^1.1.1"
|
|
||||||
v8-compile-cache-lib "^3.0.1"
|
|
||||||
yn "3.1.1"
|
|
||||||
|
|
||||||
tslib@^2.3.0:
|
|
||||||
version "2.6.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.3.tgz#0438f810ad7a9edcde7a241c3d80db693c8cbfe0"
|
|
||||||
integrity sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==
|
|
||||||
|
|
||||||
typescript@^5.5.2:
|
|
||||||
version "5.5.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.5.2.tgz#c26f023cb0054e657ce04f72583ea2d85f8d0507"
|
|
||||||
integrity sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==
|
|
||||||
|
|
||||||
undici-types@~5.26.4:
|
|
||||||
version "5.26.5"
|
|
||||||
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617"
|
|
||||||
integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==
|
|
||||||
|
|
||||||
v8-compile-cache-lib@^3.0.1:
|
|
||||||
version "3.0.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf"
|
|
||||||
integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==
|
|
||||||
|
|
||||||
vscode-jsonrpc@8.2.0:
|
|
||||||
version "8.2.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz#f43dfa35fb51e763d17cd94dcca0c9458f35abf9"
|
|
||||||
integrity sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA==
|
|
||||||
|
|
||||||
vscode-languageserver-protocol@^3.17.5:
|
|
||||||
version "3.17.5"
|
|
||||||
resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz#864a8b8f390835572f4e13bd9f8313d0e3ac4bea"
|
|
||||||
integrity sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg==
|
|
||||||
dependencies:
|
|
||||||
vscode-jsonrpc "8.2.0"
|
|
||||||
vscode-languageserver-types "3.17.5"
|
|
||||||
|
|
||||||
vscode-languageserver-types@3.17.5:
|
|
||||||
version "3.17.5"
|
|
||||||
resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz#3273676f0cf2eab40b3f44d085acbb7f08a39d8a"
|
|
||||||
integrity sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==
|
|
||||||
|
|
||||||
vscode-uri@^3.0.8:
|
|
||||||
version "3.0.8"
|
|
||||||
resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.0.8.tgz#1770938d3e72588659a172d0fd4642780083ff9f"
|
|
||||||
integrity sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==
|
|
||||||
|
|
||||||
w3c-keyname@^2.2.4:
|
|
||||||
version "2.2.8"
|
|
||||||
resolved "https://registry.yarnpkg.com/w3c-keyname/-/w3c-keyname-2.2.8.tgz#7b17c8c6883d4e8b86ac8aba79d39e880f8869c5"
|
|
||||||
integrity sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==
|
|
||||||
|
|
||||||
yn@3.1.1:
|
|
||||||
version "3.1.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50"
|
|
||||||
integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==
|
|
@ -15,8 +15,8 @@ export default defineConfig({
|
|||||||
fullyParallel: true,
|
fullyParallel: true,
|
||||||
/* Fail the build on CI if you accidentally left test.only in the source code. */
|
/* Fail the build on CI if you accidentally left test.only in the source code. */
|
||||||
forbidOnly: !!process.env.CI,
|
forbidOnly: !!process.env.CI,
|
||||||
/* Do not retry */
|
/* Retry on CI only */
|
||||||
retries: process.env.CI ? 0 : 0,
|
retries: process.env.CI ? 3 : 0,
|
||||||
/* Different amount of parallelism on CI and local. */
|
/* Different amount of parallelism on CI and local. */
|
||||||
workers: process.env.CI ? 4 : 4,
|
workers: process.env.CI ? 4 : 4,
|
||||||
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
|
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
plugins: {
|
plugins: {
|
||||||
tailwindcss: {},
|
tailwindcss: {},
|
||||||
'@csstools/postcss-oklab-function': { preserve: true },
|
|
||||||
autoprefixer: {},
|
autoprefixer: {},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
549
src-tauri/Cargo.lock
generated
@ -11,27 +11,27 @@ rust-version = "1.70"
|
|||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
tauri-build = { version = "2.0.0-beta.18", features = [] }
|
tauri-build = { version = "2.0.0-beta.13", features = [] }
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1"
|
anyhow = "1"
|
||||||
kcl-lib = { version = "0.1.53", path = "../src/wasm-lib/kcl" }
|
kcl-lib = { version = "0.1.53", path = "../src/wasm-lib/kcl" }
|
||||||
kittycad = "0.3.7"
|
kittycad = "0.3.5"
|
||||||
log = "0.4.21"
|
log = "0.4.21"
|
||||||
oauth2 = "4.4.2"
|
oauth2 = "4.4.2"
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
tauri = { version = "2.0.0-beta.23", features = [ "devtools", "unstable"] }
|
tauri = { version = "2.0.0-beta.15", features = [ "devtools", "unstable"] }
|
||||||
tauri-plugin-cli = { version = "2.0.0-beta.7" }
|
tauri-plugin-cli = { version = "2.0.0-beta.3" }
|
||||||
tauri-plugin-deep-link = { version = "2.0.0-beta.8" }
|
tauri-plugin-deep-link = { version = "2.0.0-beta.3" }
|
||||||
tauri-plugin-dialog = { version = "2.0.0-beta.6" }
|
tauri-plugin-dialog = { version = "2.0.0-beta.6" }
|
||||||
tauri-plugin-fs = { version = "2.0.0-beta.10" }
|
tauri-plugin-fs = { version = "2.0.0-beta.6" }
|
||||||
tauri-plugin-http = { version = "2.0.0-beta.11" }
|
tauri-plugin-http = { version = "2.0.0-beta.6" }
|
||||||
tauri-plugin-log = { version = "2.0.0-beta.7" }
|
tauri-plugin-log = { version = "2.0.0-beta.4" }
|
||||||
tauri-plugin-os = { version = "2.0.0-beta.7" }
|
tauri-plugin-os = { version = "2.0.0-beta.2" }
|
||||||
tauri-plugin-persisted-scope = { version = "2.0.0-beta.10" }
|
tauri-plugin-persisted-scope = { version = "2.0.0-beta.7" }
|
||||||
tauri-plugin-process = { version = "2.0.0-beta.7" }
|
tauri-plugin-process = { version = "2.0.0-beta.2" }
|
||||||
tauri-plugin-shell = { version = "2.0.0-beta.8" }
|
tauri-plugin-shell = { version = "2.0.0-beta.2" }
|
||||||
tauri-plugin-updater = { version = "2.0.0-beta.9" }
|
tauri-plugin-updater = { version = "2.0.0-beta.4" }
|
||||||
tokio = { version = "1.37.0", features = ["time", "fs", "process"] }
|
tokio = { version = "1.37.0", features = ["time", "fs", "process"] }
|
||||||
toml = "0.8.2"
|
toml = "0.8.2"
|
||||||
url = "2.5.0"
|
url = "2.5.0"
|
||||||
|
@ -63,22 +63,16 @@
|
|||||||
"subcommands": {}
|
"subcommands": {}
|
||||||
},
|
},
|
||||||
"deep-link": {
|
"deep-link": {
|
||||||
"mobile": [
|
"domains": [
|
||||||
{
|
{
|
||||||
"host": "app.zoo.dev"
|
"host": "app.zoo.dev"
|
||||||
}
|
}
|
||||||
],
|
|
||||||
"desktop": {
|
|
||||||
"schemes": [
|
|
||||||
"zoo",
|
|
||||||
"zoo-modeling-app"
|
|
||||||
]
|
]
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"shell": {
|
"shell": {
|
||||||
"open": true
|
"open": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"productName": "Zoo Modeling App",
|
"productName": "Zoo Modeling App",
|
||||||
"version": "0.23.1"
|
"version": "0.22.6"
|
||||||
}
|
}
|
||||||
|
30
src/App.tsx
@ -1,5 +1,6 @@
|
|||||||
import { MouseEventHandler, useEffect, useMemo, useRef } from 'react'
|
import { MouseEventHandler, useEffect, useRef } from 'react'
|
||||||
import { uuidv4 } from 'lib/utils'
|
import { uuidv4 } from 'lib/utils'
|
||||||
|
import { useStore } from './useStore'
|
||||||
import { useHotKeyListener } from './hooks/useHotKeyListener'
|
import { useHotKeyListener } from './hooks/useHotKeyListener'
|
||||||
import { Stream } from './components/Stream'
|
import { Stream } from './components/Stream'
|
||||||
import { EngineCommand } from './lang/std/engineConnection'
|
import { EngineCommand } from './lang/std/engineConnection'
|
||||||
@ -25,7 +26,6 @@ import ModalContainer from 'react-modal-promise'
|
|||||||
import useHotkeyWrapper from 'lib/hotkeyWrapper'
|
import useHotkeyWrapper from 'lib/hotkeyWrapper'
|
||||||
import Gizmo from 'components/Gizmo'
|
import Gizmo from 'components/Gizmo'
|
||||||
import { CoreDumpManager } from 'lib/coredump'
|
import { CoreDumpManager } from 'lib/coredump'
|
||||||
import { UnitsMenu } from 'components/UnitsMenu'
|
|
||||||
|
|
||||||
export function App() {
|
export function App() {
|
||||||
useRefreshSettings(paths.FILE + 'SETTINGS')
|
useRefreshSettings(paths.FILE + 'SETTINGS')
|
||||||
@ -44,15 +44,22 @@ export function App() {
|
|||||||
}, [projectName, projectPath])
|
}, [projectName, projectPath])
|
||||||
|
|
||||||
useHotKeyListener()
|
useHotKeyListener()
|
||||||
const { context } = useModelingContext()
|
const { buttonDownInStream, didDragInStream, streamDimensions, setHtmlRef } =
|
||||||
|
useStore((s) => ({
|
||||||
|
buttonDownInStream: s.buttonDownInStream,
|
||||||
|
didDragInStream: s.didDragInStream,
|
||||||
|
streamDimensions: s.streamDimensions,
|
||||||
|
setHtmlRef: s.setHtmlRef,
|
||||||
|
}))
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setHtmlRef(ref)
|
||||||
|
}, [ref])
|
||||||
|
|
||||||
const { auth, settings } = useSettingsAuthContext()
|
const { auth, settings } = useSettingsAuthContext()
|
||||||
const token = auth?.context?.token
|
const token = auth?.context?.token
|
||||||
|
|
||||||
const coreDumpManager = useMemo(
|
const coreDumpManager = new CoreDumpManager(engineCommandManager, ref, token)
|
||||||
() => new CoreDumpManager(engineCommandManager, token),
|
|
||||||
[]
|
|
||||||
)
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
app: { onboardingStatus },
|
app: { onboardingStatus },
|
||||||
@ -74,7 +81,7 @@ export function App() {
|
|||||||
(p) => p === onboardingStatus.current
|
(p) => p === onboardingStatus.current
|
||||||
)
|
)
|
||||||
? 'opacity-20'
|
? 'opacity-20'
|
||||||
: context.store?.didDragInStream
|
: didDragInStream
|
||||||
? 'opacity-40'
|
? 'opacity-40'
|
||||||
: ''
|
: ''
|
||||||
|
|
||||||
@ -92,11 +99,11 @@ export function App() {
|
|||||||
clientX: e.clientX,
|
clientX: e.clientX,
|
||||||
clientY: e.clientY,
|
clientY: e.clientY,
|
||||||
el: e.currentTarget,
|
el: e.currentTarget,
|
||||||
...context.store?.streamDimensions,
|
...streamDimensions,
|
||||||
})
|
})
|
||||||
|
|
||||||
const newCmdId = uuidv4()
|
const newCmdId = uuidv4()
|
||||||
if (context.store?.buttonDownInStream === undefined) {
|
if (buttonDownInStream === undefined) {
|
||||||
debounceSocketSend({
|
debounceSocketSend({
|
||||||
type: 'modeling_cmd_req',
|
type: 'modeling_cmd_req',
|
||||||
cmd: {
|
cmd: {
|
||||||
@ -118,7 +125,7 @@ export function App() {
|
|||||||
className={
|
className={
|
||||||
'transition-opacity transition-duration-75 ' +
|
'transition-opacity transition-duration-75 ' +
|
||||||
paneOpacity +
|
paneOpacity +
|
||||||
(context.store?.buttonDownInStream ? ' pointer-events-none' : '')
|
(buttonDownInStream ? ' pointer-events-none' : '')
|
||||||
}
|
}
|
||||||
project={{ project, file }}
|
project={{ project, file }}
|
||||||
enableMenu={true}
|
enableMenu={true}
|
||||||
@ -128,7 +135,6 @@ export function App() {
|
|||||||
<Stream />
|
<Stream />
|
||||||
{/* <CamToggle /> */}
|
{/* <CamToggle /> */}
|
||||||
<LowerRightControls coreDumpManager={coreDumpManager}>
|
<LowerRightControls coreDumpManager={coreDumpManager}>
|
||||||
<UnitsMenu />
|
|
||||||
<Gizmo />
|
<Gizmo />
|
||||||
</LowerRightControls>
|
</LowerRightControls>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,41 +0,0 @@
|
|||||||
import { createContext, useContext, useState, ReactNode } from 'react'
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
This is for a very small handful of global state we need that doesn't fit into
|
|
||||||
any of the Xstate machines.
|
|
||||||
Please do not fill this up with junk.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
interface AppState {
|
|
||||||
isStreamReady: boolean
|
|
||||||
setAppState: (newAppState: Partial<AppState>) => void
|
|
||||||
}
|
|
||||||
|
|
||||||
const AppStateContext = createContext<AppState>({
|
|
||||||
isStreamReady: false,
|
|
||||||
setAppState: () => {},
|
|
||||||
})
|
|
||||||
|
|
||||||
export const useAppState = () => useContext(AppStateContext)
|
|
||||||
|
|
||||||
export const AppStateProvider = ({ children }: { children: ReactNode }) => {
|
|
||||||
const [appState, _setAppState] = useState<AppState>({
|
|
||||||
isStreamReady: false,
|
|
||||||
setAppState: () => {},
|
|
||||||
})
|
|
||||||
const setAppState = (newAppState: Partial<AppState>) =>
|
|
||||||
_setAppState({ ...appState, ...newAppState })
|
|
||||||
|
|
||||||
return (
|
|
||||||
<AppStateContext.Provider
|
|
||||||
value={{
|
|
||||||
isStreamReady: appState.isStreamReady,
|
|
||||||
setAppState,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{children}
|
|
||||||
</AppStateContext.Provider>
|
|
||||||
)
|
|
||||||
}
|
|
@ -33,14 +33,6 @@ import LspProvider from 'components/LspProvider'
|
|||||||
import { KclContextProvider } from 'lang/KclProvider'
|
import { KclContextProvider } from 'lang/KclProvider'
|
||||||
import { BROWSER_PROJECT_NAME } from 'lib/constants'
|
import { BROWSER_PROJECT_NAME } from 'lib/constants'
|
||||||
import { getState, setState } from 'lib/tauri'
|
import { getState, setState } from 'lib/tauri'
|
||||||
import { CoreDumpManager } from 'lib/coredump'
|
|
||||||
import { engineCommandManager } from 'lib/singletons'
|
|
||||||
import { useSettingsAuthContext } from 'hooks/useSettingsAuthContext'
|
|
||||||
import useHotkeyWrapper from 'lib/hotkeyWrapper'
|
|
||||||
import toast from 'react-hot-toast'
|
|
||||||
import { coreDump } from 'lang/wasm'
|
|
||||||
import { useMemo } from 'react'
|
|
||||||
import { AppStateProvider } from 'AppState'
|
|
||||||
|
|
||||||
const router = createBrowserRouter([
|
const router = createBrowserRouter([
|
||||||
{
|
{
|
||||||
@ -53,9 +45,7 @@ const router = createBrowserRouter([
|
|||||||
<SettingsAuthProvider>
|
<SettingsAuthProvider>
|
||||||
<LspProvider>
|
<LspProvider>
|
||||||
<KclContextProvider>
|
<KclContextProvider>
|
||||||
<AppStateProvider>
|
|
||||||
<Outlet />
|
<Outlet />
|
||||||
</AppStateProvider>
|
|
||||||
</KclContextProvider>
|
</KclContextProvider>
|
||||||
</LspProvider>
|
</LspProvider>
|
||||||
</SettingsAuthProvider>
|
</SettingsAuthProvider>
|
||||||
@ -97,7 +87,6 @@ const router = createBrowserRouter([
|
|||||||
<Auth>
|
<Auth>
|
||||||
<FileMachineProvider>
|
<FileMachineProvider>
|
||||||
<ModelingMachineProvider>
|
<ModelingMachineProvider>
|
||||||
<CoreDump />
|
|
||||||
<Outlet />
|
<Outlet />
|
||||||
<App />
|
<App />
|
||||||
<CommandBar />
|
<CommandBar />
|
||||||
@ -176,30 +165,3 @@ export const Router = () => {
|
|||||||
</NetworkContext.Provider>
|
</NetworkContext.Provider>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function CoreDump() {
|
|
||||||
const { auth } = useSettingsAuthContext()
|
|
||||||
const token = auth?.context?.token
|
|
||||||
const coreDumpManager = useMemo(
|
|
||||||
() => new CoreDumpManager(engineCommandManager, token),
|
|
||||||
[]
|
|
||||||
)
|
|
||||||
useHotkeyWrapper(['meta + shift + .'], () => {
|
|
||||||
toast.promise(
|
|
||||||
coreDump(coreDumpManager, true),
|
|
||||||
{
|
|
||||||
loading: 'Starting core dump...',
|
|
||||||
success: 'Core dump completed successfully',
|
|
||||||
error: 'Error while exporting core dump',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
success: {
|
|
||||||
// Note: this extended duration is especially important for Playwright e2e testing
|
|
||||||
// default duration is 2000 - https://react-hot-toast.com/docs/toast#default-durations
|
|
||||||
duration: 6000,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
)
|
|
||||||
})
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
@ -8,14 +8,10 @@ import { NetworkHealthState } from 'hooks/useNetworkStatus'
|
|||||||
import { ActionButton } from 'components/ActionButton'
|
import { ActionButton } from 'components/ActionButton'
|
||||||
import { isSingleCursorInPipe } from 'lang/queryAst'
|
import { isSingleCursorInPipe } from 'lang/queryAst'
|
||||||
import { useKclContext } from 'lang/KclProvider'
|
import { useKclContext } from 'lang/KclProvider'
|
||||||
|
import { useStore } from 'useStore'
|
||||||
import { ActionButtonDropdown } from 'components/ActionButtonDropdown'
|
import { ActionButtonDropdown } from 'components/ActionButtonDropdown'
|
||||||
import { useHotkeys } from 'react-hotkeys-hook'
|
import { useHotkeys } from 'react-hotkeys-hook'
|
||||||
import Tooltip from 'components/Tooltip'
|
import Tooltip from 'components/Tooltip'
|
||||||
import { useAppState } from 'AppState'
|
|
||||||
import {
|
|
||||||
canRectangleTool,
|
|
||||||
isEditingExistingSketch,
|
|
||||||
} from 'machines/modelingMachine'
|
|
||||||
|
|
||||||
export function Toolbar({
|
export function Toolbar({
|
||||||
className = '',
|
className = '',
|
||||||
@ -42,56 +38,38 @@ export function Toolbar({
|
|||||||
const toolbarButtonsRef = useRef<HTMLUListElement>(null)
|
const toolbarButtonsRef = useRef<HTMLUListElement>(null)
|
||||||
const { overallState } = useNetworkContext()
|
const { overallState } = useNetworkContext()
|
||||||
const { isExecuting } = useKclContext()
|
const { isExecuting } = useKclContext()
|
||||||
const { isStreamReady } = useAppState()
|
const { isStreamReady } = useStore((s) => ({
|
||||||
|
isStreamReady: s.isStreamReady,
|
||||||
|
}))
|
||||||
const disableAllButtons =
|
const disableAllButtons =
|
||||||
(overallState !== NetworkHealthState.Ok &&
|
(overallState !== NetworkHealthState.Ok &&
|
||||||
overallState !== NetworkHealthState.Weak) ||
|
overallState !== NetworkHealthState.Weak) ||
|
||||||
isExecuting ||
|
isExecuting ||
|
||||||
!isStreamReady
|
!isStreamReady
|
||||||
|
|
||||||
const disableLineButton =
|
|
||||||
state.matches('Sketch.Rectangle tool.Awaiting second corner') ||
|
|
||||||
disableAllButtons
|
|
||||||
useHotkeys(
|
useHotkeys(
|
||||||
'l',
|
'l',
|
||||||
() =>
|
() =>
|
||||||
state.matches('Sketch.Line tool')
|
state.matches('Sketch.Line tool')
|
||||||
? send('CancelSketch')
|
? send('CancelSketch')
|
||||||
: send({
|
: send('Equip Line tool'),
|
||||||
type: 'change tool',
|
{ enabled: !disableAllButtons, scopes: ['sketch'] }
|
||||||
data: 'line',
|
|
||||||
}),
|
|
||||||
{ enabled: !disableLineButton, scopes: ['sketch'] }
|
|
||||||
)
|
)
|
||||||
const disableTangentialArc =
|
|
||||||
(!isEditingExistingSketch(context) &&
|
|
||||||
!state.matches('Sketch.Tangential arc to')) ||
|
|
||||||
disableAllButtons
|
|
||||||
useHotkeys(
|
useHotkeys(
|
||||||
'a',
|
'a',
|
||||||
() =>
|
() =>
|
||||||
state.matches('Sketch.Tangential arc to')
|
state.matches('Sketch.Tangential arc to')
|
||||||
? send('CancelSketch')
|
? send('CancelSketch')
|
||||||
: send({
|
: send('Equip tangential arc to'),
|
||||||
type: 'change tool',
|
{ enabled: !disableAllButtons, scopes: ['sketch'] }
|
||||||
data: 'tangentialArc',
|
|
||||||
}),
|
|
||||||
{ enabled: !disableTangentialArc, scopes: ['sketch'] }
|
|
||||||
)
|
)
|
||||||
const disableRectangle =
|
|
||||||
(!canRectangleTool(context) && !state.matches('Sketch.Rectangle tool')) ||
|
|
||||||
disableAllButtons
|
|
||||||
useHotkeys(
|
useHotkeys(
|
||||||
'r',
|
'r',
|
||||||
() =>
|
() =>
|
||||||
state.matches('Sketch.Rectangle tool')
|
state.matches('Sketch.Rectangle tool')
|
||||||
? send('CancelSketch')
|
? send('CancelSketch')
|
||||||
: send({
|
: send('Equip rectangle tool'),
|
||||||
type: 'change tool',
|
{ enabled: !disableAllButtons, scopes: ['sketch'] }
|
||||||
data: 'rectangle',
|
|
||||||
}),
|
|
||||||
{ enabled: !disableRectangle, scopes: ['sketch'] }
|
|
||||||
)
|
)
|
||||||
useHotkeys(
|
useHotkeys(
|
||||||
's',
|
's',
|
||||||
@ -104,7 +82,7 @@ export function Toolbar({
|
|||||||
useHotkeys(
|
useHotkeys(
|
||||||
'esc',
|
'esc',
|
||||||
() =>
|
() =>
|
||||||
['Sketch no face', 'Sketch.SketchIdle'].some(state.matches)
|
state.matches('Sketch.SketchIdle')
|
||||||
? send('Cancel')
|
? send('Cancel')
|
||||||
: send('CancelSketch'),
|
: send('CancelSketch'),
|
||||||
{ enabled: !disableAllButtons, scopes: ['sketch'] }
|
{ enabled: !disableAllButtons, scopes: ['sketch'] }
|
||||||
@ -247,11 +225,6 @@ export function Toolbar({
|
|||||||
</ActionButton>
|
</ActionButton>
|
||||||
</li>
|
</li>
|
||||||
)}
|
)}
|
||||||
{state.matches('Sketch no face') && (
|
|
||||||
<li className="contents">
|
|
||||||
<div className="mx-2 text-sm">click plane or face to sketch on</div>
|
|
||||||
</li>
|
|
||||||
)}
|
|
||||||
{state.matches('Sketch') && !state.matches('idle') && (
|
{state.matches('Sketch') && !state.matches('idle') && (
|
||||||
<>
|
<>
|
||||||
<li className="contents" key="line-button">
|
<li className="contents" key="line-button">
|
||||||
@ -261,10 +234,7 @@ export function Toolbar({
|
|||||||
onClick={() =>
|
onClick={() =>
|
||||||
state?.matches('Sketch.Line tool')
|
state?.matches('Sketch.Line tool')
|
||||||
? send('CancelSketch')
|
? send('CancelSketch')
|
||||||
: send({
|
: send('Equip Line tool')
|
||||||
type: 'change tool',
|
|
||||||
data: 'line',
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
aria-pressed={state?.matches('Sketch.Line tool')}
|
aria-pressed={state?.matches('Sketch.Line tool')}
|
||||||
iconStart={{
|
iconStart={{
|
||||||
@ -272,7 +242,7 @@ export function Toolbar({
|
|||||||
iconClassName,
|
iconClassName,
|
||||||
bgClassName,
|
bgClassName,
|
||||||
}}
|
}}
|
||||||
disabled={disableLineButton}
|
disabled={disableAllButtons}
|
||||||
>
|
>
|
||||||
Line
|
Line
|
||||||
<Tooltip
|
<Tooltip
|
||||||
@ -291,10 +261,7 @@ export function Toolbar({
|
|||||||
onClick={() =>
|
onClick={() =>
|
||||||
state.matches('Sketch.Tangential arc to')
|
state.matches('Sketch.Tangential arc to')
|
||||||
? send('CancelSketch')
|
? send('CancelSketch')
|
||||||
: send({
|
: send('Equip tangential arc to')
|
||||||
type: 'change tool',
|
|
||||||
data: 'tangentialArc',
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
aria-pressed={state.matches('Sketch.Tangential arc to')}
|
aria-pressed={state.matches('Sketch.Tangential arc to')}
|
||||||
iconStart={{
|
iconStart={{
|
||||||
@ -302,7 +269,11 @@ export function Toolbar({
|
|||||||
iconClassName,
|
iconClassName,
|
||||||
bgClassName,
|
bgClassName,
|
||||||
}}
|
}}
|
||||||
disabled={disableTangentialArc}
|
disabled={
|
||||||
|
(!state.can('Equip tangential arc to') &&
|
||||||
|
!state.matches('Sketch.Tangential arc to')) ||
|
||||||
|
disableAllButtons
|
||||||
|
}
|
||||||
>
|
>
|
||||||
Tangential Arc
|
Tangential Arc
|
||||||
<Tooltip
|
<Tooltip
|
||||||
@ -321,10 +292,7 @@ export function Toolbar({
|
|||||||
onClick={() =>
|
onClick={() =>
|
||||||
state.matches('Sketch.Rectangle tool')
|
state.matches('Sketch.Rectangle tool')
|
||||||
? send('CancelSketch')
|
? send('CancelSketch')
|
||||||
: send({
|
: send('Equip rectangle tool')
|
||||||
type: 'change tool',
|
|
||||||
data: 'rectangle',
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
aria-pressed={state.matches('Sketch.Rectangle tool')}
|
aria-pressed={state.matches('Sketch.Rectangle tool')}
|
||||||
iconStart={{
|
iconStart={{
|
||||||
@ -332,9 +300,13 @@ export function Toolbar({
|
|||||||
iconClassName,
|
iconClassName,
|
||||||
bgClassName,
|
bgClassName,
|
||||||
}}
|
}}
|
||||||
disabled={disableRectangle}
|
disabled={
|
||||||
|
(!state.can('Equip rectangle tool') &&
|
||||||
|
!state.matches('Sketch.Rectangle tool')) ||
|
||||||
|
disableAllButtons
|
||||||
|
}
|
||||||
title={
|
title={
|
||||||
canRectangleTool(context)
|
state.can('Equip rectangle tool')
|
||||||
? 'Rectangle'
|
? 'Rectangle'
|
||||||
: 'Can only be used when a sketch is empty currently'
|
: 'Can only be used when a sketch is empty currently'
|
||||||
}
|
}
|
||||||
|