Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,5 @@ copies
TODO.md

# Synced typings
src/designer-extension-typings/
src/designer-extension-typings/
pnpm-lock.yaml
61 changes: 30 additions & 31 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"private": true,
"type": "module",
"scripts": {
"vite:dev": "vite --port 1337",
"dev": "vite build && concurrently \"webflow extension serve\" \"vite\"",
"build": "vite build && webflow extension bundle",
"sync-dev": "nodemon --watch github/copies --exec \"node github/gh-sync-dev.mjs\"",
Expand Down Expand Up @@ -43,6 +44,7 @@
"dotenv": "^16.4.5",
"fs-extra": "^11.2.0",
"prismjs": "^1.29.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-resizable": "^3.0.5",
"source-map": "^0.7.4",
Expand Down
8 changes: 6 additions & 2 deletions src/components/APIExplorer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ const APIExplorer: React.FC = () => {
: topCategory[selectedFunctionName]

if (funcToExecute) {
// Save original console before try block so it's accessible in finally
const originalConsole = { ...console }
try {
setApiOutput('')

Expand Down Expand Up @@ -235,7 +237,9 @@ const APIExplorer: React.FC = () => {
: []

const apiConsole = createAPIConsole(setApiOutput)
const originalConsole = { ...console }
;(window as any).ogConsole = (window as any).ogConsole || {
...console,
}
Object.assign(console, apiConsole)

if (typeof funcToExecute === 'function') {
Expand All @@ -247,7 +251,7 @@ const APIExplorer: React.FC = () => {
} catch (error) {
console.error('Error executing function:', error)
} finally {
Object.assign(console, console)
Object.assign(console, originalConsole)
}
}
}
Expand Down
Loading