Skip to content

Commit 69a0450

Browse files
committed
Relocate panel hooks to the parent hooks directory and update imports
- move hooks from `apps/editor/src/views/panel/frontend/hooks/panel` to `apps/editor/src/views/panel/frontend/hooks` (flatten)
1 parent a4b95fa commit 69a0450

8 files changed

Lines changed: 27 additions & 24 deletions

File tree

‎apps/editor/src/views/panel/frontend/Panel.tsx‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { ProgressModal as UiProgressModal } from '@ui/components/editor/panel/mo
1515
import { ApiManagerModal as UiApiManagerModal } from '@ui/components/editor/panel/modals/ApiManagerModal'
1616
import { QRCodeModal as UiQRCodeModal } from '@ui/components/editor/panel/modals/QRCodeModal'
1717
import { AutoClosingModal as UiAutoClosingModal } from '@ui/components/editor/panel/modals/AutoClosingModal'
18-
import { use_panel } from './hooks/panel/use-panel'
18+
import { use_panel } from './hooks/use-panel'
1919
import { LayoutContext } from './contexts/LayoutContext'
2020
import { ResponseHistoryItem } from '@shared/types/response-history-item'
2121
import { Layout } from './components/Layout/Layout'
@@ -25,11 +25,11 @@ import { use_recent_donations } from './hooks/recent-donations'
2525
import { RecentDonationsFooter } from './components/recent-donations/RecentDonationsFooter'
2626
import { IconButton as UiIconButton } from '@ui/components/editor/common/IconButton'
2727
import { use_modal_manager } from './hooks/use-modal-manager'
28-
import { use_response_history } from './hooks/panel/use-response-history'
29-
import { use_preview_manager } from './hooks/panel/use-preview-manager'
30-
import { use_editor_sync } from './hooks/panel/use-editor-sync'
31-
import { use_web_configuration_editing } from './hooks/panel/use-web-configuration-editing'
32-
import { use_api_configuration_editing } from './hooks/panel/use-api-configuration-editing'
28+
import { use_response_history } from './hooks/use-response-history'
29+
import { use_preview_manager } from './hooks/use-preview-manager'
30+
import { use_editor_sync } from './hooks/use-editor-sync'
31+
import { use_web_configuration_editing } from './hooks/use-web-configuration-editing'
32+
import { use_api_configuration_editing } from './hooks/use-api-configuration-editing'
3333
import { EditApiConfigurationForm } from '@/views/shared/forms/EditApiConfigurationForm'
3434
import { use_translation } from './i18n/use-translation'
3535

apps/editor/src/views/panel/frontend/hooks/panel/use-api-configuration-editing.ts renamed to apps/editor/src/views/panel/frontend/hooks/use-api-configuration-editing.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useState, useEffect } from 'react'
2-
import { ApiConfiguration, BackendMessage } from '../../../types/messages'
3-
import { post_message } from '../../utils/post-message'
2+
import { ApiConfiguration, BackendMessage } from '../../types/messages'
3+
import { post_message } from '../utils/post-message'
44
import { ApiFeature } from '@/views/shared/types/api-features'
55

66
export const use_api_configuration_editing = (vscode: any) => {

apps/editor/src/views/panel/frontend/hooks/panel/use-editor-sync.ts renamed to apps/editor/src/views/panel/frontend/hooks/use-editor-sync.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import {
33
BackendMessage,
44
FrontendMessage,
55
SelectionState
6-
} from '../../../types/messages'
7-
import { post_message } from '../../utils/post-message'
6+
} from '../../types/messages'
7+
import { post_message } from '../utils/post-message'
88

99
export const use_editor_sync = (vscode: any) => {
1010
const [currently_open_file_path, set_currently_open_file_path] = useState<

apps/editor/src/views/panel/frontend/hooks/panel/use-instructions.ts renamed to apps/editor/src/views/panel/frontend/hooks/use-instructions.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useState, useEffect } from 'react'
2-
import { BackendMessage, InstructionsState } from '../../../types/messages'
3-
import { post_message } from '../../utils/post-message'
4-
import { Mode, MODE } from '../../../types/main-view-mode'
2+
import { BackendMessage, InstructionsState } from '../../types/messages'
3+
import { post_message } from '../utils/post-message'
4+
import { Mode, MODE } from '../../types/main-view-mode'
55
import { WebPromptType, ApiPromptType } from '@shared/types/prompt-types'
66

77
export const use_instructions = (

apps/editor/src/views/panel/frontend/hooks/panel/use-panel.ts renamed to apps/editor/src/views/panel/frontend/hooks/use-panel.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import {
33
BackendMessage,
44
FrontendMessage,
55
SetupProgress
6-
} from '../../../types/messages'
7-
import { Mode, MODE } from '../../../types/main-view-mode'
6+
} from '../../types/messages'
7+
import { Mode, MODE } from '../../types/main-view-mode'
88
import { ApiPromptType, WebPromptType } from '@shared/types/prompt-types'
9-
import { post_message } from '../../utils/post-message'
9+
import { post_message } from '../utils/post-message'
1010
import { use_instructions } from './use-instructions'
1111

1212
export const use_panel = (vscode: any) => {

apps/editor/src/views/panel/frontend/hooks/panel/use-preview-manager.ts renamed to apps/editor/src/views/panel/frontend/hooks/use-preview-manager.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useState, useEffect } from 'react'
2-
import { BackendMessage } from '../../../types/messages'
3-
import { post_message } from '../../utils/post-message'
2+
import { BackendMessage } from '../../types/messages'
3+
import { post_message } from '../utils/post-message'
44
import { RecentApiConfiguration } from '@shared/types/response-history-item'
55
import { ItemInPreview } from '@shared/types/file-in-preview'
66

@@ -9,7 +9,8 @@ export const use_preview_manager = (vscode: any) => {
99
const [raw_instructions, set_raw_instructions] = useState<string>()
1010
const [preview_item_created_at, set_preview_item_created_at] =
1111
useState<number>()
12-
const [auto_run_intelligent_update, set_auto_run_intelligent_update] = useState(false)
12+
const [auto_run_intelligent_update, set_auto_run_intelligent_update] =
13+
useState(false)
1314
const [url, set_url] = useState<string>()
1415
const [recent_api_configuration, set_recent_api_configuration] =
1516
useState<RecentApiConfiguration>()
@@ -32,7 +33,9 @@ export const use_preview_manager = (vscode: any) => {
3233
set_items_in_preview(message.items)
3334
set_raw_instructions(message.raw_instructions)
3435
set_preview_item_created_at(message.created_at)
35-
set_auto_run_intelligent_update(message.auto_run_intelligent_update ?? false)
36+
set_auto_run_intelligent_update(
37+
message.auto_run_intelligent_update ?? false
38+
)
3639
set_url(message.url)
3740
set_recent_api_configuration(message.recent_api_configuration)
3841
} else if (message.command == 'UPDATE_FILE_IN_PREVIEW') {

apps/editor/src/views/panel/frontend/hooks/panel/use-response-history.ts renamed to apps/editor/src/views/panel/frontend/hooks/use-response-history.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useState, useEffect } from 'react'
2-
import { BackendMessage } from '../../../types/messages'
2+
import { BackendMessage } from '../../types/messages'
33
import { ResponseHistoryItem } from '@shared/types/response-history-item'
4-
import { post_message } from '../../utils/post-message'
4+
import { post_message } from '../utils/post-message'
55

66
export const use_response_history = (vscode: any) => {
77
const [response_history, set_response_history] = useState<

apps/editor/src/views/panel/frontend/hooks/panel/use-web-configuration-editing.ts renamed to apps/editor/src/views/panel/frontend/hooks/use-web-configuration-editing.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useState, useEffect } from 'react'
22
import { WebConfiguration } from '@shared/types/web-configuration'
3-
import { BackendMessage } from '../../../types/messages'
4-
import { post_message } from '../../utils/post-message'
3+
import { BackendMessage } from '../../types/messages'
4+
import { post_message } from '../utils/post-message'
55

66
export const use_web_configuration_editing = (vscode: any) => {
77
const [updating_web_configuration, set_updating_web_configuration] =

0 commit comments

Comments
 (0)