Skip to content

Commit 0ca1641

Browse files
authored
Merge branch 'dev' into alexey/2054/button-sounds-fix
2 parents cc0ee2a + d978ee0 commit 0ca1641

File tree

6 files changed

+85
-5
lines changed

6 files changed

+85
-5
lines changed

exporter/SynthesisFusionAddin/web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"scripts": {
77
"dev": "NODE_ENV=dev vite build --watch",
88
"dev:ui": "vite --open",
9-
"build": "vite build",
9+
"build": "tsc -p tsconfig.app.json && vite build",
1010
"lint": "biome lint",
1111
"lint:fix": "biome lint --fix",
1212
"style": "biome format",

exporter/SynthesisFusionAddin/web/src/lib/joints.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const signalInfo: Record<SignalType, { bg: string; outline: string; fg: s
2828

2929
export function createJoint(fusionJoint: FusionJoint): Joint {
3030
return {
31-
entityToken: fusionJoint.entityToken,
31+
jointToken: fusionJoint.entityToken,
3232
name: fusionJoint.name,
3333
type: fusionJoint.jointType,
3434
parent: JointParentType.ROOT,

exporter/SynthesisFusionAddin/web/tsconfig.app.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"extends": "./tsconfig.json",
23
"compilerOptions": {
34
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
45
"target": "ES2022",

exporter/SynthesisFusionAddin/web/tsconfig.node.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"extends": "./tsconfig.json",
23
"compilerOptions": {
34
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
45
"target": "ES2023",
@@ -11,7 +12,7 @@
1112
"verbatimModuleSyntax": true,
1213
"moduleDetection": "force",
1314
"noEmit": true,
14-
15+
"composite": true,
1516
"strict": true,
1617
"noUnusedLocals": true,
1718
"noUnusedParameters": true,
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { Stack, Typography } from "@mui/material"
2+
import type React from "react"
3+
import { useEffect } from "react"
4+
import { useUIContext } from "@/ui/helpers/UIProviderHelpers"
5+
import type { ModalImplProps } from "@/ui/components/Modal"
6+
7+
export type ConfirmModalCustomProps = {
8+
message: string
9+
}
10+
11+
const ConfirmModal: React.FC<ModalImplProps<void, ConfirmModalCustomProps>> = ({ modal }) => {
12+
const { configureScreen } = useUIContext()
13+
14+
useEffect(() => {
15+
if (!modal) return
16+
configureScreen(
17+
modal,
18+
{
19+
title: modal.props.title ?? "Confirm",
20+
acceptText: modal.props.acceptText ?? "Confirm",
21+
cancelText: modal.props.cancelText ?? "Cancel",
22+
hideAccept: false,
23+
hideCancel: false,
24+
allowClickAway: modal.props.allowClickAway ?? true,
25+
},
26+
{}
27+
)
28+
}, [modal, configureScreen])
29+
30+
if (!modal) return null
31+
32+
const { message } = modal.props.custom
33+
34+
return (
35+
<Stack component="div" gap={1} sx={{ minWidth: 320, maxWidth: 500 }}>
36+
<Typography sx={{ userSelect: "none" }}>{message}</Typography>
37+
</Stack>
38+
)
39+
}
40+
41+
export default ConfirmModal

fission/src/ui/panels/DebugPanel.tsx

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import type { PanelImplProps } from "../components/Panel"
1717
import { useUIContext } from "../helpers/UIProviderHelpers"
1818
import PokerPanel from "./PokerPanel"
1919
import WsViewPanel from "./WsViewPanel"
20+
import ConfirmModal from "@/ui/modals/common/ConfirmModal"
2021

2122
function toggleDragMode() {
2223
const dragSystem = World.dragModeSystem
@@ -28,11 +29,11 @@ function toggleDragMode() {
2829
}
2930

3031
const DebugPanel: React.FC<PanelImplProps<void, void>> = ({ panel }) => {
31-
const { openPanel, configureScreen } = useUIContext()
32+
const { openPanel, openModal, configureScreen } = useUIContext()
3233

3334
useEffect(() => {
3435
configureScreen(panel!, { title: "Debug Tools", hideAccept: true, cancelText: "Close" }, {})
35-
}, [])
36+
}, [configureScreen, panel])
3637

3738
return (
3839
<Box
@@ -71,6 +72,42 @@ const DebugPanel: React.FC<PanelImplProps<void, void>> = ({ panel }) => {
7172
<Button onClick={() => PreferencesSystem.clearPreferences()} className="w-full">
7273
Clear Preferences
7374
</Button>
75+
<Button
76+
onClick={() => {
77+
openModal(
78+
ConfirmModal,
79+
{
80+
message:
81+
"Are you sure you want to clear all preferences and cached data? This cannot be undone.",
82+
},
83+
panel,
84+
{
85+
title: "Clear All Data",
86+
acceptText: "Clear & Reload",
87+
cancelText: "Cancel",
88+
onAccept: async () => {
89+
window.localStorage.clear()
90+
sessionStorage.clear()
91+
await navigator.storage
92+
.getDirectory()
93+
.then(async root => {
94+
for await (const key of root.keys()) {
95+
await root.removeEntry(key, { recursive: true })
96+
}
97+
})
98+
.catch(() => {
99+
console.warn("couldn't empty opfs")
100+
})
101+
window.location.reload()
102+
console.log("All data cleared")
103+
},
104+
}
105+
)
106+
}}
107+
className="w-full"
108+
>
109+
Clear All Data
110+
</Button>
74111

75112
<Label size="sm">Autodesk Platform Services</Label>
76113
<Button

0 commit comments

Comments
 (0)