From 1221954ed5a3c3da3ee59fba39f0c090417f486d Mon Sep 17 00:00:00 2001 From: Rahulcheryala Date: Mon, 1 Jun 2026 19:25:31 +0530 Subject: [PATCH 1/9] refactor: migrate constants (fetch-keys) from apps/web to @plane/constants --- .../[workspaceSlug]/(projects)/profile/[userId]/layout.tsx | 2 +- .../[workspaceSlug]/(projects)/profile/[userId]/page.tsx | 2 +- .../(detail)/[projectId]/archives/issues/(detail)/header.tsx | 2 +- .../(settings)/settings/(workspace)/integrations/page.tsx | 2 +- apps/web/app/(all)/invitations/page.tsx | 2 +- apps/web/app/(all)/onboarding/page.tsx | 2 +- apps/web/app/(all)/workspace-invitations/page.tsx | 2 +- apps/web/core/components/api-token/delete-token-modal.tsx | 2 +- .../core/components/api-token/modal/create-token-modal.tsx | 2 +- .../core/components/cycles/active-cycle/use-cycles-details.ts | 2 +- apps/web/core/components/exporter/guide.tsx | 2 +- apps/web/core/components/exporter/prev-exports.tsx | 2 +- .../core/components/integration/single-integration-card.tsx | 2 +- apps/web/core/components/integration/slack/select-channel.tsx | 2 +- .../components/profile/activity/workspace-activity-list.tsx | 2 +- apps/web/core/components/profile/overview/activity.tsx | 2 +- apps/web/core/components/project/integration-card.tsx | 2 +- .../components/project/project-settings-member-defaults.tsx | 2 +- .../components/settings/profile/content/pages/api-tokens.tsx | 2 +- apps/web/core/hooks/use-workspace-issue-properties.ts | 2 +- apps/web/core/layouts/auth-layout/project-wrapper.tsx | 2 +- apps/web/core/layouts/auth-layout/workspace-wrapper.tsx | 2 +- .../core/constants => packages/constants/src}/fetch-keys.ts | 0 packages/constants/src/index.ts | 4 ++++ 24 files changed, 26 insertions(+), 22 deletions(-) rename {apps/web/core/constants => packages/constants/src}/fetch-keys.ts (100%) diff --git a/apps/web/app/(all)/[workspaceSlug]/(projects)/profile/[userId]/layout.tsx b/apps/web/app/(all)/[workspaceSlug]/(projects)/profile/[userId]/layout.tsx index a07a9e31192f..f5e2d66632ac 100644 --- a/apps/web/app/(all)/[workspaceSlug]/(projects)/profile/[userId]/layout.tsx +++ b/apps/web/app/(all)/[workspaceSlug]/(projects)/profile/[userId]/layout.tsx @@ -15,7 +15,7 @@ import { AppHeader } from "@/components/core/app-header"; import { ContentWrapper } from "@/components/core/content-wrapper"; import { ProfileSidebar } from "@/components/profile/sidebar"; // constants -import { USER_PROFILE_PROJECT_SEGREGATION } from "@/constants/fetch-keys"; +import { USER_PROFILE_PROJECT_SEGREGATION } from "@plane/constants"; // hooks import { useUserPermissions } from "@/hooks/store/user"; import useSize from "@/hooks/use-window-size"; diff --git a/apps/web/app/(all)/[workspaceSlug]/(projects)/profile/[userId]/page.tsx b/apps/web/app/(all)/[workspaceSlug]/(projects)/profile/[userId]/page.tsx index 0fac00662594..6118a867ab1d 100644 --- a/apps/web/app/(all)/[workspaceSlug]/(projects)/profile/[userId]/page.tsx +++ b/apps/web/app/(all)/[workspaceSlug]/(projects)/profile/[userId]/page.tsx @@ -18,7 +18,7 @@ import { ProfileStateDistribution } from "@/components/profile/overview/state-di import { ProfileStats } from "@/components/profile/overview/stats"; import { ProfileWorkload } from "@/components/profile/overview/workload"; // constants -import { USER_PROFILE_DATA } from "@/constants/fetch-keys"; +import { USER_PROFILE_DATA } from "@plane/constants"; // services import { UserService } from "@/services/user.service"; import type { Route } from "./+types/page"; diff --git a/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/archives/issues/(detail)/header.tsx b/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/archives/issues/(detail)/header.tsx index e8324c2f6343..4217bae906ac 100644 --- a/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/archives/issues/(detail)/header.tsx +++ b/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/archives/issues/(detail)/header.tsx @@ -14,7 +14,7 @@ import { Breadcrumbs, Header } from "@plane/ui"; import { BreadcrumbLink } from "@/components/common/breadcrumb-link"; import { IssueDetailQuickActions } from "@/components/issues/issue-detail/issue-detail-quick-actions"; // constants -import { ISSUE_DETAILS } from "@/constants/fetch-keys"; +import { ISSUE_DETAILS } from "@plane/constants"; // hooks import { useProject } from "@/hooks/store/use-project"; // plane web diff --git a/apps/web/app/(all)/[workspaceSlug]/(settings)/settings/(workspace)/integrations/page.tsx b/apps/web/app/(all)/[workspaceSlug]/(settings)/settings/(workspace)/integrations/page.tsx index ea3208687491..1636bc8ae071 100644 --- a/apps/web/app/(all)/[workspaceSlug]/(settings)/settings/(workspace)/integrations/page.tsx +++ b/apps/web/app/(all)/[workspaceSlug]/(settings)/settings/(workspace)/integrations/page.tsx @@ -14,7 +14,7 @@ import { SingleIntegrationCard } from "@/components/integration/single-integrati import { IntegrationAndImportExportBanner } from "@/components/ui/integration-and-import-export-banner"; import { IntegrationsSettingsLoader } from "@/components/ui/loader/settings/integration"; // constants -import { APP_INTEGRATIONS } from "@/constants/fetch-keys"; +import { APP_INTEGRATIONS } from "@plane/constants"; // hooks import { useWorkspace } from "@/hooks/store/use-workspace"; import { useUserPermissions } from "@/hooks/store/user"; diff --git a/apps/web/app/(all)/invitations/page.tsx b/apps/web/app/(all)/invitations/page.tsx index dc1e45cc2d71..0da54f0a8888 100644 --- a/apps/web/app/(all)/invitations/page.tsx +++ b/apps/web/app/(all)/invitations/page.tsx @@ -24,7 +24,7 @@ import emptyInvitation from "@/app/assets/empty-state/invitation.svg?url"; // components import { EmptyState } from "@/components/common/empty-state"; import { WorkspaceLogo } from "@/components/workspace/logo"; -import { USER_WORKSPACES_LIST } from "@/constants/fetch-keys"; +import { USER_WORKSPACES_LIST } from "@plane/constants"; // hooks import { useWorkspace } from "@/hooks/store/use-workspace"; import { useUser, useUserProfile } from "@/hooks/store/user"; diff --git a/apps/web/app/(all)/onboarding/page.tsx b/apps/web/app/(all)/onboarding/page.tsx index 28e677e227bf..86ef1b1f7240 100644 --- a/apps/web/app/(all)/onboarding/page.tsx +++ b/apps/web/app/(all)/onboarding/page.tsx @@ -11,7 +11,7 @@ import useSWR from "swr"; import { LogoSpinner } from "@/components/common/logo-spinner"; import { OnboardingRoot } from "@/components/onboarding"; // constants -import { USER_WORKSPACES_LIST } from "@/constants/fetch-keys"; +import { USER_WORKSPACES_LIST } from "@plane/constants"; // helpers import { EPageTypes } from "@/helpers/authentication.helper"; // hooks diff --git a/apps/web/app/(all)/workspace-invitations/page.tsx b/apps/web/app/(all)/workspace-invitations/page.tsx index 4ab9b02eb8e2..d6267d1888cb 100644 --- a/apps/web/app/(all)/workspace-invitations/page.tsx +++ b/apps/web/app/(all)/workspace-invitations/page.tsx @@ -13,7 +13,7 @@ import { CheckIcon, CloseIcon } from "@plane/propel/icons"; import { LogoSpinner } from "@/components/common/logo-spinner"; import { EmptySpace, EmptySpaceItem } from "@/components/ui/empty-space"; // constants -import { WORKSPACE_INVITATION } from "@/constants/fetch-keys"; +import { WORKSPACE_INVITATION } from "@plane/constants"; // helpers import { EPageTypes } from "@/helpers/authentication.helper"; // hooks diff --git a/apps/web/core/components/api-token/delete-token-modal.tsx b/apps/web/core/components/api-token/delete-token-modal.tsx index d2c9d653a4b2..58a93394c1a2 100644 --- a/apps/web/core/components/api-token/delete-token-modal.tsx +++ b/apps/web/core/components/api-token/delete-token-modal.tsx @@ -14,7 +14,7 @@ import type { IApiToken } from "@plane/types"; // ui import { AlertModalCore } from "@plane/ui"; // fetch-keys -import { API_TOKENS_LIST } from "@/constants/fetch-keys"; +import { API_TOKENS_LIST } from "@plane/constants"; type Props = { isOpen: boolean; diff --git a/apps/web/core/components/api-token/modal/create-token-modal.tsx b/apps/web/core/components/api-token/modal/create-token-modal.tsx index 9ea6055daf2a..f9d4872d3f1a 100644 --- a/apps/web/core/components/api-token/modal/create-token-modal.tsx +++ b/apps/web/core/components/api-token/modal/create-token-modal.tsx @@ -13,7 +13,7 @@ import type { IApiToken } from "@plane/types"; import { EModalPosition, EModalWidth, ModalCore } from "@plane/ui"; import { renderFormattedDate, csvDownload } from "@plane/utils"; // constants -import { API_TOKENS_LIST } from "@/constants/fetch-keys"; +import { API_TOKENS_LIST } from "@plane/constants"; // local imports import { CreateApiTokenForm } from "./form"; import { GeneratedTokenDetails } from "./generated-token-details"; diff --git a/apps/web/core/components/cycles/active-cycle/use-cycles-details.ts b/apps/web/core/components/cycles/active-cycle/use-cycles-details.ts index d404520c593c..d9cd8c0c96a3 100644 --- a/apps/web/core/components/cycles/active-cycle/use-cycles-details.ts +++ b/apps/web/core/components/cycles/active-cycle/use-cycles-details.ts @@ -11,7 +11,7 @@ import useSWR from "swr"; import type { TWorkItemFilterCondition } from "@plane/shared-state"; import { EIssuesStoreType } from "@plane/types"; // constants -import { CYCLE_ISSUES_WITH_PARAMS } from "@/constants/fetch-keys"; +import { CYCLE_ISSUES_WITH_PARAMS } from "@plane/constants"; // hooks import { useCycle } from "@/hooks/store/use-cycle"; import { useIssues } from "@/hooks/store/use-issues"; diff --git a/apps/web/core/components/exporter/guide.tsx b/apps/web/core/components/exporter/guide.tsx index f6a212d90491..35aba499d340 100644 --- a/apps/web/core/components/exporter/guide.tsx +++ b/apps/web/core/components/exporter/guide.tsx @@ -9,7 +9,7 @@ import { observer } from "mobx-react"; import { useParams, useSearchParams } from "next/navigation"; import { mutate } from "swr"; // constants -import { EXPORT_SERVICES_LIST } from "@/constants/fetch-keys"; +import { EXPORT_SERVICES_LIST } from "@plane/constants"; // local imports import { ExportForm } from "./export-form"; import { PrevExports } from "./prev-exports"; diff --git a/apps/web/core/components/exporter/prev-exports.tsx b/apps/web/core/components/exporter/prev-exports.tsx index 2d747e00bdb8..2334a6c159c7 100644 --- a/apps/web/core/components/exporter/prev-exports.tsx +++ b/apps/web/core/components/exporter/prev-exports.tsx @@ -17,7 +17,7 @@ import { Table } from "@plane/ui"; // components import { ImportExportSettingsLoader } from "@/components/ui/loader/settings/import-and-export"; // constants -import { EXPORT_SERVICES_LIST } from "@/constants/fetch-keys"; +import { EXPORT_SERVICES_LIST } from "@plane/constants"; // services import { IntegrationService } from "@/services/integrations"; // local imports diff --git a/apps/web/core/components/integration/single-integration-card.tsx b/apps/web/core/components/integration/single-integration-card.tsx index d4224eb22495..c6773bb92dff 100644 --- a/apps/web/core/components/integration/single-integration-card.tsx +++ b/apps/web/core/components/integration/single-integration-card.tsx @@ -20,7 +20,7 @@ import { Loader } from "@plane/ui"; import GithubLogo from "@/app/assets/services/github.png?url"; import SlackLogo from "@/app/assets/services/slack.png?url"; // constants -import { WORKSPACE_INTEGRATIONS } from "@/constants/fetch-keys"; +import { WORKSPACE_INTEGRATIONS } from "@plane/constants"; // hooks import { useInstance } from "@/hooks/store/use-instance"; import { useUserPermissions } from "@/hooks/store/user"; diff --git a/apps/web/core/components/integration/slack/select-channel.tsx b/apps/web/core/components/integration/slack/select-channel.tsx index af38111a36e3..3838329220b8 100644 --- a/apps/web/core/components/integration/slack/select-channel.tsx +++ b/apps/web/core/components/integration/slack/select-channel.tsx @@ -13,7 +13,7 @@ import type { IWorkspaceIntegration, ISlackIntegration } from "@plane/types"; // ui import { Loader } from "@plane/ui"; // fetch-keys -import { SLACK_CHANNEL_INFO } from "@/constants/fetch-keys"; +import { SLACK_CHANNEL_INFO } from "@plane/constants"; // hooks import { useInstance } from "@/hooks/store/use-instance"; import useIntegrationPopup from "@/hooks/use-integration-popup"; diff --git a/apps/web/core/components/profile/activity/workspace-activity-list.tsx b/apps/web/core/components/profile/activity/workspace-activity-list.tsx index c1e0a32d9c33..fb90b35f3de5 100644 --- a/apps/web/core/components/profile/activity/workspace-activity-list.tsx +++ b/apps/web/core/components/profile/activity/workspace-activity-list.tsx @@ -8,7 +8,7 @@ import { useEffect } from "react"; import { useParams } from "next/navigation"; import useSWR from "swr"; // services -import { USER_PROFILE_ACTIVITY } from "@/constants/fetch-keys"; +import { USER_PROFILE_ACTIVITY } from "@plane/constants"; import { UserService } from "@/services/user.service"; // components import { ActivityList } from "./activity-list"; diff --git a/apps/web/core/components/profile/overview/activity.tsx b/apps/web/core/components/profile/overview/activity.tsx index 23bb961f770a..0b089ba5ca51 100644 --- a/apps/web/core/components/profile/overview/activity.tsx +++ b/apps/web/core/components/profile/overview/activity.tsx @@ -16,7 +16,7 @@ import { calculateTimeAgo, getFileURL } from "@plane/utils"; // components import { ActivityMessage, IssueLink } from "@/components/core/activity"; // constants -import { USER_PROFILE_ACTIVITY } from "@/constants/fetch-keys"; +import { USER_PROFILE_ACTIVITY } from "@plane/constants"; // helpers // hooks import { useUser } from "@/hooks/store/user"; diff --git a/apps/web/core/components/project/integration-card.tsx b/apps/web/core/components/project/integration-card.tsx index 79322e3faeb5..e4cd4e05341b 100644 --- a/apps/web/core/components/project/integration-card.tsx +++ b/apps/web/core/components/project/integration-card.tsx @@ -15,7 +15,7 @@ import SlackLogo from "@/app/assets/services/slack.png?url"; import { SelectChannel } from "@/components/integration/slack/select-channel"; import { SelectRepository } from "@/components/integration/github/select-repository"; // constants -import { PROJECT_GITHUB_REPOSITORY } from "@/constants/fetch-keys"; +import { PROJECT_GITHUB_REPOSITORY } from "@plane/constants"; // services import { ProjectService } from "@/services/project"; diff --git a/apps/web/core/components/project/project-settings-member-defaults.tsx b/apps/web/core/components/project/project-settings-member-defaults.tsx index e505b7beb0a7..23184e9f41b6 100644 --- a/apps/web/core/components/project/project-settings-member-defaults.tsx +++ b/apps/web/core/components/project/project-settings-member-defaults.tsx @@ -16,7 +16,7 @@ import { TOAST_TYPE, setToast } from "@plane/propel/toast"; import type { IProject, IUserLite, IWorkspace } from "@plane/types"; import { Loader, ToggleSwitch } from "@plane/ui"; // constants -import { PROJECT_DETAILS } from "@/constants/fetch-keys"; +import { PROJECT_DETAILS } from "@plane/constants"; // hooks import { useProject } from "@/hooks/store/use-project"; import { useUserPermissions } from "@/hooks/store/user"; diff --git a/apps/web/core/components/settings/profile/content/pages/api-tokens.tsx b/apps/web/core/components/settings/profile/content/pages/api-tokens.tsx index 39bd19bc9069..0d7217373a1f 100644 --- a/apps/web/core/components/settings/profile/content/pages/api-tokens.tsx +++ b/apps/web/core/components/settings/profile/content/pages/api-tokens.tsx @@ -18,7 +18,7 @@ import { ApiTokenListItem } from "@/components/api-token/token-list-item"; import { ProfileSettingsHeading } from "@/components/settings/profile/heading"; import { APITokenSettingsLoader } from "@/components/ui/loader/settings/api-token"; // constants -import { API_TOKENS_LIST } from "@/constants/fetch-keys"; +import { API_TOKENS_LIST } from "@plane/constants"; const apiTokenService = new APITokenService(); diff --git a/apps/web/core/hooks/use-workspace-issue-properties.ts b/apps/web/core/hooks/use-workspace-issue-properties.ts index 3c71503d54b5..02388da17289 100644 --- a/apps/web/core/hooks/use-workspace-issue-properties.ts +++ b/apps/web/core/hooks/use-workspace-issue-properties.ts @@ -6,7 +6,7 @@ import useSWR from "swr"; // plane web imports -import { WORKSPACE_ESTIMATES, WORKSPACE_CYCLES, WORKSPACE_LABELS, WORKSPACE_MODULES } from "@/constants/fetch-keys"; +import { WORKSPACE_ESTIMATES, WORKSPACE_CYCLES, WORKSPACE_LABELS, WORKSPACE_MODULES } from "@plane/constants"; import { useWorkspaceIssuePropertiesExtended } from "@/plane-web/hooks/use-workspace-issue-properties-extended"; // plane imports import { useProjectEstimates } from "./store/estimates"; diff --git a/apps/web/core/layouts/auth-layout/project-wrapper.tsx b/apps/web/core/layouts/auth-layout/project-wrapper.tsx index 1c4fac1b500b..1a0a441474c3 100644 --- a/apps/web/core/layouts/auth-layout/project-wrapper.tsx +++ b/apps/web/core/layouts/auth-layout/project-wrapper.tsx @@ -25,7 +25,7 @@ import { PROJECT_MODULES, PROJECT_VIEWS, PROJECT_INTAKE_STATE, -} from "@/constants/fetch-keys"; +} from "@plane/constants"; // hooks import { useProjectEstimates } from "@/hooks/store/estimates"; import { useCycle } from "@/hooks/store/use-cycle"; diff --git a/apps/web/core/layouts/auth-layout/workspace-wrapper.tsx b/apps/web/core/layouts/auth-layout/workspace-wrapper.tsx index ac8c34fb36b1..e74dfd55dbe3 100644 --- a/apps/web/core/layouts/auth-layout/workspace-wrapper.tsx +++ b/apps/web/core/layouts/auth-layout/workspace-wrapper.tsx @@ -31,7 +31,7 @@ import { WORKSPACE_STATES, WORKSPACE_SIDEBAR_PREFERENCES, WORKSPACE_PROJECT_NAVIGATION_PREFERENCES, -} from "@/constants/fetch-keys"; +} from "@plane/constants"; // hooks import { useFavorite } from "@/hooks/store/use-favorite"; import { useMember } from "@/hooks/store/use-member"; diff --git a/apps/web/core/constants/fetch-keys.ts b/packages/constants/src/fetch-keys.ts similarity index 100% rename from apps/web/core/constants/fetch-keys.ts rename to packages/constants/src/fetch-keys.ts diff --git a/packages/constants/src/index.ts b/packages/constants/src/index.ts index 822c4e770cd3..e55a3dbe23dd 100644 --- a/packages/constants/src/index.ts +++ b/packages/constants/src/index.ts @@ -7,6 +7,7 @@ export * from "./ai"; export * from "./analytics"; export * from "./auth"; +export * from "./calendar"; export * from "./chart"; export * from "./cycle"; export * from "./dashboard"; @@ -15,7 +16,9 @@ export * from "./endpoints"; export * from "./estimates"; export * from "./event-tracker"; export * from "./file"; +export * from "./fetch-keys"; export * from "./filter"; +export * from "./gantt-chart"; export * from "./graph"; export * from "./icon"; export * from "./instance"; @@ -32,6 +35,7 @@ export * from "./profile"; export * from "./project"; export * from "./rich-filters"; export * from "./settings"; +export * from "./sidebar-favorites"; export * from "./sidebar"; export * from "./spreadsheet"; export * from "./state"; From dbca2b2b62016e9e6b7a8b592006a2464b67f72c Mon Sep 17 00:00:00 2001 From: Rahulcheryala Date: Mon, 1 Jun 2026 19:26:39 +0530 Subject: [PATCH 2/9] refactor: migrate constants (ai, calenda, gaant) from apps/web to @plane/constants --- apps/web/ce/components/pages/editor/ai/menu.tsx | 2 +- .../issues/issue-layouts/calendar/calendar.tsx | 2 +- .../issues/issue-layouts/calendar/day-tile.tsx | 2 +- .../calendar/dropdowns/months-dropdown.tsx | 2 +- .../calendar/dropdowns/options-dropdown.tsx | 2 +- .../issues/issue-layouts/calendar/week-header.tsx | 2 +- apps/web/core/constants/ai.ts | 15 --------------- apps/web/core/services/ai.service.ts | 3 +-- .../store/issue/issue-details/relation.store.ts | 2 +- packages/constants/src/ai.ts | 6 ++++++ .../constants/src}/calendar.ts | 0 .../constants/src}/gantt-chart.ts | 0 12 files changed, 14 insertions(+), 24 deletions(-) delete mode 100644 apps/web/core/constants/ai.ts rename {apps/web/core/constants => packages/constants/src}/calendar.ts (100%) rename {apps/web/core/constants => packages/constants/src}/gantt-chart.ts (100%) diff --git a/apps/web/ce/components/pages/editor/ai/menu.tsx b/apps/web/ce/components/pages/editor/ai/menu.tsx index 284af138ab5e..36d417a560db 100644 --- a/apps/web/ce/components/pages/editor/ai/menu.tsx +++ b/apps/web/ce/components/pages/editor/ai/menu.tsx @@ -16,7 +16,7 @@ import { Tooltip } from "@plane/propel/tooltip"; import { cn } from "@plane/utils"; import { RichTextEditor } from "@/components/editor/rich-text"; // plane web constants -import { AI_EDITOR_TASKS, LOADING_TEXTS } from "@/constants/ai"; +import { AI_EDITOR_TASKS, LOADING_TEXTS } from "@plane/constants"; // plane web services import type { TTaskPayload } from "@/services/ai.service"; import { AIService } from "@/services/ai.service"; diff --git a/apps/web/core/components/issues/issue-layouts/calendar/calendar.tsx b/apps/web/core/components/issues/issue-layouts/calendar/calendar.tsx index 1d1ed8860393..1edd03f746d0 100644 --- a/apps/web/core/components/issues/issue-layouts/calendar/calendar.tsx +++ b/apps/web/core/components/issues/issue-layouts/calendar/calendar.tsx @@ -24,7 +24,7 @@ import { EIssuesStoreType, EIssueLayoutTypes } from "@plane/types"; import { Spinner } from "@plane/ui"; import { renderFormattedPayloadDate, cn } from "@plane/utils"; // constants -import { MONTHS_LIST } from "@/constants/calendar"; +import { MONTHS_LIST } from "@plane/constants"; // helpers // hooks import { useIssues } from "@/hooks/store/use-issues"; diff --git a/apps/web/core/components/issues/issue-layouts/calendar/day-tile.tsx b/apps/web/core/components/issues/issue-layouts/calendar/day-tile.tsx index 78a552300678..eaf99f2080b4 100644 --- a/apps/web/core/components/issues/issue-layouts/calendar/day-tile.tsx +++ b/apps/web/core/components/issues/issue-layouts/calendar/day-tile.tsx @@ -17,7 +17,7 @@ import type { TGroupedIssues, TIssue, TIssueMap, TPaginationData, ICalendarDate import { cn, renderFormattedPayloadDate } from "@plane/utils"; import { highlightIssueOnDrop } from "@/components/issues/issue-layouts/utils"; // helpers -import { MONTHS_LIST } from "@/constants/calendar"; +import { MONTHS_LIST } from "@plane/constants"; // helpers // types import type { ICycleIssuesFilter } from "@/store/issue/cycle"; diff --git a/apps/web/core/components/issues/issue-layouts/calendar/dropdowns/months-dropdown.tsx b/apps/web/core/components/issues/issue-layouts/calendar/dropdowns/months-dropdown.tsx index 9539c5dd5c20..199a54881cb9 100644 --- a/apps/web/core/components/issues/issue-layouts/calendar/dropdowns/months-dropdown.tsx +++ b/apps/web/core/components/issues/issue-layouts/calendar/dropdowns/months-dropdown.tsx @@ -13,7 +13,7 @@ import { ChevronLeftIcon, ChevronRightIcon } from "@plane/propel/icons"; // icons // constants import { getDate } from "@plane/utils"; -import { MONTHS_LIST } from "@/constants/calendar"; +import { MONTHS_LIST } from "@plane/constants"; import { useCalendarView } from "@/hooks/store/use-calendar-view"; import type { ICycleIssuesFilter } from "@/store/issue/cycle"; import type { IModuleIssuesFilter } from "@/store/issue/module"; diff --git a/apps/web/core/components/issues/issue-layouts/calendar/dropdowns/options-dropdown.tsx b/apps/web/core/components/issues/issue-layouts/calendar/dropdowns/options-dropdown.tsx index 2917da069795..89e15d136cbc 100644 --- a/apps/web/core/components/issues/issue-layouts/calendar/dropdowns/options-dropdown.tsx +++ b/apps/web/core/components/issues/issue-layouts/calendar/dropdowns/options-dropdown.tsx @@ -21,7 +21,7 @@ import type { TCalendarLayouts, TSupportedFilterForUpdate } from "@plane/types"; import { ToggleSwitch } from "@plane/ui"; // types // constants -import { CALENDAR_LAYOUTS } from "@/constants/calendar"; +import { CALENDAR_LAYOUTS } from "@plane/constants"; import { useCalendarView } from "@/hooks/store/use-calendar-view"; import useSize from "@/hooks/use-window-size"; import type { ICycleIssuesFilter } from "@/store/issue/cycle"; diff --git a/apps/web/core/components/issues/issue-layouts/calendar/week-header.tsx b/apps/web/core/components/issues/issue-layouts/calendar/week-header.tsx index bc5a3a0e6b44..bcc8b870e3a7 100644 --- a/apps/web/core/components/issues/issue-layouts/calendar/week-header.tsx +++ b/apps/web/core/components/issues/issue-layouts/calendar/week-header.tsx @@ -7,7 +7,7 @@ import { observer } from "mobx-react"; import { EStartOfTheWeek } from "@plane/types"; import { getOrderedDays } from "@plane/utils"; -import { DAYS_LIST } from "@/constants/calendar"; +import { DAYS_LIST } from "@plane/constants"; // helpers // hooks import { useUserProfile } from "@/hooks/store/user"; diff --git a/apps/web/core/constants/ai.ts b/apps/web/core/constants/ai.ts deleted file mode 100644 index 7c670e311dce..000000000000 --- a/apps/web/core/constants/ai.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Copyright (c) 2023-present Plane Software, Inc. and contributors - * SPDX-License-Identifier: AGPL-3.0-only - * See the LICENSE file for details. - */ - -export enum AI_EDITOR_TASKS { - ASK_ANYTHING = "ASK_ANYTHING", -} - -export const LOADING_TEXTS: { - [key in AI_EDITOR_TASKS]: string; -} = { - [AI_EDITOR_TASKS.ASK_ANYTHING]: "Pi is generating response", -}; diff --git a/apps/web/core/services/ai.service.ts b/apps/web/core/services/ai.service.ts index 4c7612dfe6d4..c529ca3565d4 100644 --- a/apps/web/core/services/ai.service.ts +++ b/apps/web/core/services/ai.service.ts @@ -6,8 +6,7 @@ // helpers import { API_BASE_URL } from "@plane/constants"; -// plane web constants -import type { AI_EDITOR_TASKS } from "@/constants/ai"; +import type { AI_EDITOR_TASKS } from "@plane/constants"; // services import { APIService } from "@/services/api.service"; // types diff --git a/apps/web/core/store/issue/issue-details/relation.store.ts b/apps/web/core/store/issue/issue-details/relation.store.ts index d8ac0a96c2ab..ed5824701277 100644 --- a/apps/web/core/store/issue/issue-details/relation.store.ts +++ b/apps/web/core/store/issue/issue-details/relation.store.ts @@ -11,7 +11,7 @@ import { computedFn } from "mobx-utils"; import type { TIssueRelationIdMap, TIssueRelationMap, TIssueRelation, TIssue, TIssueRelationTypes } from "@plane/types"; // components import type { TRelationObject } from "@/components/issues/issue-detail-widgets/relations"; -import { REVERSE_RELATIONS } from "@/constants/gantt-chart"; +import { REVERSE_RELATIONS } from "@plane/constants"; // services import { IssueRelationService } from "@/services/issue"; // types diff --git a/packages/constants/src/ai.ts b/packages/constants/src/ai.ts index 94c85922210a..7c670e311dce 100644 --- a/packages/constants/src/ai.ts +++ b/packages/constants/src/ai.ts @@ -7,3 +7,9 @@ export enum AI_EDITOR_TASKS { ASK_ANYTHING = "ASK_ANYTHING", } + +export const LOADING_TEXTS: { + [key in AI_EDITOR_TASKS]: string; +} = { + [AI_EDITOR_TASKS.ASK_ANYTHING]: "Pi is generating response", +}; diff --git a/apps/web/core/constants/calendar.ts b/packages/constants/src/calendar.ts similarity index 100% rename from apps/web/core/constants/calendar.ts rename to packages/constants/src/calendar.ts diff --git a/apps/web/core/constants/gantt-chart.ts b/packages/constants/src/gantt-chart.ts similarity index 100% rename from apps/web/core/constants/gantt-chart.ts rename to packages/constants/src/gantt-chart.ts From bba0ca961397cce1f8388b3b646935c003fe7030 Mon Sep 17 00:00:00 2001 From: Rahulcheryala Date: Mon, 1 Jun 2026 19:28:30 +0530 Subject: [PATCH 3/9] refactor: migrate constants (sidebar, favorites) from apps/web to @plane/constants --- ... use-additional-favorite-item-details.tsx} | 4 +- .../common/favorite-item-icon.tsx | 45 +++++++++++++++++++ .../favorite-items/common/helper.tsx | 28 +----------- .../favorites/favorite-items/common/index.ts | 1 + .../core/hooks/use-favorite-item-details.tsx | 12 ++--- .../constants/src}/sidebar-favorites.ts | 13 ------ 6 files changed, 56 insertions(+), 47 deletions(-) rename apps/web/ce/hooks/{use-additional-favorite-item-details.ts => use-additional-favorite-item-details.tsx} (81%) create mode 100644 apps/web/core/components/workspace/sidebar/favorites/favorite-items/common/favorite-item-icon.tsx rename {apps/web/core/constants => packages/constants/src}/sidebar-favorites.ts (65%) diff --git a/apps/web/ce/hooks/use-additional-favorite-item-details.ts b/apps/web/ce/hooks/use-additional-favorite-item-details.tsx similarity index 81% rename from apps/web/ce/hooks/use-additional-favorite-item-details.ts rename to apps/web/ce/hooks/use-additional-favorite-item-details.tsx index 7bf502ea1148..88203a26e2d3 100644 --- a/apps/web/ce/hooks/use-additional-favorite-item-details.ts +++ b/apps/web/ce/hooks/use-additional-favorite-item-details.tsx @@ -7,7 +7,7 @@ // plane imports import type { IFavorite } from "@plane/types"; // components -import { getFavoriteItemIcon } from "@/components/workspace/sidebar/favorites/favorite-items/common"; +import { FavoriteItemIcon } from "@/components/workspace/sidebar/favorites/favorite-items/common"; export const useAdditionalFavoriteItemDetails = () => { const getAdditionalFavoriteItemDetails = (_workspaceSlug: string, favorite: IFavorite) => { @@ -20,7 +20,7 @@ export const useAdditionalFavoriteItemDetails = () => { switch (favoriteItemEntityType) { default: itemTitle = favoriteItemName; - itemIcon = getFavoriteItemIcon(favoriteItemEntityType); + itemIcon = ; break; } return { itemIcon, itemTitle }; diff --git a/apps/web/core/components/workspace/sidebar/favorites/favorite-items/common/favorite-item-icon.tsx b/apps/web/core/components/workspace/sidebar/favorites/favorite-items/common/favorite-item-icon.tsx new file mode 100644 index 000000000000..64c3a4ae6c27 --- /dev/null +++ b/apps/web/core/components/workspace/sidebar/favorites/favorite-items/common/favorite-item-icon.tsx @@ -0,0 +1,45 @@ +/** + * Copyright (c) 2023-present Plane Software, Inc. and contributors + * SPDX-License-Identifier: AGPL-3.0-only + * See the LICENSE file for details. + */ + +import type { LucideIcon } from "lucide-react"; +// plane imports +import type { TLogoProps } from "@plane/types"; +import { CycleIcon, FavoriteFolderIcon, ModuleIcon, PageIcon, ProjectIcon, ViewsIcon } from "@plane/propel/icons"; +import type { ISvgIcons } from "@plane/propel/icons"; +import { Logo } from "@plane/propel/emoji-icon-picker"; + +const ICON_MAP: Record | LucideIcon> = { + page: PageIcon, + project: ProjectIcon, + view: ViewsIcon, + module: ModuleIcon, + cycle: CycleIcon, + folder: FavoriteFolderIcon, +}; + +type Props = { + type: string; + logo?: TLogoProps; +}; + +export const FavoriteItemIcon = ({ type, logo }: Props) => { + const Icon = ICON_MAP[type] ?? PageIcon; + + return ( + <> +
+ +
+
+ {logo?.in_use ? ( + + ) : ( + + )} +
+ + ); +}; diff --git a/apps/web/core/components/workspace/sidebar/favorites/favorite-items/common/helper.tsx b/apps/web/core/components/workspace/sidebar/favorites/favorite-items/common/helper.tsx index f7de5b92143b..ae4bb44cfa89 100644 --- a/apps/web/core/components/workspace/sidebar/favorites/favorite-items/common/helper.tsx +++ b/apps/web/core/components/workspace/sidebar/favorites/favorite-items/common/helper.tsx @@ -4,32 +4,8 @@ * See the LICENSE file for details. */ -import { Logo } from "@plane/propel/emoji-icon-picker"; -import { PageIcon } from "@plane/propel/icons"; -// plane imports -import type { IFavorite, TLogoProps } from "@plane/types"; -// components -// plane web constants -import { FAVORITE_ITEM_ICONS, FAVORITE_ITEM_LINKS } from "@/constants/sidebar-favorites"; - -export const getFavoriteItemIcon = (type: string, logo?: TLogoProps) => { - const Icon = FAVORITE_ITEM_ICONS[type] || PageIcon; - - return ( - <> -
- -
-
- {logo?.in_use ? ( - - ) : ( - - )} -
- - ); -}; +import { FAVORITE_ITEM_LINKS } from "@plane/constants"; +import type { IFavorite } from "@plane/types"; export const generateFavoriteItemLink = (workspaceSlug: string, favorite: IFavorite) => { const entityLinkDetails = FAVORITE_ITEM_LINKS[favorite.entity_type]; diff --git a/apps/web/core/components/workspace/sidebar/favorites/favorite-items/common/index.ts b/apps/web/core/components/workspace/sidebar/favorites/favorite-items/common/index.ts index c044bec246f7..4e13083a9390 100644 --- a/apps/web/core/components/workspace/sidebar/favorites/favorite-items/common/index.ts +++ b/apps/web/core/components/workspace/sidebar/favorites/favorite-items/common/index.ts @@ -5,6 +5,7 @@ */ export * from "./favorite-item-drag-handle"; +export * from "./favorite-item-icon"; export * from "./favorite-item-quick-action"; export * from "./favorite-item-wrapper"; export * from "./favorite-item-title"; diff --git a/apps/web/core/hooks/use-favorite-item-details.tsx b/apps/web/core/hooks/use-favorite-item-details.tsx index b3c9468e39bf..ef2a296a0842 100644 --- a/apps/web/core/hooks/use-favorite-item-details.tsx +++ b/apps/web/core/hooks/use-favorite-item-details.tsx @@ -9,8 +9,8 @@ import type { IFavorite } from "@plane/types"; // components import { getPageName } from "@plane/utils"; import { + FavoriteItemIcon, generateFavoriteItemLink, - getFavoriteItemIcon, } from "@/components/workspace/sidebar/favorites/favorite-items/common"; // helpers // hooks @@ -53,23 +53,23 @@ export const useFavoriteItemDetails = (workspaceSlug: string, favorite: IFavorit switch (favoriteItemEntityType) { case "project": itemTitle = currentProjectDetails?.name ?? favoriteItemName; - itemIcon = getFavoriteItemIcon("project", currentProjectDetails?.logo_props || favoriteItemLogoProps); + itemIcon = ; break; case "page": itemTitle = getPageName(pageDetail?.name ?? favoriteItemName); - itemIcon = getFavoriteItemIcon("page", pageDetail?.logo_props ?? favoriteItemLogoProps); + itemIcon = ; break; case "view": itemTitle = viewDetails?.name ?? favoriteItemName; - itemIcon = getFavoriteItemIcon("view", viewDetails?.logo_props || favoriteItemLogoProps); + itemIcon = ; break; case "cycle": itemTitle = cycleDetail?.name ?? favoriteItemName; - itemIcon = getFavoriteItemIcon("cycle"); + itemIcon = ; break; case "module": itemTitle = moduleDetail?.name ?? favoriteItemName; - itemIcon = getFavoriteItemIcon("module"); + itemIcon = ; break; default: { const additionalDetails = getAdditionalFavoriteItemDetails(workspaceSlug, favorite); diff --git a/apps/web/core/constants/sidebar-favorites.ts b/packages/constants/src/sidebar-favorites.ts similarity index 65% rename from apps/web/core/constants/sidebar-favorites.ts rename to packages/constants/src/sidebar-favorites.ts index e2935a6a5a00..af8d74074926 100644 --- a/apps/web/core/constants/sidebar-favorites.ts +++ b/packages/constants/src/sidebar-favorites.ts @@ -4,21 +4,8 @@ * See the LICENSE file for details. */ -import type { LucideIcon } from "lucide-react"; -// plane imports -import type { ISvgIcons } from "@plane/propel/icons"; -import { CycleIcon, FavoriteFolderIcon, ModuleIcon, PageIcon, ProjectIcon, ViewsIcon } from "@plane/propel/icons"; import type { IFavorite } from "@plane/types"; -export const FAVORITE_ITEM_ICONS: Record | LucideIcon> = { - page: PageIcon, - project: ProjectIcon, - view: ViewsIcon, - module: ModuleIcon, - cycle: CycleIcon, - folder: FavoriteFolderIcon, -}; - export const FAVORITE_ITEM_LINKS: { [key: string]: { itemLevel: "project" | "workspace"; From 9503c7211aad86ab42de46d45139cc9c5ff4d5cb Mon Sep 17 00:00:00 2001 From: Rahulcheryala Date: Mon, 1 Jun 2026 19:28:57 +0530 Subject: [PATCH 4/9] refactor: migrate constants (editor) from apps/web to @plane/constants --- .../editor/lite-text/lite-toolbar.tsx | 4 +- .../components/editor/lite-text/toolbar.tsx | 4 +- .../core/components/editor/pdf/document.tsx | 177 +++++++- .../editor/sticky-editor/toolbar.tsx | 4 +- .../pages/editor/toolbar/toolbar.tsx | 4 +- apps/web/core/constants/editor.ts | 403 ------------------ packages/editor/src/core/constants/common.ts | 21 +- 7 files changed, 200 insertions(+), 417 deletions(-) delete mode 100644 apps/web/core/constants/editor.ts diff --git a/apps/web/core/components/editor/lite-text/lite-toolbar.tsx b/apps/web/core/components/editor/lite-text/lite-toolbar.tsx index 99efb2f2a5ae..3245196f7757 100644 --- a/apps/web/core/components/editor/lite-text/lite-toolbar.tsx +++ b/apps/web/core/components/editor/lite-text/lite-toolbar.tsx @@ -7,8 +7,8 @@ import React from "react"; import { ArrowUp, Paperclip } from "lucide-react"; // constants -import type { ToolbarMenuItem } from "@/constants/editor"; -import { IMAGE_ITEM } from "@/constants/editor"; +import type { ToolbarMenuItem } from "@plane/editor"; +import { IMAGE_ITEM } from "@plane/editor"; type LiteToolbarProps = { onSubmit: (e: React.KeyboardEvent | React.MouseEvent) => void; diff --git a/apps/web/core/components/editor/lite-text/toolbar.tsx b/apps/web/core/components/editor/lite-text/toolbar.tsx index d23100a8d745..dc955cddedfd 100644 --- a/apps/web/core/components/editor/lite-text/toolbar.tsx +++ b/apps/web/core/components/editor/lite-text/toolbar.tsx @@ -19,8 +19,8 @@ import type { ISvgIcons } from "@plane/propel/icons"; import { Tooltip } from "@plane/propel/tooltip"; // constants import { cn } from "@plane/utils"; -import type { ToolbarMenuItem } from "@/constants/editor"; -import { TOOLBAR_ITEMS } from "@/constants/editor"; +import type { ToolbarMenuItem } from "@plane/editor"; +import { TOOLBAR_ITEMS } from "@plane/editor"; // helpers type Props = { diff --git a/apps/web/core/components/editor/pdf/document.tsx b/apps/web/core/components/editor/pdf/document.tsx index 1c439bfae148..bda85bba2fc8 100644 --- a/apps/web/core/components/editor/pdf/document.tsx +++ b/apps/web/core/components/editor/pdf/document.tsx @@ -4,8 +4,8 @@ * See the LICENSE file for details. */ -import type { PageProps } from "@react-pdf/renderer"; -import { Document, Font, Page } from "@react-pdf/renderer"; +import type { PageProps, Styles } from "@react-pdf/renderer"; +import { Document, Font, Page, StyleSheet } from "@react-pdf/renderer"; import { Html } from "react-pdf-html"; // assets import interBold from "@/app/assets/fonts/inter/bold.ttf?url"; @@ -17,8 +17,177 @@ import interSemibold from "@/app/assets/fonts/inter/semibold.ttf?url"; import interThin from "@/app/assets/fonts/inter/thin.ttf?url"; import interUltraBold from "@/app/assets/fonts/inter/ultrabold.ttf?url"; import interUltraLight from "@/app/assets/fonts/inter/ultralight.ttf?url"; -// constants -import { EDITOR_PDF_DOCUMENT_STYLESHEET } from "@/constants/editor"; +// plane imports +import { convertRemToPixel } from "@plane/utils"; + +const EDITOR_PDF_FONT_FAMILY_STYLES: Styles = { + "*:not(.courier, .courier-bold)": { fontFamily: "Inter" }, + ".courier": { fontFamily: "Courier" }, + ".courier-bold": { fontFamily: "Courier-Bold" }, +}; + +const EDITOR_PDF_TYPOGRAPHY_STYLES: Styles = { + // page title + "h1.page-title": { + fontSize: convertRemToPixel(1.6), + fontWeight: "bold", + marginTop: 0, + marginBottom: convertRemToPixel(2), + }, + // headings + "h1:not(.page-title)": { + fontSize: convertRemToPixel(1.4), + fontWeight: "semibold", + marginTop: convertRemToPixel(2), + marginBottom: convertRemToPixel(0.25), + }, + h2: { + fontSize: convertRemToPixel(1.2), + fontWeight: "semibold", + marginTop: convertRemToPixel(1.4), + marginBottom: convertRemToPixel(0.0625), + }, + h3: { + fontSize: convertRemToPixel(1.1), + fontWeight: "semibold", + marginTop: convertRemToPixel(1), + marginBottom: convertRemToPixel(0.0625), + }, + h4: { + fontSize: convertRemToPixel(1), + fontWeight: "semibold", + marginTop: convertRemToPixel(1), + marginBottom: convertRemToPixel(0.0625), + }, + h5: { + fontSize: convertRemToPixel(0.9), + fontWeight: "semibold", + marginTop: convertRemToPixel(1), + marginBottom: convertRemToPixel(0.0625), + }, + h6: { + fontSize: convertRemToPixel(0.8), + fontWeight: "semibold", + marginTop: convertRemToPixel(1), + marginBottom: convertRemToPixel(0.0625), + }, + // paragraph + "p:not(table p)": { + fontSize: convertRemToPixel(0.8), + }, + "p:not(ol p, ul p)": { + marginTop: convertRemToPixel(0.25), + marginBottom: convertRemToPixel(0.0625), + }, +}; + +const EDITOR_PDF_LIST_STYLES: Styles = { + "ul, ol": { + fontSize: convertRemToPixel(0.8), + marginHorizontal: -20, + }, + "ol p, ul p": { + marginVertical: 0, + }, + "ol li, ul li": { + marginTop: convertRemToPixel(0.45), + }, + "ul ul, ul ol, ol ol, ol ul": { + marginVertical: 0, + }, + "ul[data-type='taskList']": { + position: "relative", + }, + "div.input-checkbox": { + position: "absolute", + top: convertRemToPixel(0.15), + left: -convertRemToPixel(1.2), + height: convertRemToPixel(0.75), + width: convertRemToPixel(0.75), + borderWidth: "1.5px", + borderStyle: "solid", + borderRadius: convertRemToPixel(0.125), + }, + "div.input-checkbox:not(.checked)": { + backgroundColor: "#ffffff", + borderColor: "#171717", + }, + "div.input-checkbox.checked": { + backgroundColor: "#3f76ff", + borderColor: "#3f76ff", + }, + "ul li[data-checked='true'] p": { + color: "#a3a3a3", + }, +}; + +const EDITOR_PDF_CODE_STYLES: Styles = { + // code block + "[data-node-type='code-block']": { + marginVertical: convertRemToPixel(0.5), + padding: convertRemToPixel(1), + borderRadius: convertRemToPixel(0.5), + backgroundColor: "#f7f7f7", + fontSize: convertRemToPixel(0.7), + }, + // inline code block + "[data-node-type='inline-code-block']": { + margin: 0, + paddingVertical: convertRemToPixel(0.25 / 4 + 0.25 / 8), + paddingHorizontal: convertRemToPixel(0.375), + border: "0.5px solid #e5e5e5", + borderRadius: convertRemToPixel(0.25), + backgroundColor: "#e8e8e8", + color: "#f97316", + fontSize: convertRemToPixel(0.7), + }, +}; + +const EDITOR_PDF_DOCUMENT_STYLESHEET = StyleSheet.create({ + ...EDITOR_PDF_FONT_FAMILY_STYLES, + ...EDITOR_PDF_TYPOGRAPHY_STYLES, + ...EDITOR_PDF_LIST_STYLES, + ...EDITOR_PDF_CODE_STYLES, + // quote block + blockquote: { + borderLeft: "3px solid gray", + paddingLeft: convertRemToPixel(1), + marginTop: convertRemToPixel(0.625), + marginBottom: 0, + marginHorizontal: 0, + }, + img: { + marginVertical: 0, + borderRadius: convertRemToPixel(0.375), + }, + // divider + "div[data-type='horizontalRule']": { + marginVertical: convertRemToPixel(1), + height: 1, + width: "100%", + backgroundColor: "gray", + }, + // mention block + "[data-node-type='mention-block']": { + margin: 0, + color: "#3f76ff", + backgroundColor: "#3f76ff33", + paddingHorizontal: convertRemToPixel(0.375), + }, + // table + table: { + marginTop: convertRemToPixel(0.5), + marginBottom: convertRemToPixel(1), + marginHorizontal: 0, + }, + "table td": { + padding: convertRemToPixel(0.625), + border: "1px solid #e5e5e5", + }, + "table p": { + fontSize: convertRemToPixel(0.7), + }, +}); Font.register({ family: "Inter", diff --git a/apps/web/core/components/editor/sticky-editor/toolbar.tsx b/apps/web/core/components/editor/sticky-editor/toolbar.tsx index efd2fc1696c8..459b4d01424f 100644 --- a/apps/web/core/components/editor/sticky-editor/toolbar.tsx +++ b/apps/web/core/components/editor/sticky-editor/toolbar.tsx @@ -15,8 +15,8 @@ import { Tooltip } from "@plane/propel/tooltip"; import type { TSticky } from "@plane/types"; // constants import { cn } from "@plane/utils"; -import type { ToolbarMenuItem } from "@/constants/editor"; -import { TOOLBAR_ITEMS } from "@/constants/editor"; +import type { ToolbarMenuItem } from "@plane/editor"; +import { TOOLBAR_ITEMS } from "@plane/editor"; // helpers import { ColorPalette } from "./color-palette"; diff --git a/apps/web/core/components/pages/editor/toolbar/toolbar.tsx b/apps/web/core/components/pages/editor/toolbar/toolbar.tsx index d1c4109e133d..b2fbb4277b8a 100644 --- a/apps/web/core/components/pages/editor/toolbar/toolbar.tsx +++ b/apps/web/core/components/pages/editor/toolbar/toolbar.tsx @@ -12,8 +12,8 @@ import { Tooltip } from "@plane/propel/tooltip"; import { CustomMenu } from "@plane/ui"; import { cn } from "@plane/utils"; // constants -import type { ToolbarMenuItem } from "@/constants/editor"; -import { TOOLBAR_ITEMS, TYPOGRAPHY_ITEMS } from "@/constants/editor"; +import type { ToolbarMenuItem } from "@plane/editor"; +import { TOOLBAR_ITEMS, TYPOGRAPHY_ITEMS } from "@plane/editor"; // local imports import { ColorDropdown } from "./color-dropdown"; diff --git a/apps/web/core/constants/editor.ts b/apps/web/core/constants/editor.ts deleted file mode 100644 index 5cd8b929cdaa..000000000000 --- a/apps/web/core/constants/editor.ts +++ /dev/null @@ -1,403 +0,0 @@ -/** - * Copyright (c) 2023-present Plane Software, Inc. and contributors - * SPDX-License-Identifier: AGPL-3.0-only - * See the LICENSE file for details. - */ - -import type { Styles } from "@react-pdf/renderer"; -import { StyleSheet } from "@react-pdf/renderer"; -import type { LucideIcon } from "lucide-react"; -import { - AlignCenter, - AlignLeft, - AlignRight, - Bold, - CaseSensitive, - Code2, - Heading1, - Heading2, - Heading3, - Heading4, - Heading5, - Heading6, - Image, - Italic, - List, - ListOrdered, - ListTodo, - Strikethrough, - Table, - TextQuote, - Underline, -} from "lucide-react"; -// plane imports -import type { TCommandExtraProps, TEditorCommands, TEditorFontStyle } from "@plane/editor"; -import { MonospaceIcon, SansSerifIcon, SerifIcon } from "@plane/propel/icons"; -import { convertRemToPixel } from "@plane/utils"; - -type TEditorTypes = "lite" | "document" | "sticky"; - -// Utility type to enforce the necessary extra props or make extraProps optional -type ExtraPropsForCommand = T extends keyof TCommandExtraProps - ? TCommandExtraProps[T] - : object; // Default to empty object for commands without extra props - -export type ToolbarMenuItem = { - itemKey: T; - renderKey: string; - name: string; - icon: LucideIcon; - shortcut?: string[]; - editors: TEditorTypes[]; - extraProps?: ExtraPropsForCommand; -}; - -export const TYPOGRAPHY_ITEMS: ToolbarMenuItem<"text" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6">[] = [ - { itemKey: "text", renderKey: "text", name: "Text", icon: CaseSensitive, editors: ["document"] }, - { itemKey: "h1", renderKey: "h1", name: "Heading 1", icon: Heading1, editors: ["document"] }, - { itemKey: "h2", renderKey: "h2", name: "Heading 2", icon: Heading2, editors: ["document"] }, - { itemKey: "h3", renderKey: "h3", name: "Heading 3", icon: Heading3, editors: ["document"] }, - { itemKey: "h4", renderKey: "h4", name: "Heading 4", icon: Heading4, editors: ["document"] }, - { itemKey: "h5", renderKey: "h5", name: "Heading 5", icon: Heading5, editors: ["document"] }, - { itemKey: "h6", renderKey: "h6", name: "Heading 6", icon: Heading6, editors: ["document"] }, -]; - -export const TEXT_ALIGNMENT_ITEMS: ToolbarMenuItem<"text-align">[] = [ - { - itemKey: "text-align", - renderKey: "text-align-left", - name: "Left align", - icon: AlignLeft, - shortcut: ["Cmd", "Shift", "L"], - editors: ["lite", "document"], - extraProps: { - alignment: "left", - }, - }, - { - itemKey: "text-align", - renderKey: "text-align-center", - name: "Center align", - icon: AlignCenter, - shortcut: ["Cmd", "Shift", "E"], - editors: ["lite", "document"], - extraProps: { - alignment: "center", - }, - }, - { - itemKey: "text-align", - renderKey: "text-align-right", - name: "Right align", - icon: AlignRight, - shortcut: ["Cmd", "Shift", "R"], - editors: ["lite", "document"], - extraProps: { - alignment: "right", - }, - }, -]; - -const BASIC_MARK_ITEMS: ToolbarMenuItem<"bold" | "italic" | "underline" | "strikethrough">[] = [ - { - itemKey: "bold", - renderKey: "bold", - name: "Bold", - icon: Bold, - shortcut: ["Cmd", "B"], - editors: ["lite", "document"], - }, - { - itemKey: "italic", - renderKey: "italic", - name: "Italic", - icon: Italic, - shortcut: ["Cmd", "I"], - editors: ["lite", "document"], - }, - { - itemKey: "underline", - renderKey: "underline", - name: "Underline", - icon: Underline, - shortcut: ["Cmd", "U"], - editors: ["lite", "document"], - }, - { - itemKey: "strikethrough", - renderKey: "strikethrough", - name: "Strikethrough", - icon: Strikethrough, - shortcut: ["Cmd", "Shift", "S"], - editors: ["lite", "document"], - }, -]; - -const LIST_ITEMS: ToolbarMenuItem<"bulleted-list" | "numbered-list" | "to-do-list">[] = [ - { - itemKey: "numbered-list", - renderKey: "numbered-list", - name: "Numbered list", - icon: ListOrdered, - shortcut: ["Cmd", "Shift", "7"], - editors: ["lite", "document"], - }, - { - itemKey: "bulleted-list", - renderKey: "bulleted-list", - name: "Bulleted list", - icon: List, - shortcut: ["Cmd", "Shift", "8"], - editors: ["lite", "document"], - }, - { - itemKey: "to-do-list", - renderKey: "to-do-list", - name: "To-do list", - icon: ListTodo, - shortcut: ["Cmd", "Shift", "9"], - editors: ["lite", "document"], - }, -]; - -const USER_ACTION_ITEMS: ToolbarMenuItem<"quote" | "code">[] = [ - { itemKey: "quote", renderKey: "quote", name: "Quote", icon: TextQuote, editors: ["lite", "document"] }, - { itemKey: "code", renderKey: "code", name: "Code", icon: Code2, editors: ["lite", "document"] }, -]; - -export const IMAGE_ITEM = { - itemKey: "image", - renderKey: "image", - name: "Image", - icon: Image, - editors: ["lite", "document"], - extraProps: {}, -} as ToolbarMenuItem<"image">; - -const COMPLEX_ITEMS: ToolbarMenuItem<"table" | "image">[] = [ - { itemKey: "table", renderKey: "table", name: "Table", icon: Table, editors: ["document"] }, - IMAGE_ITEM, -]; - -export const TOOLBAR_ITEMS: { - [editorType in TEditorTypes]: { - [key: string]: ToolbarMenuItem[]; - }; -} = { - lite: { - basic: BASIC_MARK_ITEMS.filter((item) => item.editors.includes("lite")), - alignment: TEXT_ALIGNMENT_ITEMS.filter((item) => item.editors.includes("lite")), - list: LIST_ITEMS.filter((item) => item.editors.includes("lite")), - userAction: USER_ACTION_ITEMS.filter((item) => item.editors.includes("lite")), - complex: COMPLEX_ITEMS.filter((item) => item.editors.includes("lite")), - }, - document: { - basic: BASIC_MARK_ITEMS.filter((item) => item.editors.includes("document")), - alignment: TEXT_ALIGNMENT_ITEMS.filter((item) => item.editors.includes("document")), - list: LIST_ITEMS.filter((item) => item.editors.includes("document")), - userAction: USER_ACTION_ITEMS.filter((item) => item.editors.includes("document")), - complex: COMPLEX_ITEMS.filter((item) => item.editors.includes("document")), - }, - sticky: { - basic: BASIC_MARK_ITEMS.filter((item) => ["Bold", "Italic"].includes(item.name)), - list: LIST_ITEMS.filter((item) => ["To-do list"].includes(item.name)), - }, -}; - -export const EDITOR_FONT_STYLES: { - key: TEditorFontStyle; - label: string; - icon: any; -}[] = [ - { - key: "sans-serif", - label: "Sans serif", - icon: SansSerifIcon, - }, - { - key: "serif", - label: "Serif", - icon: SerifIcon, - }, - { - key: "monospace", - label: "Mono", - icon: MonospaceIcon, - }, -]; - -const EDITOR_PDF_FONT_FAMILY_STYLES: Styles = { - "*:not(.courier, .courier-bold)": { - fontFamily: "Inter", - }, - ".courier": { - fontFamily: "Courier", - }, - ".courier-bold": { - fontFamily: "Courier-Bold", - }, -}; - -const EDITOR_PDF_TYPOGRAPHY_STYLES: Styles = { - // page title - "h1.page-title": { - fontSize: convertRemToPixel(1.6), - fontWeight: "bold", - marginTop: 0, - marginBottom: convertRemToPixel(2), - }, - // headings - "h1:not(.page-title)": { - fontSize: convertRemToPixel(1.4), - fontWeight: "semibold", - marginTop: convertRemToPixel(2), - marginBottom: convertRemToPixel(0.25), - }, - h2: { - fontSize: convertRemToPixel(1.2), - fontWeight: "semibold", - marginTop: convertRemToPixel(1.4), - marginBottom: convertRemToPixel(0.0625), - }, - h3: { - fontSize: convertRemToPixel(1.1), - fontWeight: "semibold", - marginTop: convertRemToPixel(1), - marginBottom: convertRemToPixel(0.0625), - }, - h4: { - fontSize: convertRemToPixel(1), - fontWeight: "semibold", - marginTop: convertRemToPixel(1), - marginBottom: convertRemToPixel(0.0625), - }, - h5: { - fontSize: convertRemToPixel(0.9), - fontWeight: "semibold", - marginTop: convertRemToPixel(1), - marginBottom: convertRemToPixel(0.0625), - }, - h6: { - fontSize: convertRemToPixel(0.8), - fontWeight: "semibold", - marginTop: convertRemToPixel(1), - marginBottom: convertRemToPixel(0.0625), - }, - // paragraph - "p:not(table p)": { - fontSize: convertRemToPixel(0.8), - }, - "p:not(ol p, ul p)": { - marginTop: convertRemToPixel(0.25), - marginBottom: convertRemToPixel(0.0625), - }, -}; - -const EDITOR_PDF_LIST_STYLES: Styles = { - "ul, ol": { - fontSize: convertRemToPixel(0.8), - marginHorizontal: -20, - }, - "ol p, ul p": { - marginVertical: 0, - }, - "ol li, ul li": { - marginTop: convertRemToPixel(0.45), - }, - "ul ul, ul ol, ol ol, ol ul": { - marginVertical: 0, - }, - "ul[data-type='taskList']": { - position: "relative", - }, - "div.input-checkbox": { - position: "absolute", - top: convertRemToPixel(0.15), - left: -convertRemToPixel(1.2), - height: convertRemToPixel(0.75), - width: convertRemToPixel(0.75), - borderWidth: "1.5px", - borderStyle: "solid", - borderRadius: convertRemToPixel(0.125), - }, - "div.input-checkbox:not(.checked)": { - backgroundColor: "#ffffff", - borderColor: "#171717", - }, - "div.input-checkbox.checked": { - backgroundColor: "#3f76ff", - borderColor: "#3f76ff", - }, - "ul li[data-checked='true'] p": { - color: "#a3a3a3", - }, -}; - -const EDITOR_PDF_CODE_STYLES: Styles = { - // code block - "[data-node-type='code-block']": { - marginVertical: convertRemToPixel(0.5), - padding: convertRemToPixel(1), - borderRadius: convertRemToPixel(0.5), - backgroundColor: "#f7f7f7", - fontSize: convertRemToPixel(0.7), - }, - // inline code block - "[data-node-type='inline-code-block']": { - margin: 0, - paddingVertical: convertRemToPixel(0.25 / 4 + 0.25 / 8), - paddingHorizontal: convertRemToPixel(0.375), - border: "0.5px solid #e5e5e5", - borderRadius: convertRemToPixel(0.25), - backgroundColor: "#e8e8e8", - color: "#f97316", - fontSize: convertRemToPixel(0.7), - }, -}; - -export const EDITOR_PDF_DOCUMENT_STYLESHEET = StyleSheet.create({ - ...EDITOR_PDF_FONT_FAMILY_STYLES, - ...EDITOR_PDF_TYPOGRAPHY_STYLES, - ...EDITOR_PDF_LIST_STYLES, - ...EDITOR_PDF_CODE_STYLES, - // quote block - blockquote: { - borderLeft: "3px solid gray", - paddingLeft: convertRemToPixel(1), - marginTop: convertRemToPixel(0.625), - marginBottom: 0, - marginHorizontal: 0, - }, - // image - img: { - marginVertical: 0, - borderRadius: convertRemToPixel(0.375), - }, - // divider - "div[data-type='horizontalRule']": { - marginVertical: convertRemToPixel(1), - height: 1, - width: "100%", - backgroundColor: "gray", - }, - // mention block - "[data-node-type='mention-block']": { - margin: 0, - color: "#3f76ff", - backgroundColor: "#3f76ff33", - paddingHorizontal: convertRemToPixel(0.375), - }, - // table - table: { - marginTop: convertRemToPixel(0.5), - marginBottom: convertRemToPixel(1), - marginHorizontal: 0, - }, - "table td": { - padding: convertRemToPixel(0.625), - border: "1px solid #e5e5e5", - }, - "table p": { - fontSize: convertRemToPixel(0.7), - }, -}); diff --git a/packages/editor/src/core/constants/common.ts b/packages/editor/src/core/constants/common.ts index b0617ec7911b..18cf233eae97 100644 --- a/packages/editor/src/core/constants/common.ts +++ b/packages/editor/src/core/constants/common.ts @@ -28,9 +28,10 @@ import { TextQuote, Underline, } from "lucide-react"; -import type { TCommandExtraProps, TEditorCommands } from "@/types/editor"; +import { MonospaceIcon, SansSerifIcon, SerifIcon } from "@plane/propel/icons"; +import type { TCommandExtraProps, TEditorCommands, TEditorFontStyle } from "@/types"; -export type TEditorTypes = "lite" | "document"; +export type TEditorTypes = "lite" | "document" | "sticky"; // Utility type to enforce the necessary extra props or make extraProps optional export type ExtraPropsForCommand = T extends keyof TCommandExtraProps @@ -165,6 +166,8 @@ export const COMPLEX_ITEMS: ToolbarMenuItem<"table" | "image">[] = [ { itemKey: "image", renderKey: "image", name: "Image", icon: Image, editors: ["lite", "document"] }, ]; +export const IMAGE_ITEM = COMPLEX_ITEMS.find((item) => item.itemKey === "image") as ToolbarMenuItem<"image">; + export const TOOLBAR_ITEMS: { [editorType in TEditorTypes]: { [key: string]: ToolbarMenuItem[]; @@ -184,6 +187,10 @@ export const TOOLBAR_ITEMS: { userAction: USER_ACTION_ITEMS.filter((item) => item.editors.includes("document")), complex: COMPLEX_ITEMS.filter((item) => item.editors.includes("document")), }, + sticky: { + basic: BASIC_MARK_ITEMS.filter((item) => ["Bold", "Italic"].includes(item.name)), + list: LIST_ITEMS.filter((item) => ["To-do list"].includes(item.name)), + }, }; export const COLORS_LIST: { @@ -247,3 +254,13 @@ export const COLORS_LIST: { // backgroundColor: "var(--editor-colors-pink-blue-gradient-background)", // }, ]; + +export const EDITOR_FONT_STYLES: { + key: TEditorFontStyle; + label: string; + icon: React.FC; +}[] = [ + { key: "sans-serif", label: "Sans serif", icon: SansSerifIcon }, + { key: "serif", label: "Serif", icon: SerifIcon }, + { key: "monospace", label: "Mono", icon: MonospaceIcon }, +]; From 76bdd9515f6b53694dfaeecdd201c9e9e5858495 Mon Sep 17 00:00:00 2001 From: Rahulcheryala Date: Wed, 3 Jun 2026 19:06:21 +0530 Subject: [PATCH 5/9] refactor: migrate constants (plans) from apps/web to @core/components --- .../components/workspace/billing/comparison/plan-detail.tsx | 2 +- apps/web/ce/components/workspace/billing/comparison/root.tsx | 4 ++-- .../web/core/components/workspace/billing/comparison/base.tsx | 4 ++-- .../workspace/billing/comparison/feature-detail.tsx | 2 +- .../web/core/components/workspace/billing/comparison/index.ts | 1 + .../workspace/billing/comparison}/plans.tsx | 0 6 files changed, 7 insertions(+), 6 deletions(-) rename apps/web/core/{constants => components/workspace/billing/comparison}/plans.tsx (100%) diff --git a/apps/web/ce/components/workspace/billing/comparison/plan-detail.tsx b/apps/web/ce/components/workspace/billing/comparison/plan-detail.tsx index c253244c5933..27d2b8cf141b 100644 --- a/apps/web/ce/components/workspace/billing/comparison/plan-detail.tsx +++ b/apps/web/ce/components/workspace/billing/comparison/plan-detail.tsx @@ -18,7 +18,7 @@ import { EProductSubscriptionEnum } from "@plane/types"; import { getSubscriptionName } from "@plane/utils"; // components import { DiscountInfo } from "@/components/license/modal/card/discount-info"; -import type { TPlanDetail } from "@/constants/plans"; +import type { TPlanDetail } from "@/components/workspace/billing/comparison/plans"; // local imports import { PlanFrequencyToggle } from "./frequency-toggle"; diff --git a/apps/web/ce/components/workspace/billing/comparison/root.tsx b/apps/web/ce/components/workspace/billing/comparison/root.tsx index 7ff217884042..1c04554d7530 100644 --- a/apps/web/ce/components/workspace/billing/comparison/root.tsx +++ b/apps/web/ce/components/workspace/billing/comparison/root.tsx @@ -9,8 +9,8 @@ import { observer } from "mobx-react"; import type { EProductSubscriptionEnum, TBillingFrequency } from "@plane/types"; // components import { PlansComparisonBase, shouldRenderPlanDetail } from "@/components/workspace/billing/comparison/base"; -import type { TPlanePlans } from "@/constants/plans"; -import { PLANE_PLANS } from "@/constants/plans"; +import type { TPlanePlans } from "@/components/workspace/billing/comparison/plans"; +import { PLANE_PLANS } from "@/components/workspace/billing/comparison/plans"; // plane web imports import { PlanDetail } from "./plan-detail"; diff --git a/apps/web/core/components/workspace/billing/comparison/base.tsx b/apps/web/core/components/workspace/billing/comparison/base.tsx index 9d830d9a73fa..b09965a02822 100644 --- a/apps/web/core/components/workspace/billing/comparison/base.tsx +++ b/apps/web/core/components/workspace/billing/comparison/base.tsx @@ -10,8 +10,8 @@ import { ArrowDown, ArrowUp } from "lucide-react"; import { Button } from "@plane/propel/button"; import { cn } from "@plane/utils"; // constants -import type { TPlanePlans } from "@/constants/plans"; -import { ComingSoonBadge, PLANE_PLANS, PLANS_LIST } from "@/constants/plans"; +import type { TPlanePlans } from "@/components/workspace/billing/comparison/plans"; +import { ComingSoonBadge, PLANE_PLANS, PLANS_LIST } from "@/components/workspace/billing/comparison/plans"; // local imports import { PlanFeatureDetail } from "./feature-detail"; diff --git a/apps/web/core/components/workspace/billing/comparison/feature-detail.tsx b/apps/web/core/components/workspace/billing/comparison/feature-detail.tsx index b3335f3454b4..b8bcadc07fcb 100644 --- a/apps/web/core/components/workspace/billing/comparison/feature-detail.tsx +++ b/apps/web/core/components/workspace/billing/comparison/feature-detail.tsx @@ -8,7 +8,7 @@ import { CheckCircle2, Minus, MinusCircle } from "lucide-react"; import type { EProductSubscriptionEnum } from "@plane/types"; // plane imports // constants -import type { TPlanFeatureData } from "@/constants/plans"; +import type { TPlanFeatureData } from "@/components/workspace/billing/comparison/plans"; type TPlanFeatureDetailProps = { subscriptionType: EProductSubscriptionEnum; diff --git a/apps/web/core/components/workspace/billing/comparison/index.ts b/apps/web/core/components/workspace/billing/comparison/index.ts index d109057541eb..df6fd75743db 100644 --- a/apps/web/core/components/workspace/billing/comparison/index.ts +++ b/apps/web/core/components/workspace/billing/comparison/index.ts @@ -5,3 +5,4 @@ */ export * from "./base"; +export * from "./plans"; diff --git a/apps/web/core/constants/plans.tsx b/apps/web/core/components/workspace/billing/comparison/plans.tsx similarity index 100% rename from apps/web/core/constants/plans.tsx rename to apps/web/core/components/workspace/billing/comparison/plans.tsx From 315ccee369912d86ae3a1eecaa61d13a4767848f Mon Sep 17 00:00:00 2001 From: Rahulcheryala Date: Wed, 3 Jun 2026 20:08:52 +0530 Subject: [PATCH 6/9] resolved lint errors --- packages/constants/src/fetch-keys.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/constants/src/fetch-keys.ts b/packages/constants/src/fetch-keys.ts index abcbcf2bf485..e0db8181eee1 100644 --- a/packages/constants/src/fetch-keys.ts +++ b/packages/constants/src/fetch-keys.ts @@ -40,15 +40,15 @@ const paramsToKey = (params: any) => { const layoutKey = layout ? layout.toUpperCase() : ""; // sorting each keys in ascending order - projectKey = projectKey.sort().join("_"); - stateKey = stateKey.sort().join("_"); - stateGroupKey = stateGroupKey.sort().join("_"); - priorityKey = priorityKey.sort().join("_"); - assigneesKey = assigneesKey.sort().join("_"); - mentionsKey = mentionsKey.sort().join("_"); - createdByKey = createdByKey.sort().join("_"); - labelsKey = labelsKey.sort().join("_"); - subscriberKey = subscriberKey.sort().join("_"); + projectKey = projectKey.toSorted().join("_"); + stateKey = stateKey.toSorted().join("_"); + stateGroupKey = stateGroupKey.toSorted().join("_"); + priorityKey = priorityKey.toSorted().join("_"); + assigneesKey = assigneesKey.toSorted().join("_"); + mentionsKey = mentionsKey.toSorted().join("_"); + createdByKey = createdByKey.toSorted().join("_"); + labelsKey = labelsKey.toSorted().join("_"); + subscriberKey = subscriberKey.toSorted().join("_"); return `${layoutKey}_${projectKey}_${stateGroupKey}_${stateKey}_${priorityKey}_${assigneesKey}_${mentionsKey}_${createdByKey}_${type}_${groupBy}_${orderBy}_${labelsKey}_${startDateKey}_${targetDateKey}_${sub_issue}_${subscriberKey}`; }; @@ -160,10 +160,10 @@ export const APPLICATION_BY_CLIENT_ID = (clientId: string) => `APPLICATION_BY_CL export const APPLICATION_CATEGORIES_LIST = () => `APPLICATION_CATEGORIES_LIST`; // project level keys -export const PROJECT_DETAILS = (workspaceSlug: string, projectId: string) => +export const PROJECT_DETAILS = (_workspaceSlug: string, projectId: string) => `PROJECT_DETAILS_${projectId.toString().toUpperCase()}`; -export const PROJECT_ME_INFORMATION = (workspaceSlug: string, projectId: string) => +export const PROJECT_ME_INFORMATION = (_workspaceSlug: string, projectId: string) => `PROJECT_ME_INFORMATION_${projectId.toString().toUpperCase()}`; export const PROJECT_LABELS = (projectId: string, projectRole: EUserPermissions | undefined) => From b82f376a49a514d8de0828ad0ca993e3d87cea56 Mon Sep 17 00:00:00 2001 From: Rahulcheryala Date: Mon, 15 Jun 2026 14:21:18 +0530 Subject: [PATCH 7/9] fix: resolve coderabbit comments --- .../use-additional-favorite-item-details.tsx | 34 +++++++++---------- packages/constants/src/ai.ts | 6 ++-- 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/apps/web/ce/hooks/use-additional-favorite-item-details.tsx b/apps/web/ce/hooks/use-additional-favorite-item-details.tsx index 88203a26e2d3..bf2f3a93c996 100644 --- a/apps/web/ce/hooks/use-additional-favorite-item-details.tsx +++ b/apps/web/ce/hooks/use-additional-favorite-item-details.tsx @@ -9,24 +9,22 @@ import type { IFavorite } from "@plane/types"; // components import { FavoriteItemIcon } from "@/components/workspace/sidebar/favorites/favorite-items/common"; -export const useAdditionalFavoriteItemDetails = () => { - const getAdditionalFavoriteItemDetails = (_workspaceSlug: string, favorite: IFavorite) => { - const { entity_type: favoriteItemEntityType } = favorite; - const favoriteItemName = favorite?.entity_data?.name || favorite?.name; +const getAdditionalFavoriteItemDetails = (_workspaceSlug: string, favorite: IFavorite) => { + const { entity_type: favoriteItemEntityType } = favorite; + const favoriteItemName = favorite?.entity_data?.name || favorite?.name; - let itemIcon; - let itemTitle; + let itemIcon; + let itemTitle; - switch (favoriteItemEntityType) { - default: - itemTitle = favoriteItemName; - itemIcon = ; - break; - } - return { itemIcon, itemTitle }; - }; - - return { - getAdditionalFavoriteItemDetails, - }; + switch (favoriteItemEntityType) { + default: + itemTitle = favoriteItemName; + itemIcon = ; + break; + } + return { itemIcon, itemTitle }; }; + +export const useAdditionalFavoriteItemDetails = () => ({ + getAdditionalFavoriteItemDetails, +}); diff --git a/packages/constants/src/ai.ts b/packages/constants/src/ai.ts index 7c670e311dce..42fafe9504c1 100644 --- a/packages/constants/src/ai.ts +++ b/packages/constants/src/ai.ts @@ -8,8 +8,6 @@ export enum AI_EDITOR_TASKS { ASK_ANYTHING = "ASK_ANYTHING", } -export const LOADING_TEXTS: { - [key in AI_EDITOR_TASKS]: string; -} = { +export const LOADING_TEXTS = { [AI_EDITOR_TASKS.ASK_ANYTHING]: "Pi is generating response", -}; +} satisfies { [key in AI_EDITOR_TASKS]: string }; From efecb7b75dba05d62fecaf4af865fdd2f7232130 Mon Sep 17 00:00:00 2001 From: Rahulcheryala Date: Mon, 15 Jun 2026 17:30:58 +0530 Subject: [PATCH 8/9] refactor: resolve coderabbit comments --- apps/web/ce/hooks/use-additional-favorite-item-details.tsx | 2 +- packages/editor/src/core/constants/common.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/web/ce/hooks/use-additional-favorite-item-details.tsx b/apps/web/ce/hooks/use-additional-favorite-item-details.tsx index bf2f3a93c996..6f39212005a9 100644 --- a/apps/web/ce/hooks/use-additional-favorite-item-details.tsx +++ b/apps/web/ce/hooks/use-additional-favorite-item-details.tsx @@ -19,7 +19,7 @@ const getAdditionalFavoriteItemDetails = (_workspaceSlug: string, favorite: IFav switch (favoriteItemEntityType) { default: itemTitle = favoriteItemName; - itemIcon = ; + itemIcon = ; break; } return { itemIcon, itemTitle }; diff --git a/packages/editor/src/core/constants/common.ts b/packages/editor/src/core/constants/common.ts index 18cf233eae97..b90069944cbd 100644 --- a/packages/editor/src/core/constants/common.ts +++ b/packages/editor/src/core/constants/common.ts @@ -166,7 +166,7 @@ export const COMPLEX_ITEMS: ToolbarMenuItem<"table" | "image">[] = [ { itemKey: "image", renderKey: "image", name: "Image", icon: Image, editors: ["lite", "document"] }, ]; -export const IMAGE_ITEM = COMPLEX_ITEMS.find((item) => item.itemKey === "image") as ToolbarMenuItem<"image">; +export const IMAGE_ITEM = COMPLEX_ITEMS.find((item): item is ToolbarMenuItem<"image"> => item.itemKey === "image")!; export const TOOLBAR_ITEMS: { [editorType in TEditorTypes]: { @@ -188,8 +188,8 @@ export const TOOLBAR_ITEMS: { complex: COMPLEX_ITEMS.filter((item) => item.editors.includes("document")), }, sticky: { - basic: BASIC_MARK_ITEMS.filter((item) => ["Bold", "Italic"].includes(item.name)), - list: LIST_ITEMS.filter((item) => ["To-do list"].includes(item.name)), + basic: BASIC_MARK_ITEMS.filter((item) => ["bold", "italic"].includes(item.itemKey)), + list: LIST_ITEMS.filter((item) => ["to-do-list"].includes(item.itemKey)), }, }; From 31d86bd7208c9efd9fa86ecf13d2d3731bf2dd0f Mon Sep 17 00:00:00 2001 From: Rahul Cheryala <130470611+Rahulcheryala@users.noreply.github.com> Date: Fri, 26 Jun 2026 20:31:19 +0530 Subject: [PATCH 9/9] [GIT-240] refactor: hooks consolidation to core hooks (#9217) * refactor: migrate hooks (use-file-size) from web/app/ce to web/app/core * refactor: migrate hooks (use-notification-preview) from web/app/ce to web/app/core * refactor: migrate hooks (use-timeline-chart) from web/app/ce to web/app/core * refactor: migrate hooks (use-page, use-page-store) from web/app/ce to web/app/core * refactor: migrate hooks (app-rail, indexes) from web/app/ce to web/app/core * refactor: migrate hooks (use-page-flag) from web/app/ce to web/app/core * refactor: migrate hooks (use-editor-flagging) from web/app/ce to web/app/core * refactor: migrate hooks (use-filters-operator-configs) from web/app/ce to web/app/core * refactor: migrate hooks (use-additional-editor-mention) from web/app/ce to web/app/core * refactor: migrate hooks (use-additional-favorite-item-details) from web/app/ce to web/app/core * refactor: migrate hooks (use-extended-editor-extensions, use-pages-pane-extensions) from web/app/ce to web/app/core * refactor: migrate hooks (use-work-items-filters-config) from web/app/ce to web/app/core * refactor: migrate hooks (use-extended-editor-config) from web/app/ce to web/app/core * refactor: migrate hooks (use-bulk-operations) from web/app/ce to web/app/core * refactor: migrate hooks (use-debounced-duplicate-issues) from web/app/ce to web/app/core * refactor: migrate hooks (use-issue-properties) from web/app/ce to web/app/core * refactor: migrate hooks (use-workspace-issue-properties) from web/app/ce to web/app/core * refactor: delete hook (use-issue-embed) from web/app/ce * fix: coderabbit comments * fix: React doctor comments * fix: import structure for hooks --- .../(projects)/browse/[workItem]/page.tsx | 2 +- .../pages/(detail)/[pageId]/page.tsx | 2 +- .../[projectId]/pages/(detail)/header.tsx | 2 +- .../[projectId]/pages/(detail)/layout.tsx | 2 +- .../[projectId]/pages/(list)/header.tsx | 2 +- .../[projectId]/pages/(list)/page.tsx | 2 +- apps/web/app/(all)/[workspaceSlug]/layout.tsx | 2 +- .../command-palette/modals/project-level.tsx | 2 +- .../web/ce/components/pages/extra-actions.tsx | 2 +- .../components/pages/header/share-control.tsx | 2 +- .../web/ce/components/pages/modals/modals.tsx | 2 +- apps/web/ce/hooks/app-rail/index.ts | 7 ---- apps/web/ce/hooks/app-rail/provider.tsx | 23 ------------- apps/web/ce/hooks/use-issue-embed.tsx | 31 ------------------ apps/web/ce/hooks/use-timeline-chart.ts | 32 ------------------- .../components/editor/document/editor.tsx | 3 +- .../components/editor/lite-text/editor.tsx | 2 +- .../components/editor/rich-text/editor.tsx | 2 +- .../editor/sticky-editor/editor.tsx | 2 +- .../gantt-chart/chart/main-content.tsx | 5 ++- .../components/inbox/content/issue-root.tsx | 8 ++--- .../inbox/modals/create-modal/create-root.tsx | 2 +- .../attachment/attachment-item-list.tsx | 2 +- .../issues/attachment/attachment-upload.tsx | 2 +- .../attachments/quick-action-button.tsx | 2 +- .../issues/issue-detail/main-content.tsx | 6 ++-- .../issue-layouts/gantt/base-gantt-root.tsx | 5 ++- .../issues/issue-layouts/list/default.tsx | 2 +- .../spreadsheet/spreadsheet-view.tsx | 3 +- .../components/issues/issue-modal/form.tsx | 2 +- .../issues/peek-overview/issue-detail.tsx | 8 ++--- .../components/issues/peek-overview/root.tsx | 2 +- .../components/pages/dropdowns/actions.tsx | 4 +-- .../components/pages/editor/editor-body.tsx | 6 ++-- .../components/pages/editor/page-root.tsx | 9 +++--- .../pages/editor/toolbar/options-dropdown.tsx | 2 +- .../core/components/pages/header/actions.tsx | 2 +- .../web/core/components/pages/header/root.tsx | 5 ++- .../pages/list/block-item-action.tsx | 2 +- apps/web/core/components/pages/list/block.tsx | 4 +-- apps/web/core/components/pages/list/root.tsx | 4 +-- .../pages/modals/create-page-modal.tsx | 4 +-- .../pages/modals/delete-page-modal.tsx | 4 +-- .../components/pages/navigation-pane/root.tsx | 2 +- .../pages/navigation-pane/types/extensions.ts | 2 +- .../pages/pages-list-main-content.tsx | 2 +- .../core/components/pages/pages-list-view.tsx | 6 ++-- .../core/components/pages/version/editor.tsx | 2 +- .../components/pages/version/main-content.tsx | 2 +- .../core/components/pages/version/root.tsx | 2 +- .../power-k/hooks/use-context-indicator.ts | 2 +- .../ui/pages/context-based/page/commands.ts | 2 +- .../work-item-filters/filters-hoc/base.tsx | 4 +-- .../workspace-notifications/root.tsx | 3 +- .../core/hooks/editor/use-editor-config.ts | 4 +-- .../core/hooks/editor/use-editor-mention.tsx | 2 +- .../editor/use-extended-editor-config.ts | 0 apps/web/{ce => core}/hooks/pages/index.ts | 2 +- .../pages/use-extended-editor-extensions.ts | 2 +- .../hooks/pages/use-pages-pane-extensions.ts | 0 .../use-filters-operator-configs.ts | 0 apps/web/{ce => core}/hooks/store/index.ts | 0 .../hooks/store/use-page-store.ts | 0 apps/web/{ce => core}/hooks/store/use-page.ts | 4 +-- .../hooks/use-additional-editor-mention.tsx | 0 .../use-additional-favorite-item-details.tsx | 0 .../hooks/use-bulk-operation-status.ts | 0 .../hooks/use-debounced-duplicate-issues.tsx | 0 .../{ce => core}/hooks/use-editor-flagging.ts | 2 +- .../core/hooks/use-favorite-item-details.tsx | 4 +-- apps/web/{ce => core}/hooks/use-file-size.ts | 0 .../hooks/use-issue-properties.tsx | 0 .../hooks/use-notification-preview.tsx | 0 apps/web/{ce => core}/hooks/use-page-flag.ts | 0 .../core/hooks/use-parse-editor-content.ts | 2 +- .../core/hooks/use-realtime-page-events.tsx | 4 +-- apps/web/core/hooks/use-timeline-chart.ts | 25 +++++++++++++-- ...se-workspace-issue-properties-extended.tsx | 0 .../hooks/use-workspace-issue-properties.ts | 2 +- .../use-work-item-filters-config.tsx | 2 +- 80 files changed, 112 insertions(+), 191 deletions(-) delete mode 100644 apps/web/ce/hooks/app-rail/index.ts delete mode 100644 apps/web/ce/hooks/app-rail/provider.tsx delete mode 100644 apps/web/ce/hooks/use-issue-embed.tsx delete mode 100644 apps/web/ce/hooks/use-timeline-chart.ts rename apps/web/{ce => core}/hooks/editor/use-extended-editor-config.ts (100%) rename apps/web/{ce => core}/hooks/pages/index.ts (100%) rename apps/web/{ce => core}/hooks/pages/use-extended-editor-extensions.ts (94%) rename apps/web/{ce => core}/hooks/pages/use-pages-pane-extensions.ts (100%) rename apps/web/{ce => core}/hooks/rich-filters/use-filters-operator-configs.ts (100%) rename apps/web/{ce => core}/hooks/store/index.ts (100%) rename apps/web/{ce => core}/hooks/store/use-page-store.ts (100%) rename apps/web/{ce => core}/hooks/store/use-page.ts (86%) rename apps/web/{ce => core}/hooks/use-additional-editor-mention.tsx (100%) rename apps/web/{ce => core}/hooks/use-additional-favorite-item-details.tsx (100%) rename apps/web/{ce => core}/hooks/use-bulk-operation-status.ts (100%) rename apps/web/{ce => core}/hooks/use-debounced-duplicate-issues.tsx (100%) rename apps/web/{ce => core}/hooks/use-editor-flagging.ts (94%) rename apps/web/{ce => core}/hooks/use-file-size.ts (100%) rename apps/web/{ce => core}/hooks/use-issue-properties.tsx (100%) rename apps/web/{ce => core}/hooks/use-notification-preview.tsx (100%) rename apps/web/{ce => core}/hooks/use-page-flag.ts (100%) rename apps/web/{ce => core}/hooks/use-workspace-issue-properties-extended.tsx (100%) rename apps/web/{ce => core}/hooks/work-item-filters/use-work-item-filters-config.tsx (99%) diff --git a/apps/web/app/(all)/[workspaceSlug]/(projects)/browse/[workItem]/page.tsx b/apps/web/app/(all)/[workspaceSlug]/(projects)/browse/[workItem]/page.tsx index f2c5aea1aa5e..427e43fc9d40 100644 --- a/apps/web/app/(all)/[workspaceSlug]/(projects)/browse/[workItem]/page.tsx +++ b/apps/web/app/(all)/[workspaceSlug]/(projects)/browse/[workItem]/page.tsx @@ -27,7 +27,7 @@ import { useAppRouter } from "@/hooks/use-app-router"; // layouts import { ProjectAuthWrapper } from "@/layouts/auth-layout/project-wrapper"; // plane web imports -import { useWorkItemProperties } from "@/plane-web/hooks/use-issue-properties"; +import { useWorkItemProperties } from "@/hooks/use-issue-properties"; import { WorkItemDetailRoot } from "@/plane-web/components/browse/workItem-detail"; import type { Route } from "./+types/page"; diff --git a/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(detail)/[pageId]/page.tsx b/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(detail)/[pageId]/page.tsx index ec332bbe10d9..fc1f76aa5d4a 100644 --- a/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(detail)/[pageId]/page.tsx +++ b/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(detail)/[pageId]/page.tsx @@ -27,7 +27,7 @@ import { useEditorAsset } from "@/hooks/store/use-editor-asset"; import { useWorkspace } from "@/hooks/store/use-workspace"; import { useAppRouter } from "@/hooks/use-app-router"; // plane web hooks -import { EPageStoreType, usePage, usePageStore } from "@/plane-web/hooks/store"; +import { EPageStoreType, usePage, usePageStore } from "@/hooks/store"; // plane web services import { WorkspaceService } from "@/services/workspace.service"; // services diff --git a/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(detail)/header.tsx b/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(detail)/header.tsx index 271d0a159d43..0d2b77e94d6b 100644 --- a/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(detail)/header.tsx +++ b/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(detail)/header.tsx @@ -23,7 +23,7 @@ import { useAppRouter } from "@/hooks/use-app-router"; // plane web imports import { CommonProjectBreadcrumbs } from "@/plane-web/components/breadcrumbs/common"; import { PageDetailsHeaderExtraActions } from "@/plane-web/components/pages"; -import { EPageStoreType, usePage, usePageStore } from "@/plane-web/hooks/store"; +import { EPageStoreType, usePage, usePageStore } from "@/hooks/store"; export interface IPagesHeaderProps { showButton?: boolean; diff --git a/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(detail)/layout.tsx b/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(detail)/layout.tsx index 0ba3728ce5c3..b8f408091b06 100644 --- a/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(detail)/layout.tsx +++ b/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(detail)/layout.tsx @@ -10,7 +10,7 @@ import useSWR from "swr"; import { AppHeader } from "@/components/core/app-header"; import { ContentWrapper } from "@/components/core/content-wrapper"; // plane web hooks -import { EPageStoreType, usePageStore } from "@/plane-web/hooks/store"; +import { EPageStoreType, usePageStore } from "@/hooks/store"; // local components import type { Route } from "./+types/layout"; import { PageDetailsHeader } from "./header"; diff --git a/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(list)/header.tsx b/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(list)/header.tsx index e76f55b9a8e4..3ff73641616f 100644 --- a/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(list)/header.tsx +++ b/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(list)/header.tsx @@ -22,7 +22,7 @@ import { BreadcrumbLink } from "@/components/common/breadcrumb-link"; import { useProject } from "@/hooks/store/use-project"; // plane web imports import { CommonProjectBreadcrumbs } from "@/plane-web/components/breadcrumbs/common"; -import { EPageStoreType, usePageStore } from "@/plane-web/hooks/store"; +import { EPageStoreType, usePageStore } from "@/hooks/store"; export const PagesListHeader = observer(function PagesListHeader() { // states diff --git a/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(list)/page.tsx b/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(list)/page.tsx index e5e1de9dedfb..540e87cc178f 100644 --- a/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(list)/page.tsx +++ b/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(list)/page.tsx @@ -25,7 +25,7 @@ import { useProject } from "@/hooks/store/use-project"; import { useUserPermissions } from "@/hooks/store/user"; import { useAppRouter } from "@/hooks/use-app-router"; // plane web hooks -import { EPageStoreType } from "@/plane-web/hooks/store"; +import { EPageStoreType } from "@/hooks/store"; import type { Route } from "./+types/page"; const getPageType = (pageType?: string | null): TPageNavigationTabs => { diff --git a/apps/web/app/(all)/[workspaceSlug]/layout.tsx b/apps/web/app/(all)/[workspaceSlug]/layout.tsx index 293688673a9c..f093efe76d74 100644 --- a/apps/web/app/(all)/[workspaceSlug]/layout.tsx +++ b/apps/web/app/(all)/[workspaceSlug]/layout.tsx @@ -7,7 +7,7 @@ import { Outlet } from "react-router"; import { AuthenticationWrapper } from "@/lib/wrappers/authentication-wrapper"; import { WorkspaceContentWrapper } from "@/plane-web/components/workspace/content-wrapper"; -import { AppRailVisibilityProvider } from "@/plane-web/hooks/app-rail"; +import { AppRailVisibilityProvider } from "@/lib/app-rail"; import { GlobalModals } from "@/plane-web/components/common/modal/global"; import { WorkspaceAuthWrapper } from "@/layouts/auth-layout/workspace-wrapper"; import type { Route } from "./+types/layout"; diff --git a/apps/web/ce/components/command-palette/modals/project-level.tsx b/apps/web/ce/components/command-palette/modals/project-level.tsx index e01b002efd95..5555104bba0c 100644 --- a/apps/web/ce/components/command-palette/modals/project-level.tsx +++ b/apps/web/ce/components/command-palette/modals/project-level.tsx @@ -13,7 +13,7 @@ import { CreateUpdateProjectViewModal } from "@/components/views/modal"; // hooks import { useCommandPalette } from "@/hooks/store/use-command-palette"; // plane web hooks -import { EPageStoreType } from "@/plane-web/hooks/store"; +import { EPageStoreType } from "@/hooks/store"; export type TProjectLevelModalsProps = { workspaceSlug: string; diff --git a/apps/web/ce/components/pages/extra-actions.tsx b/apps/web/ce/components/pages/extra-actions.tsx index a6eaee6335ae..b89ef9bf5601 100644 --- a/apps/web/ce/components/pages/extra-actions.tsx +++ b/apps/web/ce/components/pages/extra-actions.tsx @@ -5,7 +5,7 @@ */ // store -import type { EPageStoreType } from "@/plane-web/hooks/store"; +import type { EPageStoreType } from "@/hooks/store"; import type { TPageInstance } from "@/store/pages/base-page"; export type TPageHeaderExtraActionsProps = { diff --git a/apps/web/ce/components/pages/header/share-control.tsx b/apps/web/ce/components/pages/header/share-control.tsx index d84ee26bdcf2..ea4cb0ae414a 100644 --- a/apps/web/ce/components/pages/header/share-control.tsx +++ b/apps/web/ce/components/pages/header/share-control.tsx @@ -4,7 +4,7 @@ * See the LICENSE file for details. */ -import type { EPageStoreType } from "@/plane-web/hooks/store"; +import type { EPageStoreType } from "@/hooks/store"; // store import type { TPageInstance } from "@/store/pages/base-page"; diff --git a/apps/web/ce/components/pages/modals/modals.tsx b/apps/web/ce/components/pages/modals/modals.tsx index 84952fbf4008..6720c8bbb205 100644 --- a/apps/web/ce/components/pages/modals/modals.tsx +++ b/apps/web/ce/components/pages/modals/modals.tsx @@ -6,7 +6,7 @@ import { observer } from "mobx-react"; // components -import type { EPageStoreType } from "@/plane-web/hooks/store"; +import type { EPageStoreType } from "@/hooks/store"; // store import type { TPageInstance } from "@/store/pages/base-page"; diff --git a/apps/web/ce/hooks/app-rail/index.ts b/apps/web/ce/hooks/app-rail/index.ts deleted file mode 100644 index d46b5c917ee8..000000000000 --- a/apps/web/ce/hooks/app-rail/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Copyright (c) 2023-present Plane Software, Inc. and contributors - * SPDX-License-Identifier: AGPL-3.0-only - * See the LICENSE file for details. - */ - -export * from "./provider"; diff --git a/apps/web/ce/hooks/app-rail/provider.tsx b/apps/web/ce/hooks/app-rail/provider.tsx deleted file mode 100644 index 029f5a83536b..000000000000 --- a/apps/web/ce/hooks/app-rail/provider.tsx +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright (c) 2023-present Plane Software, Inc. and contributors - * SPDX-License-Identifier: AGPL-3.0-only - * See the LICENSE file for details. - */ - -import React from "react"; -import { observer } from "mobx-react"; -import { AppRailVisibilityProvider as CoreProvider } from "@/lib/app-rail"; - -interface AppRailVisibilityProviderProps { - children: React.ReactNode; -} - -/** - * CE AppRailVisibilityProvider - * Wraps core provider with isEnabled hardcoded to false - */ -export const AppRailVisibilityProvider = observer(function AppRailVisibilityProvider({ - children, -}: AppRailVisibilityProviderProps) { - return {children}; -}); diff --git a/apps/web/ce/hooks/use-issue-embed.tsx b/apps/web/ce/hooks/use-issue-embed.tsx deleted file mode 100644 index 6ffbec7cdb26..000000000000 --- a/apps/web/ce/hooks/use-issue-embed.tsx +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright (c) 2023-present Plane Software, Inc. and contributors - * SPDX-License-Identifier: AGPL-3.0-only - * See the LICENSE file for details. - */ - -// editor -import type { TEmbedConfig } from "@plane/editor"; -// plane types -import type { TSearchEntityRequestPayload, TSearchResponse } from "@plane/types"; -// plane web components -import { IssueEmbedUpgradeCard } from "@/plane-web/components/pages"; - -export type TIssueEmbedHookProps = { - fetchEmbedSuggestions?: (payload: TSearchEntityRequestPayload) => Promise; - projectId?: string; - workspaceSlug?: string; -}; - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -export const useIssueEmbed = (props: TIssueEmbedHookProps) => { - const widgetCallback = () => ; - - const issueEmbedProps: TEmbedConfig["issue"] = { - widgetCallback, - }; - - return { - issueEmbedProps, - }; -}; diff --git a/apps/web/ce/hooks/use-timeline-chart.ts b/apps/web/ce/hooks/use-timeline-chart.ts deleted file mode 100644 index 2deaae254245..000000000000 --- a/apps/web/ce/hooks/use-timeline-chart.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (c) 2023-present Plane Software, Inc. and contributors - * SPDX-License-Identifier: AGPL-3.0-only - * See the LICENSE file for details. - */ - -// types -import type { TTimelineTypeCore } from "@plane/types"; -import { GANTT_TIMELINE_TYPE } from "@plane/types"; -// Plane-web - -import type { IBaseTimelineStore } from "@/plane-web/store/timeline/base-timeline.store"; -import type { ITimelineStore } from "../store/timeline"; - -export const getTimelineStore = ( - timelineStore: ITimelineStore, - timelineType: TTimelineTypeCore -): IBaseTimelineStore => { - if (timelineType === GANTT_TIMELINE_TYPE.ISSUE) { - return timelineStore.issuesTimeLineStore as IBaseTimelineStore; - } - if (timelineType === GANTT_TIMELINE_TYPE.MODULE) { - return timelineStore.modulesTimeLineStore as IBaseTimelineStore; - } - if (timelineType === GANTT_TIMELINE_TYPE.PROJECT) { - return timelineStore.projectTimeLineStore; - } - if (timelineType === GANTT_TIMELINE_TYPE.GROUPED) { - return timelineStore.groupedTimeLineStore; - } - throw new Error(`Unknown timeline type: ${timelineType}`); -}; diff --git a/apps/web/core/components/editor/document/editor.tsx b/apps/web/core/components/editor/document/editor.tsx index dd653e45ef01..730719f78de2 100644 --- a/apps/web/core/components/editor/document/editor.tsx +++ b/apps/web/core/components/editor/document/editor.tsx @@ -14,8 +14,7 @@ import { cn } from "@plane/utils"; import { useEditorConfig, useEditorMention } from "@/hooks/editor"; import { useMember } from "@/hooks/store/use-member"; import { useParseEditorContent } from "@/hooks/use-parse-editor-content"; -// plane web hooks -import { useEditorFlagging } from "@/plane-web/hooks/use-editor-flagging"; +import { useEditorFlagging } from "@/hooks/use-editor-flagging"; // local imports import { EditorMentionsRoot } from "../embeds/mentions"; diff --git a/apps/web/core/components/editor/lite-text/editor.tsx b/apps/web/core/components/editor/lite-text/editor.tsx index 257f106f8c0c..e09d6d197e33 100644 --- a/apps/web/core/components/editor/lite-text/editor.tsx +++ b/apps/web/core/components/editor/lite-text/editor.tsx @@ -21,7 +21,7 @@ import { useEditorConfig, useEditorMention } from "@/hooks/editor"; import { useMember } from "@/hooks/store/use-member"; import { useParseEditorContent } from "@/hooks/use-parse-editor-content"; // plane web hooks -import { useEditorFlagging } from "@/plane-web/hooks/use-editor-flagging"; +import { useEditorFlagging } from "@/hooks/use-editor-flagging"; // plane web service import { WorkspaceService } from "@/services/workspace.service"; import { LiteToolbar } from "./lite-toolbar"; diff --git a/apps/web/core/components/editor/rich-text/editor.tsx b/apps/web/core/components/editor/rich-text/editor.tsx index 5a429b039fe2..cb2172bdee80 100644 --- a/apps/web/core/components/editor/rich-text/editor.tsx +++ b/apps/web/core/components/editor/rich-text/editor.tsx @@ -17,7 +17,7 @@ import { useEditorConfig, useEditorMention } from "@/hooks/editor"; import { useMember } from "@/hooks/store/use-member"; import { useParseEditorContent } from "@/hooks/use-parse-editor-content"; // plane web hooks -import { useEditorFlagging } from "@/plane-web/hooks/use-editor-flagging"; +import { useEditorFlagging } from "@/hooks/use-editor-flagging"; type RichTextEditorWrapperProps = MakeOptional< Omit, diff --git a/apps/web/core/components/editor/sticky-editor/editor.tsx b/apps/web/core/components/editor/sticky-editor/editor.tsx index 544ea3b35b57..75d67cd1affc 100644 --- a/apps/web/core/components/editor/sticky-editor/editor.tsx +++ b/apps/web/core/components/editor/sticky-editor/editor.tsx @@ -18,7 +18,7 @@ import { cn } from "@plane/utils"; import { useEditorConfig } from "@/hooks/editor"; import { useParseEditorContent } from "@/hooks/use-parse-editor-content"; // plane web hooks -import { useEditorFlagging } from "@/plane-web/hooks/use-editor-flagging"; +import { useEditorFlagging } from "@/hooks/use-editor-flagging"; import { StickyEditorToolbar } from "./toolbar"; interface StickyEditorWrapperProps extends Omit< diff --git a/apps/web/core/components/gantt-chart/chart/main-content.tsx b/apps/web/core/components/gantt-chart/chart/main-content.tsx index e7de61089d20..16f1109dfaa3 100644 --- a/apps/web/core/components/gantt-chart/chart/main-content.tsx +++ b/apps/web/core/components/gantt-chart/chart/main-content.tsx @@ -31,9 +31,8 @@ import { import { GanttChartRowList } from "@/plane-web/components/gantt-chart/blocks/block-row-list"; import { GanttChartBlocksList } from "@/plane-web/components/gantt-chart/blocks/blocks-list"; import { IssueBulkOperationsRoot } from "@/plane-web/components/issues/bulk-operations"; -// plane web hooks -import { useBulkOperationStatus } from "@/plane-web/hooks/use-bulk-operation-status"; -// +import { useBulkOperationStatus } from "@/hooks/use-bulk-operation-status"; +// local imports import { DEFAULT_BLOCK_WIDTH, GANTT_SELECT_GROUP, HEADER_HEIGHT } from "../constants"; import { getItemPositionWidth } from "../views"; import { TimelineDragHelper } from "./timeline-drag-helper"; diff --git a/apps/web/core/components/inbox/content/issue-root.tsx b/apps/web/core/components/inbox/content/issue-root.tsx index 172693b92298..e4c40103965a 100644 --- a/apps/web/core/components/inbox/content/issue-root.tsx +++ b/apps/web/core/components/inbox/content/issue-root.tsx @@ -31,7 +31,7 @@ import { useUser } from "@/hooks/store/user"; import useReloadConfirmations from "@/hooks/use-reload-confirmation"; // store types import { DeDupeIssuePopoverRoot } from "@/plane-web/components/de-dupe/duplicate-popover"; -import { useDebouncedDuplicateIssues } from "@/plane-web/hooks/use-debounced-duplicate-issues"; +import { useDebouncedDuplicateIssues } from "@/hooks/use-debounced-duplicate-issues"; // services import { IntakeWorkItemVersionService } from "@/services/inbox"; // stores @@ -64,14 +64,14 @@ export const InboxIssueMainContent = observer(function InboxIssueMainContent(pro const { setShowAlert } = useReloadConfirmations(isSubmitting === "submitting"); useEffect(() => { + let timer: ReturnType; if (isSubmitting === "submitted") { setShowAlert(false); - setTimeout(async () => { - setIsSubmitting("saved"); - }, 3000); + timer = setTimeout(() => setIsSubmitting("saved"), 3000); } else if (isSubmitting === "submitting") { setShowAlert(true); } + return () => clearTimeout(timer); }, [isSubmitting, setShowAlert, setIsSubmitting]); // derived values diff --git a/apps/web/core/components/inbox/modals/create-modal/create-root.tsx b/apps/web/core/components/inbox/modals/create-modal/create-root.tsx index e31e8da12703..32963204dd0d 100644 --- a/apps/web/core/components/inbox/modals/create-modal/create-root.tsx +++ b/apps/web/core/components/inbox/modals/create-modal/create-root.tsx @@ -26,7 +26,7 @@ import { usePlatformOS } from "@/hooks/use-platform-os"; // plane web imports import { DeDupeButtonRoot } from "@/plane-web/components/de-dupe/de-dupe-button"; import { DuplicateModalRoot } from "@/plane-web/components/de-dupe/duplicate-modal"; -import { useDebouncedDuplicateIssues } from "@/plane-web/hooks/use-debounced-duplicate-issues"; +import { useDebouncedDuplicateIssues } from "@/hooks/use-debounced-duplicate-issues"; // services import { FileService } from "@/services/file.service"; // local imports diff --git a/apps/web/core/components/issues/attachment/attachment-item-list.tsx b/apps/web/core/components/issues/attachment/attachment-item-list.tsx index 0ac4db84f292..4341e5c95100 100644 --- a/apps/web/core/components/issues/attachment/attachment-item-list.tsx +++ b/apps/web/core/components/issues/attachment/attachment-item-list.tsx @@ -16,7 +16,7 @@ import { EIssueServiceType } from "@plane/types"; // hooks import { useIssueDetail } from "@/hooks/store/use-issue-detail"; // plane web hooks -import { useFileSize } from "@/plane-web/hooks/use-file-size"; +import { useFileSize } from "@/hooks/use-file-size"; // types import type { TAttachmentHelpers } from "../issue-detail-widgets/attachments/helper"; // components diff --git a/apps/web/core/components/issues/attachment/attachment-upload.tsx b/apps/web/core/components/issues/attachment/attachment-upload.tsx index c537361ef9bf..2a37b3b985c5 100644 --- a/apps/web/core/components/issues/attachment/attachment-upload.tsx +++ b/apps/web/core/components/issues/attachment/attachment-upload.tsx @@ -8,7 +8,7 @@ import { useCallback, useState } from "react"; import { observer } from "mobx-react"; import { useDropzone } from "react-dropzone"; // plane web hooks -import { useFileSize } from "@/plane-web/hooks/use-file-size"; +import { useFileSize } from "@/hooks/use-file-size"; // types import type { TAttachmentOperations } from "../issue-detail-widgets/attachments/helper"; diff --git a/apps/web/core/components/issues/issue-detail-widgets/attachments/quick-action-button.tsx b/apps/web/core/components/issues/issue-detail-widgets/attachments/quick-action-button.tsx index 7853b3b4e406..dc6155550f00 100644 --- a/apps/web/core/components/issues/issue-detail-widgets/attachments/quick-action-button.tsx +++ b/apps/web/core/components/issues/issue-detail-widgets/attachments/quick-action-button.tsx @@ -15,7 +15,7 @@ import type { TIssueServiceType } from "@plane/types"; // hooks import { useIssueDetail } from "@/hooks/store/use-issue-detail"; // plane web hooks -import { useFileSize } from "@/plane-web/hooks/use-file-size"; +import { useFileSize } from "@/hooks/use-file-size"; // local imports import { useAttachmentOperations } from "./helper"; diff --git a/apps/web/core/components/issues/issue-detail/main-content.tsx b/apps/web/core/components/issues/issue-detail/main-content.tsx index d14bd35396a5..34140963ae01 100644 --- a/apps/web/core/components/issues/issue-detail/main-content.tsx +++ b/apps/web/core/components/issues/issue-detail/main-content.tsx @@ -24,7 +24,7 @@ import useSize from "@/hooks/use-window-size"; // plane web components import { DeDupeIssuePopoverRoot } from "@/plane-web/components/de-dupe/duplicate-popover"; import { IssueTypeSwitcher } from "@/plane-web/components/issues/issue-details/issue-type-switcher"; -import { useDebouncedDuplicateIssues } from "@/plane-web/hooks/use-debounced-duplicate-issues"; +import { useDebouncedDuplicateIssues } from "@/hooks/use-debounced-duplicate-issues"; // services import { WorkItemVersionService } from "@/services/issue"; // local imports @@ -80,10 +80,12 @@ export const IssueMainContent = observer(function IssueMainContent(props: Props) ); useEffect(() => { + let timer: ReturnType; if (isSubmitting === "submitted") { setShowAlert(false); - setTimeout(async () => setIsSubmitting("saved"), 2000); + timer = setTimeout(() => setIsSubmitting("saved"), 2000); } else if (isSubmitting === "submitting") setShowAlert(true); + return () => clearTimeout(timer); }, [isSubmitting, setShowAlert, setIsSubmitting]); if (!issue || !issue.project_id) return <>; diff --git a/apps/web/core/components/issues/issue-layouts/gantt/base-gantt-root.tsx b/apps/web/core/components/issues/issue-layouts/gantt/base-gantt-root.tsx index 3404b438ca4c..6eff5cdffbfc 100644 --- a/apps/web/core/components/issues/issue-layouts/gantt/base-gantt-root.tsx +++ b/apps/web/core/components/issues/issue-layouts/gantt/base-gantt-root.tsx @@ -24,9 +24,8 @@ import { useUserPermissions } from "@/hooks/store/user"; import { useIssueStoreType } from "@/hooks/use-issue-layout-store"; import { useIssuesActions } from "@/hooks/use-issues-actions"; import { useTimeLineChart } from "@/hooks/use-timeline-chart"; -// plane web hooks -import { useBulkOperationStatus } from "@/plane-web/hooks/use-bulk-operation-status"; - +import { useBulkOperationStatus } from "@/hooks/use-bulk-operation-status"; +// local imports import { IssueLayoutHOC } from "../issue-layout-HOC"; import { GanttQuickAddIssueButton, QuickAddIssueRoot } from "../quick-add"; import { IssueGanttBlock } from "./blocks"; diff --git a/apps/web/core/components/issues/issue-layouts/list/default.tsx b/apps/web/core/components/issues/issue-layouts/list/default.tsx index 28db68addc9d..1d255a72c8e2 100644 --- a/apps/web/core/components/issues/issue-layouts/list/default.tsx +++ b/apps/web/core/components/issues/issue-layouts/list/default.tsx @@ -29,7 +29,7 @@ import { useIssueStoreType } from "@/hooks/use-issue-layout-store"; // plane web components import { IssueBulkOperationsRoot } from "@/plane-web/components/issues/bulk-operations"; // plane web hooks -import { useBulkOperationStatus } from "@/plane-web/hooks/use-bulk-operation-status"; +import { useBulkOperationStatus } from "@/hooks/use-bulk-operation-status"; // utils import type { GroupDropLocation } from "../utils"; import { getGroupByColumns, isWorkspaceLevel, isSubGrouped } from "../utils"; diff --git a/apps/web/core/components/issues/issue-layouts/spreadsheet/spreadsheet-view.tsx b/apps/web/core/components/issues/issue-layouts/spreadsheet/spreadsheet-view.tsx index f3f143db4efc..4111fa3c6be7 100644 --- a/apps/web/core/components/issues/issue-layouts/spreadsheet/spreadsheet-view.tsx +++ b/apps/web/core/components/issues/issue-layouts/spreadsheet/spreadsheet-view.tsx @@ -15,10 +15,9 @@ import { EIssueLayoutTypes } from "@plane/types"; import { MultipleSelectGroup } from "@/components/core/multiple-select"; // hooks import { useProject } from "@/hooks/store/use-project"; +import { useBulkOperationStatus } from "@/hooks/use-bulk-operation-status"; // plane web components import { IssueBulkOperationsRoot } from "@/plane-web/components/issues/bulk-operations"; -// plane web hooks -import { useBulkOperationStatus } from "@/plane-web/hooks/use-bulk-operation-status"; // local imports import type { TRenderQuickActions } from "../list/list-view-types"; import { QuickAddIssueRoot, SpreadsheetAddIssueButton } from "../quick-add"; diff --git a/apps/web/core/components/issues/issue-modal/form.tsx b/apps/web/core/components/issues/issue-modal/form.tsx index 33d7c599317e..53aded438717 100644 --- a/apps/web/core/components/issues/issue-modal/form.tsx +++ b/apps/web/core/components/issues/issue-modal/form.tsx @@ -48,7 +48,7 @@ import { DeDupeButtonRoot } from "@/plane-web/components/de-dupe/de-dupe-button" import { DuplicateModalRoot } from "@/plane-web/components/de-dupe/duplicate-modal"; import { IssueTypeSelect, WorkItemTemplateSelect } from "@/plane-web/components/issues/issue-modal"; import { WorkItemModalAdditionalProperties } from "@/plane-web/components/issues/issue-modal/modal-additional-properties"; -import { useDebouncedDuplicateIssues } from "@/plane-web/hooks/use-debounced-duplicate-issues"; +import { useDebouncedDuplicateIssues } from "@/hooks/use-debounced-duplicate-issues"; export interface IssueFormProps { data?: Partial; diff --git a/apps/web/core/components/issues/peek-overview/issue-detail.tsx b/apps/web/core/components/issues/peek-overview/issue-detail.tsx index 6bd89124b622..96054b02fc58 100644 --- a/apps/web/core/components/issues/peek-overview/issue-detail.tsx +++ b/apps/web/core/components/issues/peek-overview/issue-detail.tsx @@ -25,7 +25,7 @@ import useReloadConfirmations from "@/hooks/use-reload-confirmation"; import { DeDupeIssuePopoverRoot } from "@/plane-web/components/de-dupe/duplicate-popover"; import { IssueTypeSwitcher } from "@/plane-web/components/issues/issue-details/issue-type-switcher"; // plane web hooks -import { useDebouncedDuplicateIssues } from "@/plane-web/hooks/use-debounced-duplicate-issues"; +import { useDebouncedDuplicateIssues } from "@/hooks/use-debounced-duplicate-issues"; // services import { WorkItemVersionService } from "@/services/issue"; // local components @@ -62,14 +62,14 @@ export const PeekOverviewIssueDetails = observer(function PeekOverviewIssueDetai const { setShowAlert } = useReloadConfirmations(isSubmitting === "submitting"); useEffect(() => { + let timer: ReturnType; if (isSubmitting === "submitted") { setShowAlert(false); - setTimeout(async () => { - setIsSubmitting("saved"); - }, 2000); + timer = setTimeout(() => setIsSubmitting("saved"), 2000); } else if (isSubmitting === "submitting") { setShowAlert(true); } + return () => clearTimeout(timer); }, [isSubmitting, setShowAlert, setIsSubmitting]); // derived values diff --git a/apps/web/core/components/issues/peek-overview/root.tsx b/apps/web/core/components/issues/peek-overview/root.tsx index 421aaebbdb0a..b607158d8027 100644 --- a/apps/web/core/components/issues/peek-overview/root.tsx +++ b/apps/web/core/components/issues/peek-overview/root.tsx @@ -19,7 +19,7 @@ import { useIssueDetail } from "@/hooks/store/use-issue-detail"; import { useIssues } from "@/hooks/store/use-issues"; import { useUserPermissions } from "@/hooks/store/user"; import { useIssueStoreType } from "@/hooks/use-issue-layout-store"; -import { useWorkItemProperties } from "@/plane-web/hooks/use-issue-properties"; +import { useWorkItemProperties } from "@/hooks/use-issue-properties"; // local imports import type { TIssueOperations } from "../issue-detail"; import { IssueView } from "./view"; diff --git a/apps/web/core/components/pages/dropdowns/actions.tsx b/apps/web/core/components/pages/dropdowns/actions.tsx index aec992c4032c..e11d25f8c445 100644 --- a/apps/web/core/components/pages/dropdowns/actions.tsx +++ b/apps/web/core/components/pages/dropdowns/actions.tsx @@ -23,8 +23,8 @@ import { usePageOperations } from "@/hooks/use-page-operations"; // plane web components import { MovePageModal } from "@/plane-web/components/pages"; // plane web hooks -import type { EPageStoreType } from "@/plane-web/hooks/store"; -import { usePageFlag } from "@/plane-web/hooks/use-page-flag"; +import type { EPageStoreType } from "@/hooks/store"; +import { usePageFlag } from "@/hooks/use-page-flag"; // store types import type { TPageInstance } from "@/store/pages/base-page"; diff --git a/apps/web/core/components/pages/editor/editor-body.tsx b/apps/web/core/components/pages/editor/editor-body.tsx index 9270386dc0ae..561d048e448a 100644 --- a/apps/web/core/components/pages/editor/editor-body.tsx +++ b/apps/web/core/components/pages/editor/editor-body.tsx @@ -36,9 +36,9 @@ import { useParseEditorContent } from "@/hooks/use-parse-editor-content"; import type { TCustomEventHandlers } from "@/hooks/use-realtime-page-events"; import { useRealtimePageEvents } from "@/hooks/use-realtime-page-events"; import { EditorAIMenu } from "@/plane-web/components/pages"; -import type { TExtendedEditorExtensionsConfig } from "@/plane-web/hooks/pages"; -import type { EPageStoreType } from "@/plane-web/hooks/store"; -import { useEditorFlagging } from "@/plane-web/hooks/use-editor-flagging"; +import type { TExtendedEditorExtensionsConfig } from "@/hooks/pages"; +import type { EPageStoreType } from "@/hooks/store"; +import { useEditorFlagging } from "@/hooks/use-editor-flagging"; // store import type { TPageInstance } from "@/store/pages/base-page"; // local imports diff --git a/apps/web/core/components/pages/editor/page-root.tsx b/apps/web/core/components/pages/editor/page-root.tsx index 728b47fe9aff..2ffb04148ae0 100644 --- a/apps/web/core/components/pages/editor/page-root.tsx +++ b/apps/web/core/components/pages/editor/page-root.tsx @@ -14,8 +14,8 @@ import { usePageFallback } from "@/hooks/use-page-fallback"; // plane web import import type { PageUpdateHandler, TCustomEventHandlers } from "@/hooks/use-realtime-page-events"; import { PageModals } from "@/plane-web/components/pages"; -import { usePagesPaneExtensions, useExtendedEditorProps } from "@/plane-web/hooks/pages"; -import type { EPageStoreType } from "@/plane-web/hooks/store"; +import { usePagesPaneExtensions, useExtendedEditorProps } from "@/hooks/pages"; +import type { EPageStoreType } from "@/hooks/store"; // store import type { TPageInstance } from "@/store/pages/base-page"; // local imports @@ -91,9 +91,8 @@ export const PageRoot = observer(function PageRoot(props: TPageRootProps) { ); useEffect(() => { - setTimeout(() => { - setEditorRef(editorRef.current); - }, 0); + const timer = setTimeout(() => setEditorRef(editorRef.current), 0); + return () => clearTimeout(timer); }, [isContentEditable, setEditorRef]); // Get extensions and navigation logic from hook diff --git a/apps/web/core/components/pages/editor/toolbar/options-dropdown.tsx b/apps/web/core/components/pages/editor/toolbar/options-dropdown.tsx index a1c62bba10ae..44b443042159 100644 --- a/apps/web/core/components/pages/editor/toolbar/options-dropdown.tsx +++ b/apps/web/core/components/pages/editor/toolbar/options-dropdown.tsx @@ -16,7 +16,7 @@ import { usePageFilters } from "@/hooks/use-page-filters"; import { useQueryParams } from "@/hooks/use-query-params"; // plane web imports import type { TPageNavigationPaneTab } from "@/plane-web/components/pages/navigation-pane"; -import type { EPageStoreType } from "@/plane-web/hooks/store"; +import type { EPageStoreType } from "@/hooks/store"; // store import type { TPageInstance } from "@/store/pages/base-page"; // local imports diff --git a/apps/web/core/components/pages/header/actions.tsx b/apps/web/core/components/pages/header/actions.tsx index 7ebad8adcef0..ab3809a37fe9 100644 --- a/apps/web/core/components/pages/header/actions.tsx +++ b/apps/web/core/components/pages/header/actions.tsx @@ -10,7 +10,7 @@ import { PageLockControl } from "@/plane-web/components/pages/header/lock-contro import { PageMoveControl } from "@/plane-web/components/pages/header/move-control"; import { PageShareControl } from "@/plane-web/components/pages/header/share-control"; // plane web hooks -import type { EPageStoreType } from "@/plane-web/hooks/store"; +import type { EPageStoreType } from "@/hooks/store"; // store import type { TPageInstance } from "@/store/pages/base-page"; // local imports diff --git a/apps/web/core/components/pages/header/root.tsx b/apps/web/core/components/pages/header/root.tsx index 1223b97dbbe4..e86053289fbb 100644 --- a/apps/web/core/components/pages/header/root.tsx +++ b/apps/web/core/components/pages/header/root.tsx @@ -16,9 +16,8 @@ import { calculateTotalFilters } from "@plane/utils"; import { FiltersDropdown } from "@/components/issues/issue-layouts/filters"; // hooks import { useMember } from "@/hooks/store/use-member"; -// plane web hooks -import type { EPageStoreType } from "@/plane-web/hooks/store"; -import { usePageStore } from "@/plane-web/hooks/store"; +import { usePageStore } from "@/hooks/store"; +import type { EPageStoreType } from "@/hooks/store"; // local imports import { PageAppliedFiltersList } from "../list/applied-filters"; import { PageFiltersSelection } from "../list/filters"; diff --git a/apps/web/core/components/pages/list/block-item-action.tsx b/apps/web/core/components/pages/list/block-item-action.tsx index b62b97ee9f88..2d58545b37ce 100644 --- a/apps/web/core/components/pages/list/block-item-action.tsx +++ b/apps/web/core/components/pages/list/block-item-action.tsx @@ -15,7 +15,7 @@ import { renderFormattedDate, getFileURL } from "@plane/utils"; import { useMember } from "@/hooks/store/use-member"; import { usePageOperations } from "@/hooks/use-page-operations"; // plane web hooks -import type { EPageStoreType } from "@/plane-web/hooks/store"; +import type { EPageStoreType } from "@/hooks/store"; // store import type { TPageInstance } from "@/store/pages/base-page"; // local imports diff --git a/apps/web/core/components/pages/list/block.tsx b/apps/web/core/components/pages/list/block.tsx index 5d658a42e22e..8ceec0d6a10e 100644 --- a/apps/web/core/components/pages/list/block.tsx +++ b/apps/web/core/components/pages/list/block.tsx @@ -16,8 +16,8 @@ import { BlockItemAction } from "@/components/pages/list/block-item-action"; // hooks import { usePlatformOS } from "@/hooks/use-platform-os"; // plane web hooks -import type { EPageStoreType } from "@/plane-web/hooks/store"; -import { usePage } from "@/plane-web/hooks/store"; +import type { EPageStoreType } from "@/hooks/store"; +import { usePage } from "@/hooks/store"; type TPageListBlock = { pageId: string; diff --git a/apps/web/core/components/pages/list/root.tsx b/apps/web/core/components/pages/list/root.tsx index 3764e5bc19fa..2c42221b0100 100644 --- a/apps/web/core/components/pages/list/root.tsx +++ b/apps/web/core/components/pages/list/root.tsx @@ -10,8 +10,8 @@ import type { TPageNavigationTabs } from "@plane/types"; // components import { ListLayout } from "@/components/core/list"; // plane web hooks -import type { EPageStoreType } from "@/plane-web/hooks/store"; -import { usePageStore } from "@/plane-web/hooks/store"; +import type { EPageStoreType } from "@/hooks/store"; +import { usePageStore } from "@/hooks/store"; // local imports import { PageListBlock } from "./block"; diff --git a/apps/web/core/components/pages/modals/create-page-modal.tsx b/apps/web/core/components/pages/modals/create-page-modal.tsx index 493cb84e3eec..027ea7d65f95 100644 --- a/apps/web/core/components/pages/modals/create-page-modal.tsx +++ b/apps/web/core/components/pages/modals/create-page-modal.tsx @@ -13,8 +13,8 @@ import { EModalPosition, EModalWidth, ModalCore } from "@plane/ui"; // hooks import { useAppRouter } from "@/hooks/use-app-router"; // plane web hooks -import type { EPageStoreType } from "@/plane-web/hooks/store"; -import { usePageStore } from "@/plane-web/hooks/store"; +import type { EPageStoreType } from "@/hooks/store"; +import { usePageStore } from "@/hooks/store"; // local imports import { PageForm } from "./page-form"; diff --git a/apps/web/core/components/pages/modals/delete-page-modal.tsx b/apps/web/core/components/pages/modals/delete-page-modal.tsx index 937409be65d4..d498bbb0bb79 100644 --- a/apps/web/core/components/pages/modals/delete-page-modal.tsx +++ b/apps/web/core/components/pages/modals/delete-page-modal.tsx @@ -14,8 +14,8 @@ import { getPageName } from "@plane/utils"; // constants // plane web hooks import { useAppRouter } from "@/hooks/use-app-router"; -import type { EPageStoreType } from "@/plane-web/hooks/store"; -import { usePageStore } from "@/plane-web/hooks/store"; +import type { EPageStoreType } from "@/hooks/store"; +import { usePageStore } from "@/hooks/store"; // store import type { TPageInstance } from "@/store/pages/base-page"; diff --git a/apps/web/core/components/pages/navigation-pane/root.tsx b/apps/web/core/components/pages/navigation-pane/root.tsx index 079cf8b5f643..1aa3d2d605d3 100644 --- a/apps/web/core/components/pages/navigation-pane/root.tsx +++ b/apps/web/core/components/pages/navigation-pane/root.tsx @@ -17,7 +17,7 @@ import { useQueryParams } from "@/hooks/use-query-params"; // plane web components import type { TPageNavigationPaneTab } from "@/plane-web/components/pages/navigation-pane"; // store -import type { EPageStoreType } from "@/plane-web/hooks/store"; +import type { EPageStoreType } from "@/hooks/store"; import type { TPageInstance } from "@/store/pages/base-page"; // local imports import type { TPageRootHandlers } from "../editor/page-root"; diff --git a/apps/web/core/components/pages/navigation-pane/types/extensions.ts b/apps/web/core/components/pages/navigation-pane/types/extensions.ts index e24a04957761..89cd3b1833ac 100644 --- a/apps/web/core/components/pages/navigation-pane/types/extensions.ts +++ b/apps/web/core/components/pages/navigation-pane/types/extensions.ts @@ -5,7 +5,7 @@ */ import type { ReactNode } from "react"; -import type { EPageStoreType } from "@/plane-web/hooks/store"; +import type { EPageStoreType } from "@/hooks/store"; import type { TPageInstance } from "@/store/pages/base-page"; export interface INavigationPaneExtensionProps> { diff --git a/apps/web/core/components/pages/pages-list-main-content.tsx b/apps/web/core/components/pages/pages-list-main-content.tsx index adfce6b91002..d835df658a8b 100644 --- a/apps/web/core/components/pages/pages-list-main-content.tsx +++ b/apps/web/core/components/pages/pages-list-main-content.tsx @@ -19,7 +19,7 @@ import { PageLoader } from "@/components/pages/loaders/page-loader"; import { useProject } from "@/hooks/store/use-project"; import { useUserPermissions } from "@/hooks/store/user"; // plane web hooks -import { EPageStoreType, usePageStore } from "@/plane-web/hooks/store"; +import { EPageStoreType, usePageStore } from "@/hooks/store"; type Props = { children: React.ReactNode; diff --git a/apps/web/core/components/pages/pages-list-view.tsx b/apps/web/core/components/pages/pages-list-view.tsx index 1468430a5349..0a90546617e2 100644 --- a/apps/web/core/components/pages/pages-list-view.tsx +++ b/apps/web/core/components/pages/pages-list-view.tsx @@ -7,9 +7,9 @@ import { observer } from "mobx-react"; import useSWR from "swr"; import type { TPageNavigationTabs } from "@plane/types"; -// plane web hooks -import type { EPageStoreType } from "@/plane-web/hooks/store"; -import { usePageStore } from "@/plane-web/hooks/store"; +// hooks +import type { EPageStoreType } from "@/hooks/store"; +import { usePageStore } from "@/hooks/store"; // local imports import { PagesListHeaderRoot } from "./header"; import { PagesListMainContent } from "./pages-list-main-content"; diff --git a/apps/web/core/components/pages/version/editor.tsx b/apps/web/core/components/pages/version/editor.tsx index 4543af5b025d..e9b36ebdd43b 100644 --- a/apps/web/core/components/pages/version/editor.tsx +++ b/apps/web/core/components/pages/version/editor.tsx @@ -17,7 +17,7 @@ import { DocumentEditor } from "@/components/editor/document/editor"; import { useWorkspace } from "@/hooks/store/use-workspace"; import { usePageFilters } from "@/hooks/use-page-filters"; // plane web hooks -import type { EPageStoreType } from "@/plane-web/hooks/store"; +import type { EPageStoreType } from "@/hooks/store"; export type TVersionEditorProps = { activeVersion: string | null; diff --git a/apps/web/core/components/pages/version/main-content.tsx b/apps/web/core/components/pages/version/main-content.tsx index 9c3a502a1b77..5cd3b76794e1 100644 --- a/apps/web/core/components/pages/version/main-content.tsx +++ b/apps/web/core/components/pages/version/main-content.tsx @@ -14,7 +14,7 @@ import { TOAST_TYPE, setToast } from "@plane/propel/toast"; import type { TPageVersion } from "@plane/types"; import { renderFormattedDate, renderFormattedTime } from "@plane/utils"; // helpers -import type { EPageStoreType } from "@/plane-web/hooks/store"; +import type { EPageStoreType } from "@/hooks/store"; // local imports import type { TVersionEditorProps } from "./editor"; diff --git a/apps/web/core/components/pages/version/root.tsx b/apps/web/core/components/pages/version/root.tsx index 81e1b61c6607..775a583cd831 100644 --- a/apps/web/core/components/pages/version/root.tsx +++ b/apps/web/core/components/pages/version/root.tsx @@ -13,7 +13,7 @@ import { cn } from "@plane/utils"; // hooks import { useQueryParams } from "@/hooks/use-query-params"; // plane web imports -import type { EPageStoreType } from "@/plane-web/hooks/store"; +import type { EPageStoreType } from "@/hooks/store"; // local imports import { PAGE_NAVIGATION_PANE_VERSION_QUERY_PARAM, PAGE_NAVIGATION_PANE_WIDTH } from "../navigation-pane"; import type { TVersionEditorProps } from "./editor"; diff --git a/apps/web/core/components/power-k/hooks/use-context-indicator.ts b/apps/web/core/components/power-k/hooks/use-context-indicator.ts index 047d2fb4a077..d8ae42a83b04 100644 --- a/apps/web/core/components/power-k/hooks/use-context-indicator.ts +++ b/apps/web/core/components/power-k/hooks/use-context-indicator.ts @@ -12,7 +12,7 @@ import { useCycle } from "@/hooks/store/use-cycle"; import { useModule } from "@/hooks/store/use-module"; // plane web imports import { useExtendedContextIndicator } from "@/plane-web/components/command-palette/power-k/hooks/use-extended-context-indicator"; -import { EPageStoreType, usePageStore } from "@/plane-web/hooks/store"; +import { EPageStoreType, usePageStore } from "@/hooks/store"; // local imports import type { TPowerKContextType } from "../core/types"; diff --git a/apps/web/core/components/power-k/ui/pages/context-based/page/commands.ts b/apps/web/core/components/power-k/ui/pages/context-based/page/commands.ts index 162ab5406a64..7bbea537826e 100644 --- a/apps/web/core/components/power-k/ui/pages/context-based/page/commands.ts +++ b/apps/web/core/components/power-k/ui/pages/context-based/page/commands.ts @@ -16,7 +16,7 @@ import { copyTextToClipboard } from "@plane/utils"; // components import type { TPowerKCommandConfig } from "@/components/power-k/core/types"; // plane web imports -import { EPageStoreType, usePageStore } from "@/plane-web/hooks/store"; +import { EPageStoreType, usePageStore } from "@/hooks/store"; export const usePowerKPageContextBasedActions = (): TPowerKCommandConfig[] => { // navigation diff --git a/apps/web/core/components/work-item-filters/filters-hoc/base.tsx b/apps/web/core/components/work-item-filters/filters-hoc/base.tsx index 58df7f06e65c..4d361163673d 100644 --- a/apps/web/core/components/work-item-filters/filters-hoc/base.tsx +++ b/apps/web/core/components/work-item-filters/filters-hoc/base.tsx @@ -14,8 +14,8 @@ import type { IIssueFilters, TWorkItemFilterExpression } from "@plane/types"; // store hooks import { useWorkItemFilters } from "@/hooks/store/work-item-filters/use-work-item-filters"; // plane web imports -import type { TWorkItemFiltersEntityProps } from "@/plane-web/hooks/work-item-filters/use-work-item-filters-config"; -import { useWorkItemFiltersConfig } from "@/plane-web/hooks/work-item-filters/use-work-item-filters-config"; +import type { TWorkItemFiltersEntityProps } from "@/hooks/work-item-filters/use-work-item-filters-config"; +import { useWorkItemFiltersConfig } from "@/hooks/work-item-filters/use-work-item-filters-config"; // local imports import type { TSharedWorkItemFiltersHOCProps, TSharedWorkItemFiltersProps } from "./shared"; diff --git a/apps/web/core/components/workspace-notifications/root.tsx b/apps/web/core/components/workspace-notifications/root.tsx index 8dd077c4dc8d..6a9012021c22 100644 --- a/apps/web/core/components/workspace-notifications/root.tsx +++ b/apps/web/core/components/workspace-notifications/root.tsx @@ -18,8 +18,7 @@ import { useWorkspaceNotifications } from "@/hooks/store/notifications"; import { useWorkspace } from "@/hooks/store/use-workspace"; import { useUserPermissions } from "@/hooks/store/user"; import { useWorkspaceIssueProperties } from "@/hooks/use-workspace-issue-properties"; -// plane web imports -import { useNotificationPreview } from "@/plane-web/hooks/use-notification-preview"; +import { useNotificationPreview } from "@/hooks/use-notification-preview"; // local imports import { InboxContentRoot } from "../inbox/content"; diff --git a/apps/web/core/hooks/editor/use-editor-config.ts b/apps/web/core/hooks/editor/use-editor-config.ts index 98eb92c75380..ecc98769f106 100644 --- a/apps/web/core/hooks/editor/use-editor-config.ts +++ b/apps/web/core/hooks/editor/use-editor-config.ts @@ -11,8 +11,8 @@ import { getEditorAssetDownloadSrc, getEditorAssetSrc } from "@plane/utils"; // hooks import { useEditorAsset } from "@/hooks/store/use-editor-asset"; // plane web hooks -import { useExtendedEditorConfig } from "@/plane-web/hooks/editor/use-extended-editor-config"; -import { useFileSize } from "@/plane-web/hooks/use-file-size"; +import { useExtendedEditorConfig } from "@/hooks/editor/use-extended-editor-config"; +import { useFileSize } from "@/hooks/use-file-size"; // services import { FileService } from "@/services/file.service"; const fileService = new FileService(); diff --git a/apps/web/core/hooks/editor/use-editor-mention.tsx b/apps/web/core/hooks/editor/use-editor-mention.tsx index 46aa85229b1c..910accae6a55 100644 --- a/apps/web/core/hooks/editor/use-editor-mention.tsx +++ b/apps/web/core/hooks/editor/use-editor-mention.tsx @@ -14,7 +14,7 @@ import { Avatar } from "@plane/ui"; // helpers import { getFileURL } from "@plane/utils"; // plane web hooks -import { useAdditionalEditorMention } from "@/plane-web/hooks/use-additional-editor-mention"; +import { useAdditionalEditorMention } from "@/hooks/use-additional-editor-mention"; type TArgs = { enableAdvancedMentions?: boolean; diff --git a/apps/web/ce/hooks/editor/use-extended-editor-config.ts b/apps/web/core/hooks/editor/use-extended-editor-config.ts similarity index 100% rename from apps/web/ce/hooks/editor/use-extended-editor-config.ts rename to apps/web/core/hooks/editor/use-extended-editor-config.ts diff --git a/apps/web/ce/hooks/pages/index.ts b/apps/web/core/hooks/pages/index.ts similarity index 100% rename from apps/web/ce/hooks/pages/index.ts rename to apps/web/core/hooks/pages/index.ts index bc7999e282ea..564955b511a7 100644 --- a/apps/web/ce/hooks/pages/index.ts +++ b/apps/web/core/hooks/pages/index.ts @@ -4,5 +4,5 @@ * See the LICENSE file for details. */ -export * from "./use-pages-pane-extensions"; export * from "./use-extended-editor-extensions"; +export * from "./use-pages-pane-extensions"; diff --git a/apps/web/ce/hooks/pages/use-extended-editor-extensions.ts b/apps/web/core/hooks/pages/use-extended-editor-extensions.ts similarity index 94% rename from apps/web/ce/hooks/pages/use-extended-editor-extensions.ts rename to apps/web/core/hooks/pages/use-extended-editor-extensions.ts index cc3b0a213e27..e64837db4a26 100644 --- a/apps/web/ce/hooks/pages/use-extended-editor-extensions.ts +++ b/apps/web/core/hooks/pages/use-extended-editor-extensions.ts @@ -7,7 +7,7 @@ import type { IEditorPropsExtended } from "@plane/editor"; import type { TSearchEntityRequestPayload, TSearchResponse } from "@plane/types"; import type { TPageInstance } from "@/store/pages/base-page"; -import type { EPageStoreType } from "../store"; +import type { EPageStoreType } from "@/hooks/store"; export type TExtendedEditorExtensionsHookParams = { workspaceSlug: string; diff --git a/apps/web/ce/hooks/pages/use-pages-pane-extensions.ts b/apps/web/core/hooks/pages/use-pages-pane-extensions.ts similarity index 100% rename from apps/web/ce/hooks/pages/use-pages-pane-extensions.ts rename to apps/web/core/hooks/pages/use-pages-pane-extensions.ts diff --git a/apps/web/ce/hooks/rich-filters/use-filters-operator-configs.ts b/apps/web/core/hooks/rich-filters/use-filters-operator-configs.ts similarity index 100% rename from apps/web/ce/hooks/rich-filters/use-filters-operator-configs.ts rename to apps/web/core/hooks/rich-filters/use-filters-operator-configs.ts diff --git a/apps/web/ce/hooks/store/index.ts b/apps/web/core/hooks/store/index.ts similarity index 100% rename from apps/web/ce/hooks/store/index.ts rename to apps/web/core/hooks/store/index.ts diff --git a/apps/web/ce/hooks/store/use-page-store.ts b/apps/web/core/hooks/store/use-page-store.ts similarity index 100% rename from apps/web/ce/hooks/store/use-page-store.ts rename to apps/web/core/hooks/store/use-page-store.ts diff --git a/apps/web/ce/hooks/store/use-page.ts b/apps/web/core/hooks/store/use-page.ts similarity index 86% rename from apps/web/ce/hooks/store/use-page.ts rename to apps/web/core/hooks/store/use-page.ts index 7b588321e83d..2afe8b7ae907 100644 --- a/apps/web/ce/hooks/store/use-page.ts +++ b/apps/web/core/hooks/store/use-page.ts @@ -8,8 +8,8 @@ import { useContext } from "react"; // mobx store import { StoreContext } from "@/lib/store-context"; // plane web hooks -import type { EPageStoreType } from "@/plane-web/hooks/store"; -import { usePageStore } from "@/plane-web/hooks/store"; +import type { EPageStoreType } from "./use-page-store"; +import { usePageStore } from "./use-page-store"; export type TArgs = { pageId: string; diff --git a/apps/web/ce/hooks/use-additional-editor-mention.tsx b/apps/web/core/hooks/use-additional-editor-mention.tsx similarity index 100% rename from apps/web/ce/hooks/use-additional-editor-mention.tsx rename to apps/web/core/hooks/use-additional-editor-mention.tsx diff --git a/apps/web/ce/hooks/use-additional-favorite-item-details.tsx b/apps/web/core/hooks/use-additional-favorite-item-details.tsx similarity index 100% rename from apps/web/ce/hooks/use-additional-favorite-item-details.tsx rename to apps/web/core/hooks/use-additional-favorite-item-details.tsx diff --git a/apps/web/ce/hooks/use-bulk-operation-status.ts b/apps/web/core/hooks/use-bulk-operation-status.ts similarity index 100% rename from apps/web/ce/hooks/use-bulk-operation-status.ts rename to apps/web/core/hooks/use-bulk-operation-status.ts diff --git a/apps/web/ce/hooks/use-debounced-duplicate-issues.tsx b/apps/web/core/hooks/use-debounced-duplicate-issues.tsx similarity index 100% rename from apps/web/ce/hooks/use-debounced-duplicate-issues.tsx rename to apps/web/core/hooks/use-debounced-duplicate-issues.tsx diff --git a/apps/web/ce/hooks/use-editor-flagging.ts b/apps/web/core/hooks/use-editor-flagging.ts similarity index 94% rename from apps/web/ce/hooks/use-editor-flagging.ts rename to apps/web/core/hooks/use-editor-flagging.ts index e1841ff666a3..019c62bf5459 100644 --- a/apps/web/ce/hooks/use-editor-flagging.ts +++ b/apps/web/core/hooks/use-editor-flagging.ts @@ -6,7 +6,7 @@ // editor import type { TExtensions } from "@plane/editor"; -import type { EPageStoreType } from "@/plane-web/hooks/store"; +import type { EPageStoreType } from "@/hooks/store"; export type TEditorFlaggingHookReturnType = { document: { diff --git a/apps/web/core/hooks/use-favorite-item-details.tsx b/apps/web/core/hooks/use-favorite-item-details.tsx index ef2a296a0842..18b3d568973a 100644 --- a/apps/web/core/hooks/use-favorite-item-details.tsx +++ b/apps/web/core/hooks/use-favorite-item-details.tsx @@ -19,8 +19,8 @@ import { useModule } from "@/hooks/store/use-module"; import { useProject } from "@/hooks/store/use-project"; import { useProjectView } from "@/hooks/store/use-project-view"; // plane web hooks -import { EPageStoreType, usePage } from "@/plane-web/hooks/store"; -import { useAdditionalFavoriteItemDetails } from "@/plane-web/hooks/use-additional-favorite-item-details"; +import { EPageStoreType, usePage } from "@/hooks/store"; +import { useAdditionalFavoriteItemDetails } from "@/hooks/use-additional-favorite-item-details"; export const useFavoriteItemDetails = (workspaceSlug: string, favorite: IFavorite) => { const { diff --git a/apps/web/ce/hooks/use-file-size.ts b/apps/web/core/hooks/use-file-size.ts similarity index 100% rename from apps/web/ce/hooks/use-file-size.ts rename to apps/web/core/hooks/use-file-size.ts diff --git a/apps/web/ce/hooks/use-issue-properties.tsx b/apps/web/core/hooks/use-issue-properties.tsx similarity index 100% rename from apps/web/ce/hooks/use-issue-properties.tsx rename to apps/web/core/hooks/use-issue-properties.tsx diff --git a/apps/web/ce/hooks/use-notification-preview.tsx b/apps/web/core/hooks/use-notification-preview.tsx similarity index 100% rename from apps/web/ce/hooks/use-notification-preview.tsx rename to apps/web/core/hooks/use-notification-preview.tsx diff --git a/apps/web/ce/hooks/use-page-flag.ts b/apps/web/core/hooks/use-page-flag.ts similarity index 100% rename from apps/web/ce/hooks/use-page-flag.ts rename to apps/web/core/hooks/use-page-flag.ts diff --git a/apps/web/core/hooks/use-parse-editor-content.ts b/apps/web/core/hooks/use-parse-editor-content.ts index 2bd1b820804f..c4b969d24e9a 100644 --- a/apps/web/core/hooks/use-parse-editor-content.ts +++ b/apps/web/core/hooks/use-parse-editor-content.ts @@ -13,7 +13,7 @@ import type { TCustomComponentsMetaData } from "@plane/utils"; // hooks import { useMember } from "@/hooks/store/use-member"; // plane web hooks -import { useAdditionalEditorMention } from "@/plane-web/hooks/use-additional-editor-mention"; +import { useAdditionalEditorMention } from "@/hooks/use-additional-editor-mention"; type TArgs = { projectId?: string; diff --git a/apps/web/core/hooks/use-realtime-page-events.tsx b/apps/web/core/hooks/use-realtime-page-events.tsx index 949fe0397d31..ac0cbdc2dad7 100644 --- a/apps/web/core/hooks/use-realtime-page-events.tsx +++ b/apps/web/core/hooks/use-realtime-page-events.tsx @@ -15,8 +15,8 @@ import type { TEditorBodyHandlers } from "@/components/pages/editor/editor-body" // hooks import { useUser } from "@/hooks/store/user"; import { useAppRouter } from "@/hooks/use-app-router"; -import type { EPageStoreType } from "@/plane-web/hooks/store"; -import { usePageStore } from "@/plane-web/hooks/store"; +import type { EPageStoreType } from "@/hooks/store"; +import { usePageStore } from "@/hooks/store"; // store import type { TPageInstance } from "@/store/pages/base-page"; diff --git a/apps/web/core/hooks/use-timeline-chart.ts b/apps/web/core/hooks/use-timeline-chart.ts index ec8b4f1a0b91..ce9d1d88f077 100644 --- a/apps/web/core/hooks/use-timeline-chart.ts +++ b/apps/web/core/hooks/use-timeline-chart.ts @@ -6,14 +6,33 @@ import { useContext } from "react"; // types -import type { TTimelineType } from "@plane/types"; +import { GANTT_TIMELINE_TYPE, type TTimelineTypeCore, type TTimelineType } from "@plane/types"; // lib import { StoreContext } from "@/lib/store-context"; -// Plane-web -import { getTimelineStore } from "@/plane-web/hooks/use-timeline-chart"; +// plane-web store types import type { IBaseTimelineStore } from "@/plane-web/store/timeline/base-timeline.store"; +import type { ITimelineStore } from "@/plane-web/store/timeline"; import { useTimeLineType } from "../components/gantt-chart/contexts"; +export const getTimelineStore = ( + timelineStore: ITimelineStore, + timelineType: TTimelineTypeCore +): IBaseTimelineStore => { + if (timelineType === GANTT_TIMELINE_TYPE.ISSUE) { + return timelineStore.issuesTimeLineStore as IBaseTimelineStore; + } + if (timelineType === GANTT_TIMELINE_TYPE.MODULE) { + return timelineStore.modulesTimeLineStore as IBaseTimelineStore; + } + if (timelineType === GANTT_TIMELINE_TYPE.PROJECT) { + return timelineStore.projectTimeLineStore; + } + if (timelineType === GANTT_TIMELINE_TYPE.GROUPED) { + return timelineStore.groupedTimeLineStore; + } + throw new Error(`Unknown timeline type: ${timelineType}`); +}; + export const useTimeLineChart = (timelineType: TTimelineType): IBaseTimelineStore => { const context = useContext(StoreContext); if (!context) throw new Error("useTimeLineChart must be used within StoreProvider"); diff --git a/apps/web/ce/hooks/use-workspace-issue-properties-extended.tsx b/apps/web/core/hooks/use-workspace-issue-properties-extended.tsx similarity index 100% rename from apps/web/ce/hooks/use-workspace-issue-properties-extended.tsx rename to apps/web/core/hooks/use-workspace-issue-properties-extended.tsx diff --git a/apps/web/core/hooks/use-workspace-issue-properties.ts b/apps/web/core/hooks/use-workspace-issue-properties.ts index 02388da17289..9ee10990871c 100644 --- a/apps/web/core/hooks/use-workspace-issue-properties.ts +++ b/apps/web/core/hooks/use-workspace-issue-properties.ts @@ -7,7 +7,7 @@ import useSWR from "swr"; // plane web imports import { WORKSPACE_ESTIMATES, WORKSPACE_CYCLES, WORKSPACE_LABELS, WORKSPACE_MODULES } from "@plane/constants"; -import { useWorkspaceIssuePropertiesExtended } from "@/plane-web/hooks/use-workspace-issue-properties-extended"; +import { useWorkspaceIssuePropertiesExtended } from "@/hooks/use-workspace-issue-properties-extended"; // plane imports import { useProjectEstimates } from "./store/estimates"; import { useCycle } from "./store/use-cycle"; diff --git a/apps/web/ce/hooks/work-item-filters/use-work-item-filters-config.tsx b/apps/web/core/hooks/work-item-filters/use-work-item-filters-config.tsx similarity index 99% rename from apps/web/ce/hooks/work-item-filters/use-work-item-filters-config.tsx rename to apps/web/core/hooks/work-item-filters/use-work-item-filters-config.tsx index c4b6f3f0b205..78ac8242b7cf 100644 --- a/apps/web/ce/hooks/work-item-filters/use-work-item-filters-config.tsx +++ b/apps/web/core/hooks/work-item-filters/use-work-item-filters-config.tsx @@ -61,7 +61,7 @@ import { useModule } from "@/hooks/store/use-module"; import { useProject } from "@/hooks/store/use-project"; import { useProjectState } from "@/hooks/store/use-project-state"; // plane web imports -import { useFiltersOperatorConfigs } from "@/plane-web/hooks/rich-filters/use-filters-operator-configs"; +import { useFiltersOperatorConfigs } from "@/hooks/rich-filters/use-filters-operator-configs"; export type TWorkItemFiltersEntityProps = { workspaceSlug: string;