Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Commit

Permalink
fix: typing issue with useTheme hook
Browse files Browse the repository at this point in the history
  • Loading branch information
KaneFreeman committed Nov 16, 2023
1 parent 9260b37 commit 35c7ff2
Show file tree
Hide file tree
Showing 221 changed files with 226 additions and 294 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/actions/__tests__/config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type {
FileOrImageField,
FilesCollection,
FolderCollection,
} from '@staticcms/core/interface';
} from '@staticcms/core';

jest.spyOn(console, 'error').mockImplementation(() => {});
jest.spyOn(console, 'info').mockImplementation(() => {});
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/backends/bitbucket/API.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import get from 'lodash/get';
import { dirname } from 'path';
import { parse } from 'what-the-diff';

import { PreviewState } from '@staticcms/core/interface';
import { PreviewState } from '@staticcms/core';
import {
APIError,
basename,
Expand Down Expand Up @@ -32,7 +32,7 @@ import {
} from '@staticcms/core/lib/util/APIUtils';

import type { WorkflowStatus } from '@staticcms/core/constants/publishModes';
import type { DataFile, PersistOptions, UnpublishedEntry } from '@staticcms/core/interface';
import type { DataFile, PersistOptions, UnpublishedEntry } from '@staticcms/core';
import type { ApiRequest, FetchError } from '@staticcms/core/lib/util';
import type AssetProxy from '@staticcms/core/valueObjects/AssetProxy';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Login from '@staticcms/core/components/login/Login';
import { ImplicitAuthenticator, NetlifyAuthenticator } from '@staticcms/core/lib/auth';
import useTranslate from '@staticcms/core/lib/hooks/useTranslate';

import type { AuthenticationPageProps } from '@staticcms/core/interface';
import type { AuthenticationPageProps } from '@staticcms/core';
import type { FC, MouseEvent } from 'react';

const BitbucketAuthenticationPage: FC<AuthenticationPageProps> = ({
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/backends/bitbucket/implementation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import type {
PersistOptions,
UnpublishedEntry,
User,
} from '@staticcms/core/interface';
} from '@staticcms/core';
import type { ApiRequest, AsyncLock, Cursor, FetchError } from '@staticcms/core/lib/util';
import type AssetProxy from '@staticcms/core/valueObjects/AssetProxy';
import type { Semaphore } from 'semaphore';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react';
import Login from '@staticcms/core/components/login/Login';
import useTranslate from '@staticcms/core/lib/hooks/useTranslate';

import type { AuthenticationPageProps, User } from '@staticcms/core/interface';
import type { AuthenticationPageProps, User } from '@staticcms/core';
import type { FC } from 'react';

function useNetlifyIdentifyEvent(eventName: 'login', callback: (login: User) => void): void;
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/backends/git-gateway/implementation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import pick from 'lodash/pick';
import React, { useCallback } from 'react';

import { WorkflowStatus } from '@staticcms/core/constants/publishModes';
import { PreviewState } from '@staticcms/core/interface';
import { PreviewState } from '@staticcms/core';
import {
AccessTokenError,
APIError,
Expand Down Expand Up @@ -38,7 +38,7 @@ import type {
PersistOptions,
UnpublishedEntry,
User,
} from '@staticcms/core/interface';
} from '@staticcms/core';
import type { ApiRequest, Cursor } from '@staticcms/core/lib/util';
import type AssetProxy from '@staticcms/core/valueObjects/AssetProxy';
import type { FC } from 'react';
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/backends/gitea/API.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
unsentRequest,
} from '@staticcms/core/lib/util';

import type { DataFile, PersistOptions } from '@staticcms/core/interface';
import type { DataFile, PersistOptions } from '@staticcms/core';
import type { ApiRequest, FetchError } from '@staticcms/core/lib/util';
import type AssetProxy from '@staticcms/core/valueObjects/AssetProxy';
import type { Semaphore } from 'semaphore';
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/backends/gitea/AuthenticationPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Login from '@staticcms/core/components/login/Login';
import { PkceAuthenticator } from '@staticcms/core/lib/auth';
import useTranslate from '@staticcms/core/lib/hooks/useTranslate';

import type { AuthenticationPageProps } from '@staticcms/core/interface';
import type { AuthenticationPageProps } from '@staticcms/core';
import type { FC, MouseEvent } from 'react';

const GiteaAuthenticationPage: FC<AuthenticationPageProps> = ({
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/backends/gitea/implementation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import type {
PersistOptions,
UnpublishedEntry,
User,
} from '@staticcms/core/interface';
} from '@staticcms/core';
import type { AsyncLock } from '@staticcms/core/lib/util';
import type AssetProxy from '@staticcms/core/valueObjects/AssetProxy';
import type { Semaphore } from 'semaphore';
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/backends/github/API.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import trimStart from 'lodash/trimStart';
import { dirname } from 'path';

import { WorkflowStatus } from '@staticcms/core/constants/publishModes';
import { PreviewState } from '@staticcms/core/interface';
import { PreviewState } from '@staticcms/core';
import {
APIError,
EditorialWorkflowError,
Expand All @@ -33,7 +33,7 @@ import {
} from '@staticcms/core/lib/util/APIUtils';
import { GitHubCommitStatusState, PullRequestState } from './types';

import type { DataFile, PersistOptions, UnpublishedEntry } from '@staticcms/core/interface';
import type { DataFile, PersistOptions, UnpublishedEntry } from '@staticcms/core';
import type { ApiRequest, FetchError } from '@staticcms/core/lib/util';
import type AssetProxy from '@staticcms/core/valueObjects/AssetProxy';
import type { Semaphore } from 'semaphore';
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/backends/github/AuthenticationPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import useCurrentBackend from '@staticcms/core/lib/hooks/useCurrentBackend';
import useTranslate from '@staticcms/core/lib/hooks/useTranslate';
import { generateClassNames } from '@staticcms/core/lib/util/theming.util';

import type { AuthenticationPageProps, User } from '@staticcms/core/interface';
import type { AuthenticationPageProps, User } from '@staticcms/core';
import type { FC, MouseEvent } from 'react';
import type GitHub from './implementation';

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/backends/github/implementation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import type {
UnpublishedEntry,
UnpublishedEntryMediaFile,
User,
} from '@staticcms/core/interface';
} from '@staticcms/core';
import type { AsyncLock } from '@staticcms/core/lib/util';
import type AssetProxy from '@staticcms/core/valueObjects/AssetProxy';
import type { Semaphore } from 'semaphore';
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/backends/gitlab/API.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import result from 'lodash/result';
import trimStart from 'lodash/trimStart';
import { dirname } from 'path';

import { PreviewState } from '@staticcms/core/interface';
import { PreviewState } from '@staticcms/core';
import {
APIError,
Cursor,
Expand All @@ -31,7 +31,7 @@ import {
} from '@staticcms/core/lib/util/APIUtils';

import type { WorkflowStatus } from '@staticcms/core/constants/publishModes';
import type { DataFile, PersistOptions, UnpublishedEntry } from '@staticcms/core/interface';
import type { DataFile, PersistOptions, UnpublishedEntry } from '@staticcms/core';
import type { ApiRequest, FetchError } from '@staticcms/core/lib/util';
import type AssetProxy from '@staticcms/core/valueObjects/AssetProxy';

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/backends/gitlab/AuthenticationPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { NetlifyAuthenticator, PkceAuthenticator } from '@staticcms/core/lib/aut
import useTranslate from '@staticcms/core/lib/hooks/useTranslate';
import { isNotEmpty } from '@staticcms/core/lib/util/string.util';

import type { AuthenticationPageProps, AuthenticatorConfig } from '@staticcms/core/interface';
import type { AuthenticationPageProps, AuthenticatorConfig } from '@staticcms/core';
import type { FC, MouseEvent } from 'react';

const clientSideAuthenticators = {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/backends/gitlab/__tests__/gitlab.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import type {
ConfigWithDefaults,
FilesCollectionWithDefaults,
FolderCollectionWithDefaults,
} from '@staticcms/core/interface';
} from '@staticcms/core';
import type { RootState } from '@staticcms/core/store';
import type { FetchMethod } from '@staticcms/test/mockFetch';

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/backends/gitlab/implementation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import type {
UnpublishedEntry,
UnpublishedEntryMediaFile,
User,
} from '@staticcms/core/interface';
} from '@staticcms/core';
import type { AsyncLock, Cursor } from '@staticcms/core/lib/util';
import type AssetProxy from '@staticcms/core/valueObjects/AssetProxy';
import type { Semaphore } from 'semaphore';
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/backends/proxy/AuthenticationPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useCallback } from 'react';

import Login from '@staticcms/core/components/login/Login';

import type { AuthenticationPageProps } from '@staticcms/core/interface';
import type { AuthenticationPageProps } from '@staticcms/core';
import type { FC, MouseEvent } from 'react';

const AuthenticationPage: FC<AuthenticationPageProps> = ({ inProgress = false, onLogin }) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/backends/proxy/implementation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import type {
PersistOptions,
UnpublishedEntry,
User,
} from '@staticcms/core/interface';
} from '@staticcms/core';
import type { Cursor } from '@staticcms/core/lib/util';
import type AssetProxy from '@staticcms/core/valueObjects/AssetProxy';

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/backends/test/AuthenticationPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useCallback, useEffect } from 'react';

import Login from '@staticcms/core/components/login/Login';

import type { AuthenticationPageProps } from '@staticcms/core/interface';
import type { AuthenticationPageProps } from '@staticcms/core';
import type { FC, MouseEvent } from 'react';

const AuthenticationPage: FC<AuthenticationPageProps> = ({
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/backends/test/implementation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import type {
PersistOptions,
UnpublishedEntry,
User,
} from '@staticcms/core/interface';
} from '@staticcms/core';

type RepoFile = { path: string; content: string | AssetProxy; isDirectory?: boolean };
type RepoTree = { [key: string]: RepoFile | RepoTree };
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import ThemeManager from './theme/ThemeManager';
import useTheme from './theme/hooks/useTheme';
import Dashboard from './workflow/Dashboard';

import type { Credentials } from '@staticcms/core/interface';
import type { Credentials } from '@staticcms/core';
import type { RootState } from '@staticcms/core/store';
import type { FC } from 'react';
import type { ConnectedProps } from 'react-redux';
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/components/ErrorBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { localForage } from '@staticcms/core/lib/util';
import useTranslate from '../lib/hooks/useTranslate';
import { generateClassNames } from '../lib/util/theming.util';

import type { Config, TranslatedProps } from '@staticcms/core/interface';
import type { Config, TranslatedProps } from '@staticcms/core';
import type { FC, ReactNode } from 'react';

import './ErrorBoundary.css';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type {
SortMap,
ViewFilter,
ViewGroup,
} from '@staticcms/core/interface';
} from '@staticcms/core';
import type { FC } from 'react';

interface CollectionControlsProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { addFileTemplateFields } from '@staticcms/core/lib/widgets/stringTemplat
import Button from '../common/button/Button';
import collectionClasses from './Collection.classes';

import type { CollectionWithDefaults, Entry } from '@staticcms/core/interface';
import type { CollectionWithDefaults, Entry } from '@staticcms/core';
import type { FC } from 'react';

interface CollectionHeaderProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import useBreadcrumbs from '@staticcms/core/lib/hooks/useBreadcrumbs';
import MainView from '../MainView';
import CollectionView from './CollectionView';

import type { CollectionWithDefaults } from '@staticcms/core/interface';
import type { CollectionWithDefaults } from '@staticcms/core';
import type { FC } from 'react';

const MultiSearchCollectionPage: FC = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
import useTranslate from '@staticcms/core/lib/hooks/useTranslate';
import { generateClassNames } from '@staticcms/core/lib/util/theming.util';

import type { CollectionWithDefaults, CollectionsWithDefaults } from '@staticcms/core/interface';
import type { CollectionWithDefaults, CollectionsWithDefaults } from '@staticcms/core';
import type { ChangeEvent, FC, FocusEvent, KeyboardEvent, MouseEvent } from 'react';

import './CollectionSearch.css';
Expand Down
7 changes: 1 addition & 6 deletions packages/core/src/components/collections/CollectionView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,7 @@ import EntriesCollection from './entries/EntriesCollection';
import EntriesSearch from './entries/EntriesSearch';

import type { ViewStyle } from '@staticcms/core/constants/views';
import type {
CollectionWithDefaults,
SortDirection,
ViewFilter,
ViewGroup,
} from '@staticcms/core/interface';
import type { CollectionWithDefaults, SortDirection, ViewFilter, ViewGroup } from '@staticcms/core';
import type { FC } from 'react';

import './Collection.css';
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/components/collections/FilterControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Menu from '../common/menu/Menu';
import MenuGroup from '../common/menu/MenuGroup';
import MenuItemButton from '../common/menu/MenuItemButton';

import type { FilterMap, ViewFilter } from '@staticcms/core/interface';
import type { FilterMap, ViewFilter } from '@staticcms/core';
import type { MouseEvent, FC } from 'react';

import './FilterControl.css';
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/components/collections/GroupControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Menu from '../common/menu/Menu';
import MenuGroup from '../common/menu/MenuGroup';
import MenuItemButton from '../common/menu/MenuItemButton';

import type { GroupMap, ViewGroup } from '@staticcms/core/interface';
import type { GroupMap, ViewGroup } from '@staticcms/core';
import type { FC, MouseEvent } from 'react';

import './GroupControl.css';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { getTreeData } from '@staticcms/core/lib/util/nested.util';
import { generateClassNames } from '@staticcms/core/lib/util/theming.util';
import NavLink from '../navbar/NavLink';

import type { CollectionWithDefaults, Entry } from '@staticcms/core/interface';
import type { CollectionWithDefaults, Entry } from '@staticcms/core';
import type { TreeNodeData } from '@staticcms/core/lib/util/nested.util';
import type { FC, MouseEvent } from 'react';

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/components/collections/SortControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Menu from '../common/menu/Menu';
import MenuGroup from '../common/menu/MenuGroup';
import MenuItemButton from '../common/menu/MenuItemButton';

import type { SortableField, SortDirection, SortMap } from '@staticcms/core/interface';
import type { SortableField, SortDirection, SortMap } from '@staticcms/core';
import type { FC, MouseEvent } from 'react';

import './SortControl.css';
Expand Down
6 changes: 1 addition & 5 deletions packages/core/src/components/collections/entries/Entries.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ import entriesClasses from './Entries.classes';
import EntryListing from './EntryListing';

import type { ViewStyle } from '@staticcms/core/constants/views';
import type {
CollectionWithDefaults,
CollectionsWithDefaults,
Entry,
} from '@staticcms/core/interface';
import type { CollectionWithDefaults, CollectionsWithDefaults, Entry } from '@staticcms/core';
import type Cursor from '@staticcms/core/lib/util/Cursor';
import type { FC } from 'react';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import Entries from './Entries';
import entriesClasses from './Entries.classes';

import type { ViewStyle } from '@staticcms/core/constants/views';
import type { CollectionWithDefaults, Entry, GroupOfEntries } from '@staticcms/core/interface';
import type { CollectionWithDefaults, Entry, GroupOfEntries } from '@staticcms/core';
import type { RootState } from '@staticcms/core/store';
import type { FC } from 'react';
import type { t } from 'react-polyglot';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { selectSearchedEntries } from '@staticcms/core/reducers/selectors/entrie
import Entries from './Entries';

import type { ViewStyle } from '@staticcms/core/constants/views';
import type { CollectionsWithDefaults } from '@staticcms/core/interface';
import type { CollectionsWithDefaults } from '@staticcms/core';
import type { RootState } from '@staticcms/core/store';
import type { FC } from 'react';
import type { ConnectedProps } from 'react-redux';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import type {
DateTimeFormats,
Entry,
FileOrImageField,
} from '@staticcms/core/interface';
} from '@staticcms/core';
import type { FC, ReactNode } from 'react';

import './EntryCard.css';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import type {
DateTimeField,
Entry,
Field,
} from '@staticcms/core/interface';
} from '@staticcms/core';
import type Cursor from '@staticcms/core/lib/util/Cursor';
import type { FC } from 'react';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { useAppSelector } from '@staticcms/core/store/hooks';
import entriesClasses from './Entries.classes';
import EntryCard from './EntryCard';

import type { CollectionEntryData } from '@staticcms/core/interface';
import type { CollectionEntryData } from '@staticcms/core';
import type { FC } from 'react';
import type { GridChildComponentProps } from 'react-window';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useAppSelector } from '@staticcms/core/store/hooks';
import entriesClasses from './Entries.classes';
import EntryListingCardGrid from './EntryListingCardGrid';

import type { CollectionEntryData } from '@staticcms/core/interface';
import type { CollectionEntryData } from '@staticcms/core';
import type { FC } from 'react';

export interface EntryListingGridProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Table from '../../common/table/Table';
import entriesClasses from './Entries.classes';
import EntryRow from './EntryRow';

import type { CollectionEntryData } from '@staticcms/core/interface';
import type { CollectionEntryData } from '@staticcms/core';
import type { FC } from 'react';

export interface EntryListingTableProps {
Expand Down
Loading

0 comments on commit 35c7ff2

Please sign in to comment.