refactor: move web utils to packages (#7145)
* refactor: move web utils to packages * fix: build and lint errors * chore: update drag handle plugin * chore: update table cell type to fix build errors * fix: build errors * chore: sync few changes * fix: build errors * chore: minor fixes related to duplicate assets imports * fix: build errors * chore: minor changes
This commit is contained in:
parent
dffcc6dc10
commit
2014400bed
614 changed files with 1999 additions and 3030 deletions
|
|
@ -2,8 +2,7 @@ import { observer } from "mobx-react";
|
|||
import { X } from "lucide-react";
|
||||
// helpers
|
||||
import { PROJECT_CREATED_AT_FILTER_OPTIONS } from "@plane/constants";
|
||||
import { renderFormattedDate } from "@/helpers/date-time.helper";
|
||||
import { capitalizeFirstLetter } from "@/helpers/string.helper";
|
||||
import { renderFormattedDate, capitalizeFirstLetter } from "@plane/utils";
|
||||
// constants
|
||||
|
||||
type Props = {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { X } from "lucide-react";
|
|||
// ui
|
||||
import { Avatar } from "@plane/ui";
|
||||
// helpers
|
||||
import { getFileURL } from "@/helpers/file.helper";
|
||||
import { getFileURL } from "@plane/utils";
|
||||
// types
|
||||
import { useMember } from "@/hooks/store";
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import { TProjectAppliedDisplayFilterKeys, TProjectFilters } from "@plane/types"
|
|||
// ui
|
||||
import { EHeaderVariant, Header, Tag, Tooltip } from "@plane/ui";
|
||||
// components
|
||||
import { replaceUnderscoreIfSnakeCase } from "@plane/utils";
|
||||
import {
|
||||
AppliedAccessFilters,
|
||||
AppliedDateFilters,
|
||||
|
|
@ -15,7 +16,6 @@ import {
|
|||
AppliedProjectDisplayFilters,
|
||||
} from "@/components/project";
|
||||
// helpers
|
||||
import { replaceUnderscoreIfSnakeCase } from "@/helpers/string.helper";
|
||||
|
||||
type Props = {
|
||||
appliedFilters: TProjectFilters;
|
||||
|
|
|
|||
|
|
@ -5,11 +5,10 @@ import { observer } from "mobx-react";
|
|||
import Link from "next/link";
|
||||
import { useParams } from "next/navigation";
|
||||
import { ArchiveRestoreIcon, Check, ExternalLink, LinkIcon, Lock, Settings, Trash2, UserPlus } from "lucide-react";
|
||||
// types
|
||||
// plane imports
|
||||
import { EUserPermissions, EUserPermissionsLevel, IS_FAVORITE_MENU_OPEN } from "@plane/constants";
|
||||
import { useLocalStorage } from "@plane/hooks";
|
||||
import type { IProject } from "@plane/types";
|
||||
// ui
|
||||
import {
|
||||
Avatar,
|
||||
AvatarGroup,
|
||||
|
|
@ -22,19 +21,14 @@ import {
|
|||
TContextMenuItem,
|
||||
FavoriteStar,
|
||||
} from "@plane/ui";
|
||||
import { copyUrlToClipboard } from "@plane/utils";
|
||||
import { copyUrlToClipboard, cn, getFileURL, renderFormattedDate } from "@plane/utils";
|
||||
// components
|
||||
import { Logo } from "@/components/common";
|
||||
import { Logo } from "@/components/common/logo";
|
||||
import { ArchiveRestoreProjectModal, DeleteProjectModal, JoinProjectModal } from "@/components/project";
|
||||
// helpers
|
||||
import { cn } from "@/helpers/common.helper";
|
||||
import { renderFormattedDate } from "@/helpers/date-time.helper";
|
||||
import { getFileURL } from "@/helpers/file.helper";
|
||||
// hooks
|
||||
import { useMember, useProject, useUserPermissions } from "@/hooks/store";
|
||||
import { useAppRouter } from "@/hooks/use-app-router";
|
||||
import { usePlatformOS } from "@/hooks/use-platform-os";
|
||||
// plane-web constants
|
||||
|
||||
type Props = {
|
||||
project: IProject;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
import { useEffect, FC, useState } from "react";
|
||||
// plane ui
|
||||
import { EModalPosition, EModalWidth, ModalCore } from "@plane/ui";
|
||||
import { getAssetIdFromUrl, checkURLValidity } from "@plane/utils";
|
||||
// plane ui
|
||||
// helpers
|
||||
import { getAssetIdFromUrl } from "@/helpers/file.helper";
|
||||
import { checkURLValidity } from "@/helpers/string.helper";
|
||||
// hooks
|
||||
import useKeypress from "@/hooks/use-keypress";
|
||||
// plane web components
|
||||
|
|
|
|||
|
|
@ -6,11 +6,9 @@ import { ETabIndices } from "@plane/constants";
|
|||
import { useTranslation } from "@plane/i18n";
|
||||
// ui
|
||||
import { Input, TextArea, Tooltip } from "@plane/ui";
|
||||
import { cn, projectIdentifierSanitizer, getTabIndex } from "@plane/utils";
|
||||
// plane utils
|
||||
import { cn } from "@plane/utils";
|
||||
// helpers
|
||||
import { projectIdentifierSanitizer } from "@/helpers/project.helper";
|
||||
import { getTabIndex } from "@/helpers/tab-indices.helper";
|
||||
// plane-web types
|
||||
import { TProject } from "@/plane-web/types/projects";
|
||||
|
||||
|
|
|
|||
|
|
@ -8,12 +8,10 @@ import { useTranslation } from "@plane/i18n";
|
|||
import { IProject } from "@plane/types";
|
||||
// plane ui
|
||||
import { CustomEmojiIconPicker, EmojiIconPickerTypes, Logo } from "@plane/ui";
|
||||
import { convertHexEmojiToDecimal, getFileURL, getTabIndex } from "@plane/utils";
|
||||
// components
|
||||
import { ImagePickerPopover } from "@/components/core";
|
||||
// helpers
|
||||
import { convertHexEmojiToDecimal } from "@/helpers/emoji.helper";
|
||||
import { getFileURL } from "@/helpers/file.helper";
|
||||
import { getTabIndex } from "@/helpers/tab-indices.helper";
|
||||
// plane web imports
|
||||
import { ProjectTemplateSelect } from "@/plane-web/components/projects/create/template-select";
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { IProject } from "@plane/types";
|
|||
// ui
|
||||
import { Button } from "@plane/ui";
|
||||
// helpers
|
||||
import { getTabIndex } from "@/helpers/tab-indices.helper";
|
||||
import { getTabIndex } from "@plane/utils";
|
||||
|
||||
type Props = {
|
||||
handleClose: () => void;
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@ import { observer } from "mobx-react";
|
|||
// plane constants
|
||||
import { PROJECT_CREATED_AT_FILTER_OPTIONS } from "@plane/constants";
|
||||
// components
|
||||
import { isInDateFormat } from "@plane/utils";
|
||||
import { DateFilterModal } from "@/components/core";
|
||||
import { FilterHeader, FilterOption } from "@/components/issues";
|
||||
|
||||
// helpers
|
||||
import { isInDateFormat } from "@/helpers/date-time.helper";
|
||||
|
||||
type Props = {
|
||||
appliedFilters: string[] | null;
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@ import { observer } from "mobx-react";
|
|||
// plane ui
|
||||
import { Avatar, Loader } from "@plane/ui";
|
||||
// components
|
||||
import { getFileURL } from "@plane/utils";
|
||||
import { FilterHeader, FilterOption } from "@/components/issues";
|
||||
// helpers
|
||||
import { getFileURL } from "@/helpers/file.helper";
|
||||
// hooks
|
||||
import { useMember, useUser } from "@/hooks/store";
|
||||
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@ import { observer } from "mobx-react";
|
|||
// plane ui
|
||||
import { Avatar, Loader } from "@plane/ui";
|
||||
// components
|
||||
import { getFileURL } from "@plane/utils";
|
||||
import { FilterHeader, FilterOption } from "@/components/issues";
|
||||
// helpers
|
||||
import { getFileURL } from "@/helpers/file.helper";
|
||||
// hooks
|
||||
import { useMember, useUser } from "@/hooks/store";
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import { TProjectOrderByOptions } from "@plane/types";
|
|||
// ui
|
||||
import { CustomMenu, getButtonStyling } from "@plane/ui";
|
||||
// helpers
|
||||
import { cn } from "@/helpers/common.helper";
|
||||
import { cn } from "@plane/utils";
|
||||
// types
|
||||
// constants
|
||||
|
||||
|
|
|
|||
|
|
@ -6,13 +6,12 @@ import { ListFilter } from "lucide-react";
|
|||
import { useTranslation } from "@plane/i18n";
|
||||
// plane types
|
||||
import { TProjectFilters } from "@plane/types";
|
||||
import { cn, calculateTotalFilters } from "@plane/utils";
|
||||
// plane utils
|
||||
import { cn } from "@plane/utils";
|
||||
// components
|
||||
import { FiltersDropdown } from "@/components/issues";
|
||||
import { ProjectFiltersSelection, ProjectOrderByDropdown } from "@/components/project";
|
||||
// helpers
|
||||
import { calculateTotalFilters } from "@/helpers/filter.helper";
|
||||
// hooks
|
||||
import { useMember, useProjectFilter } from "@/hooks/store";
|
||||
|
||||
|
|
|
|||
|
|
@ -19,15 +19,13 @@ import {
|
|||
EmojiIconPickerTypes,
|
||||
Tooltip,
|
||||
} from "@plane/ui";
|
||||
import { renderFormattedDate, convertHexEmojiToDecimal, getFileURL } from "@plane/utils";
|
||||
// components
|
||||
import { Logo } from "@/components/common";
|
||||
import { ImagePickerPopover } from "@/components/core";
|
||||
import { TimezoneSelect } from "@/components/global";
|
||||
import { ProjectNetworkIcon } from "@/components/project";
|
||||
// helpers
|
||||
import { renderFormattedDate } from "@/helpers/date-time.helper";
|
||||
import { convertHexEmojiToDecimal } from "@/helpers/emoji.helper";
|
||||
import { getFileURL } from "@/helpers/file.helper";
|
||||
// hooks
|
||||
import { useEventTracker, useProject } from "@/hooks/store";
|
||||
import { usePlatformOS } from "@/hooks/use-platform-os";
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import { Ban } from "lucide-react";
|
|||
import { EUserProjectRoles } from "@plane/constants";
|
||||
import { Avatar, CustomSearchSelect } from "@plane/ui";
|
||||
// helpers
|
||||
import { getFileURL } from "@/helpers/file.helper";
|
||||
import { getFileURL } from "@plane/utils";
|
||||
// hooks
|
||||
import { useMember } from "@/hooks/store";
|
||||
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@ import { Combobox } from "@headlessui/react";
|
|||
import { useTranslation } from "@plane/i18n";
|
||||
import { Button, Checkbox, EModalPosition, EModalWidth, ModalCore } from "@plane/ui";
|
||||
// components
|
||||
import { cn } from "@plane/utils";
|
||||
import { Logo } from "@/components/common";
|
||||
import { SimpleEmptyState } from "@/components/empty-state";
|
||||
// helpers
|
||||
import { cn } from "@/helpers/common.helper";
|
||||
// hooks
|
||||
import { useProject } from "@/hooks/store";
|
||||
import { useResolvedAssetPath } from "@/hooks/use-resolved-asset-path";
|
||||
|
|
|
|||
|
|
@ -6,12 +6,12 @@ import { useParams } from "next/navigation";
|
|||
import { Controller, useForm } from "react-hook-form";
|
||||
import { Check, ExternalLink, Globe2 } from "lucide-react";
|
||||
// types
|
||||
import { SPACE_BASE_PATH, SPACE_BASE_URL } from "@plane/constants";
|
||||
import { IProject, TProjectPublishLayouts, TProjectPublishSettings } from "@plane/types";
|
||||
// ui
|
||||
import { Button, Loader, ToggleSwitch, TOAST_TYPE, setToast, CustomSelect, ModalCore, EModalWidth } from "@plane/ui";
|
||||
// helpers
|
||||
import { SPACE_BASE_PATH, SPACE_BASE_URL } from "@/helpers/common.helper";
|
||||
import { copyTextToClipboard } from "@/helpers/string.helper";
|
||||
import { copyTextToClipboard } from "@plane/utils";
|
||||
// hooks
|
||||
import { useProjectPublish } from "@/hooks/store";
|
||||
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@ import { useParams, usePathname } from "next/navigation";
|
|||
import { useTranslation } from "@plane/i18n";
|
||||
import { TProjectAppliedDisplayFilterKeys, TProjectFilters } from "@plane/types";
|
||||
// components
|
||||
import { PageHead } from "@/components/core";
|
||||
import { calculateTotalFilters } from "@plane/utils";
|
||||
import { PageHead } from "@/components/core/page-title";
|
||||
import { ProjectAppliedFiltersList, ProjectCardList } from "@/components/project";
|
||||
// helpers
|
||||
import { calculateTotalFilters } from "@/helpers/filter.helper";
|
||||
// hooks
|
||||
import { useProject, useProjectFilter, useWorkspace } from "@/hooks/store";
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import { useOutsideClickDetector } from "@plane/hooks";
|
|||
// i18n
|
||||
import { useTranslation } from "@plane/i18n";
|
||||
// helpers
|
||||
import { cn } from "@/helpers/common.helper";
|
||||
import { cn } from "@plane/utils";
|
||||
// hooks
|
||||
import { useProjectFilter } from "@/hooks/store";
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import { ROLE, PROJECT_MEMBER_ADDED, EUserPermissions } from "@plane/constants";
|
|||
import { useTranslation } from "@plane/i18n";
|
||||
import { Avatar, Button, CustomSelect, CustomSearchSelect, TOAST_TYPE, setToast } from "@plane/ui";
|
||||
// helpers
|
||||
import { getFileURL } from "@/helpers/file.helper";
|
||||
import { getFileURL } from "@plane/utils";
|
||||
// hooks
|
||||
import { useEventTracker, useMember, useUserPermissions } from "@/hooks/store";
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue