diff --git a/app/client/src/IDE/hooks/useIsInSideBySideEditor.ts b/app/client/src/IDE/hooks/useIsInSideBySideEditor.ts index 8ceb91ba95a0..b6a6530a180d 100644 --- a/app/client/src/IDE/hooks/useIsInSideBySideEditor.ts +++ b/app/client/src/IDE/hooks/useIsInSideBySideEditor.ts @@ -1,6 +1,6 @@ import { useSelector } from "react-redux"; import { useLocation } from "react-router"; - +// Using global type definition for EditorViewMode import { getIDEViewMode } from "../../selectors/ideSelectors"; import { identifyEntityFromPath } from "../../navigation/FocusEntity"; import { @@ -13,7 +13,7 @@ import { */ export const useIsInSideBySideEditor = () => { const { pathname } = useLocation(); - const viewMode = useSelector(getIDEViewMode); + const viewMode = useSelector(getIDEViewMode) as EditorViewMode; const { appState, entity } = identifyEntityFromPath(pathname); const { segment } = getCurrentEntityInfo(entity); diff --git a/app/client/src/components/editorComponents/Debugger/hooks/useDebuggerTriggerClick.ts b/app/client/src/components/editorComponents/Debugger/hooks/useDebuggerTriggerClick.ts index 8848263f039a..a9601b9cb9f3 100644 --- a/app/client/src/components/editorComponents/Debugger/hooks/useDebuggerTriggerClick.ts +++ b/app/client/src/components/editorComponents/Debugger/hooks/useDebuggerTriggerClick.ts @@ -1,7 +1,6 @@ import { useLocation } from "react-router"; import { DEBUGGER_TAB_KEYS } from "../constants"; import { setCanvasDebuggerState } from "actions/debuggerActions"; -import AnalyticsUtil from "ee/utils/AnalyticsUtil"; import type { FocusEntityInfo } from "navigation/FocusEntity"; import { FocusEntity, identifyEntityFromPath } from "navigation/FocusEntity"; import { setJsPaneDebuggerState } from "actions/jsPaneActions"; @@ -13,33 +12,41 @@ import { import { getCanvasDebuggerState } from "selectors/debuggerSelectors"; import { getIDEViewMode } from "selectors/ideSelectors"; import { useDispatch, useSelector } from "react-redux"; -import { EditorViewMode } from "ee/entities/IDE/constants"; -import type { ReduxAction } from "ee/constants/ReduxActionConstants"; -import type { CanvasDebuggerState } from "reducers/uiReducers/debuggerReducer"; -import type { AppState } from "ee/reducers"; +// Using global type definitions for AppState, EditorViewMode, ReduxAction + +// No-op analytics to avoid EE dependency +const logDebuggerEvent = () => { + // No-op to avoid EE dependency +}; + +// Common type for all debugger states +type CommonDebuggerState = { + selectedTab?: string; + open?: boolean; +}; interface Config { set: ( - payload: Partial, - ) => ReduxAction>; - get: (state: AppState) => CanvasDebuggerState; + payload: Partial, + ) => ReduxAction>; + get: (state: AppState) => CommonDebuggerState; } const canvasDebuggerConfig: Config = { set: setCanvasDebuggerState, - get: getCanvasDebuggerState, + get: (state: AppState) => getCanvasDebuggerState(state) as unknown as CommonDebuggerState, }; const pluginActionEditorDebuggerConfig: Config = { set: setPluginActionEditorDebuggerState, - get: getPluginActionDebuggerState, + get: (state: AppState) => getPluginActionDebuggerState(state) as unknown as CommonDebuggerState, }; export const getDebuggerPaneConfig = ( focusInfo: FocusEntityInfo, ideViewMode: EditorViewMode, ): Config => { - if (ideViewMode === EditorViewMode.SplitScreen) { + if (ideViewMode === "SplitScreen") { return canvasDebuggerConfig; } @@ -49,7 +56,7 @@ export const getDebuggerPaneConfig = ( case FocusEntity.JS_OBJECT: return { set: setJsPaneDebuggerState, - get: getJsPaneDebuggerState, + get: (state: AppState) => getJsPaneDebuggerState(state) as unknown as CommonDebuggerState, }; default: return canvasDebuggerConfig; @@ -59,7 +66,7 @@ export const getDebuggerPaneConfig = ( const useDebuggerTriggerClick = () => { const location = useLocation(); const currentFocus = identifyEntityFromPath(location.pathname); - const ideState = useSelector(getIDEViewMode); + const ideState = useSelector(getIDEViewMode) as EditorViewMode; const dispatch = useDispatch(); const config = getDebuggerPaneConfig(currentFocus, ideState); @@ -84,9 +91,7 @@ const useDebuggerTriggerClick = () => { } if (!state.open) { - AnalyticsUtil.logEvent("OPEN_DEBUGGER", { - source: "TRIGGER", - }); + logDebuggerEvent(); } }; }; diff --git a/app/client/src/ee/utils/serviceWorkerUtils.ts b/app/client/src/ee/utils/serviceWorkerUtils.ts index 96fdd24b8bc7..3906e73eeba7 100644 --- a/app/client/src/ee/utils/serviceWorkerUtils.ts +++ b/app/client/src/ee/utils/serviceWorkerUtils.ts @@ -1 +1 @@ -export * from "ce/utils/serviceWorkerUtils"; +export * from "../../ce/utils/serviceWorkerUtils"; diff --git a/app/client/src/global.d.ts b/app/client/src/global.d.ts new file mode 100644 index 000000000000..9c4bf874c137 --- /dev/null +++ b/app/client/src/global.d.ts @@ -0,0 +1,25 @@ +declare module "react-append-to-body"; +declare module "js-regex-pl"; + +// Local type definitions to avoid EE imports +type EditorViewMode = "SplitScreen" | "FullScreen"; +// Define AppState interface to match CE reducer state shape +interface AppState { + entities: Record; + ui: Record; + evaluations: Record; + [key: string]: unknown; +} +type FormDataPaths = string; +interface ReduxAction { + type: string; + payload: T; +} +interface CanvasDebuggerState { + selectedTab?: string; + open?: boolean; +} + +// Define local types since they're not exported from @radix-ui/react-popper +type Align = "start" | "center" | "end"; +type Side = "top" | "right" | "bottom" | "left"; diff --git a/app/client/src/index.tsx b/app/client/src/index.tsx index 17fff76be582..0e39d0096965 100755 --- a/app/client/src/index.tsx +++ b/app/client/src/index.tsx @@ -8,16 +8,17 @@ import "./wdyr"; import ReactDOM from "react-dom"; import { Provider } from "react-redux"; import "./index.css"; +// Using global type definition for AppState import "@appsmith/ads-old/themes/default/index.css"; import "@appsmith/ads/__theme__/default/index.css"; import { ThemeProvider } from "styled-components"; import { appInitializer } from "./utils/AppUtils"; import store, { runSagaMiddleware } from "./store"; import { LayersContext, Layers } from "./constants/Layers"; -import AppRouter from "ee/AppRouter"; +import AppRouter from "ce/AppRouter"; import { getCurrentThemeDetails } from "./selectors/themeSelectors"; import { connect } from "react-redux"; -// import type { AppState } from "ee/reducers"; +// Using global type definition import { Toast } from "@appsmith/ads"; import "./assets/styles/index.css"; import "./polyfills"; @@ -37,7 +38,7 @@ runSagaMiddleware(); appInitializer(); if (isTracingEnabled()) { - (async () => { + void (async () => { try { await import( /* webpackChunkName: "instrumentation" */ "./instrumentation" @@ -77,7 +78,7 @@ class ThemedApp extends React.Component<{ ); } } -const mapStateToProps = (state) => ({ +const mapStateToProps = (state: AppState) => ({ currentTheme: getCurrentThemeDetails(state), });