Compare commits

...

4 Commits

Author SHA1 Message Date
548b45905e Cut release v0.11.3 (#1020)
cut release v0.11.3
2023-11-08 12:57:00 +11:00
141fd2f3f1 fix variables panel and others (#1021) 2023-11-08 01:27:43 +00:00
604d931962 selections fix follow up (#1019) 2023-11-07 23:10:30 +00:00
b1668410f8 Neaten up stdlib code (#1017) 2023-11-07 12:12:18 -06:00
6 changed files with 15 additions and 16 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "untitled-app", "name": "untitled-app",
"version": "0.11.2", "version": "0.11.3",
"private": true, "private": true,
"dependencies": { "dependencies": {
"@codemirror/autocomplete": "^6.10.2", "@codemirror/autocomplete": "^6.10.2",

View File

@ -8,7 +8,7 @@
}, },
"package": { "package": {
"productName": "kittycad-modeling", "productName": "kittycad-modeling",
"version": "0.11.2" "version": "0.11.3"
}, },
"tauri": { "tauri": {
"allowlist": { "allowlist": {

View File

@ -32,11 +32,10 @@ export function useEngineConnectionSubscriptions() {
const unSubClick = engineCommandManager.subscribeTo({ const unSubClick = engineCommandManager.subscribeTo({
event: 'select_with_point', event: 'select_with_point',
callback: async (engineEvent) => { callback: async (engineEvent) => {
if (!context.sketchEnginePathId) return
const event = await getEventForSelectWithPoint(engineEvent, { const event = await getEventForSelectWithPoint(engineEvent, {
sketchEnginePathId: context.sketchEnginePathId, sketchEnginePathId: context.sketchEnginePathId,
}) })
send(event) event && send(event)
}, },
}) })
return () => { return () => {

View File

@ -238,10 +238,10 @@ class KclManager {
defaultPlanes: this.defaultPlanes, defaultPlanes: this.defaultPlanes,
}) })
this.isExecuting = false this.isExecuting = false
this._logs = logs this.logs = logs
this._kclErrors = errors this.kclErrors = errors
this._programMemory = programMemory this.programMemory = programMemory
this._ast = { ...ast } this.ast = { ...ast }
if (updateCode) { if (updateCode) {
this.code = recast(ast) this.code = recast(ast)
} }

View File

@ -102,8 +102,8 @@ export async function getEventForSelectWithPoint(
Models['OkModelingCmdResponse_type'], Models['OkModelingCmdResponse_type'],
{ type: 'select_with_point' } { type: 'select_with_point' }
>, >,
{ sketchEnginePathId }: { sketchEnginePathId: string } { sketchEnginePathId }: { sketchEnginePathId?: string }
): Promise<ModelingMachineEvent> { ): Promise<ModelingMachineEvent | null> {
if (!data?.entity_id) { if (!data?.entity_id) {
return { return {
type: 'Set selection', type: 'Set selection',
@ -120,6 +120,7 @@ export async function getEventForSelectWithPoint(
}, },
} }
} }
if (!sketchEnginePathId) return null
// selected a vertex // selected a vertex
const res = await engineCommandManager.sendSceneCommand({ const res = await engineCommandManager.sendSceneCommand({
type: 'modeling_cmd_req', type: 'modeling_cmd_req',

View File

@ -31,7 +31,7 @@ pub struct StdLib {
impl StdLib { impl StdLib {
pub fn new() -> Self { pub fn new() -> Self {
let internal_fns: Vec<Box<(dyn crate::docs::StdLibFn)>> = vec![ let internal_fns: [Box<dyn crate::docs::StdLibFn>; 55] = [
Box::new(Show), Box::new(Show),
Box::new(LegLen), Box::new(LegLen),
Box::new(LegAngX), Box::new(LegAngX),
@ -88,11 +88,10 @@ impl StdLib {
Box::new(crate::std::math::Log10), Box::new(crate::std::math::Log10),
Box::new(crate::std::math::Ln), Box::new(crate::std::math::Ln),
]; ];
let fns = internal_fns
let mut fns = HashMap::new(); .into_iter()
for internal_fn in &internal_fns { .map(|internal_fn| (internal_fn.name(), internal_fn))
fns.insert(internal_fn.name().to_string(), internal_fn.clone()); .collect();
}
Self { fns } Self { fns }
} }