Extract shlink-web-component outside of src folder

This commit is contained in:
Alejandro Celaya 2023-07-24 20:14:59 +02:00
parent 768fb1992f
commit 3a0cea1268
230 changed files with 485 additions and 524 deletions

View file

@ -7,8 +7,8 @@
"license": "MIT",
"scripts": {
"lint": "npm run lint:css && npm run lint:js",
"lint:css": "stylelint src/*.scss src/**/*.scss",
"lint:js": "eslint --ext .js,.ts,.tsx src test",
"lint:css": "stylelint src/*.scss src/**/*.scss shlink-web-component/*.scss shlink-web-component/**/*.scss",
"lint:js": "eslint --ext .js,.ts,.tsx src shlink-web-component test",
"lint:fix": "npm run lint:css:fix && npm run lint:js:fix",
"lint:css:fix": "npm run lint:css -- --fix",
"lint:js:fix": "npm run lint:js -- --fix",

View file

@ -4,12 +4,16 @@ import classNames from 'classnames';
import type { FC } from 'react';
import { useEffect } from 'react';
import { Navigate, Route, Routes, useLocation } from 'react-router-dom';
import { AsideMenu } from '../common/AsideMenu';
import { NotFound } from '../common/NotFound';
import { useSwipeable, useToggle } from '../utils/helpers/hooks';
import { AsideMenu } from '../src/common/AsideMenu';
import { NotFound } from '../src/common/NotFound';
import { useSwipeable, useToggle } from '../src/utils/helpers/hooks';
import { useFeature } from './utils/features';
import { useRoutesPrefix } from './utils/routesPrefix';
type MainProps = {
loadMercureInfo: () => void;
};
export const Main = (
TagsList: FC,
ShortUrlsList: FC,
@ -22,12 +26,17 @@ export const Main = (
Overview: FC,
EditShortUrl: FC,
ManageDomains: FC,
): FC => () => {
): FC<MainProps> => ({ loadMercureInfo }) => {
const location = useLocation();
const routesPrefix = useRoutesPrefix();
const [sidebarVisible, toggleSidebar, showSidebar, hideSidebar] = useToggle();
useEffect(() => hideSidebar(), [location]);
// FIXME Re-load mercure info every time server changes
// useEffect(() => {
// loadMercureInfo();
// }, []);
const addDomainVisitsRoute = useFeature('domainVisits');
const burgerClasses = classNames('menu-layout__burger-icon', { 'menu-layout__burger-icon--active': sidebarVisible });
const swipeableProps = useSwipeable(showSidebar, hideSidebar);

View file

@ -3,7 +3,7 @@ import type Bottle from 'bottlejs';
import type { FC, ReactNode } from 'react';
import { useEffect, useRef, useState } from 'react';
import { Provider } from 'react-redux';
import type { SemVer } from '../utils/helpers/version';
import type { SemVer } from '../src/utils/helpers/version';
import type { ShlinkApiClient } from './api-contract';
import { setUpStore } from './container/store';
import { FeaturesProvider, useFeatures } from './utils/features';

View file

@ -1,5 +1,5 @@
import type { Order } from '../../utils/helpers/ordering';
import type { OptionalString } from '../../utils/utils';
import type { Order } from '../../src/utils/helpers/ordering';
import type { OptionalString } from '../../src/utils/utils';
import type { ShortUrl, ShortUrlMeta } from '../short-urls/data';
import type { Visit } from '../visits/types';

View file

@ -2,13 +2,13 @@ import type { IContainer } from 'bottlejs';
import Bottle from 'bottlejs';
import { pick } from 'ramda';
import { connect as reduxConnect } from 'react-redux/es/exports';
import { HttpClient } from '../../common/services/HttpClient';
import { ImageDownloader } from '../../common/services/ImageDownloader';
import { ReportExporter } from '../../common/services/ReportExporter';
import { csvToJson, jsonToCsv } from '../../utils/helpers/csvjson';
import { useTimeoutToggle } from '../../utils/helpers/hooks';
import { ColorGenerator } from '../../utils/services/ColorGenerator';
import { LocalStorage } from '../../utils/services/LocalStorage';
import { HttpClient } from '../../src/common/services/HttpClient';
import { ImageDownloader } from '../../src/common/services/ImageDownloader';
import { ReportExporter } from '../../src/common/services/ReportExporter';
import { csvToJson, jsonToCsv } from '../../src/utils/helpers/csvjson';
import { useTimeoutToggle } from '../../src/utils/helpers/hooks';
import { ColorGenerator } from '../../src/utils/services/ColorGenerator';
import { LocalStorage } from '../../src/utils/services/LocalStorage';
import { provideServices as provideDomainsServices } from '../domains/services/provideServices';
import { provideServices as provideMercureServices } from '../mercure/services/provideServices';
import { provideServices as provideOverviewServices } from '../overview/services/provideServices';
@ -38,7 +38,7 @@ const connect: ConnectDecorator = (propsFromState: string[] | null, actionServic
actionServiceNames.reduce(mapActionService, {}),
);
provideWebComponentServices(bottle);
provideWebComponentServices(bottle, connect);
provideShortUrlsServices(bottle, connect);
provideTagsServices(bottle, connect);
provideVisitsServices(bottle, connect);

View file

@ -1,7 +1,8 @@
import type Bottle from 'bottlejs';
import { Main } from '../Main';
import type { ConnectDecorator } from './index';
export const provideServices = (bottle: Bottle) => {
export const provideServices = (bottle: Bottle, connect: ConnectDecorator) => {
bottle.serviceFactory(
'Main',
Main,
@ -17,4 +18,6 @@ export const provideServices = (bottle: Bottle) => {
'EditShortUrl',
'ManageDomains',
);
bottle.decorator('Main', connect(null, ['loadMercureInfo']));
};

View file

@ -3,7 +3,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import type { FC } from 'react';
import { useEffect } from 'react';
import { UncontrolledTooltip } from 'reactstrap';
import type { OptionalString } from '../../utils/utils';
import type { OptionalString } from '../../src/utils/utils';
import type { ShlinkDomainRedirects } from '../api-contract';
import type { Domain } from './data';
import { DomainDropdown } from './helpers/DomainDropdown';

View file

@ -1,5 +1,5 @@
@import '../../utils/base';
@import '../../utils/mixins/vertical-align';
@import '../../src/utils/base';
@import '../../src/utils/mixins/vertical-align';
.domains-dropdown__toggle-btn.domains-dropdown__toggle-btn,
.domains-dropdown__toggle-btn.domains-dropdown__toggle-btn:hover,

View file

@ -4,8 +4,8 @@ import { isEmpty, pipe } from 'ramda';
import { useEffect } from 'react';
import type { InputProps } from 'reactstrap';
import { Button, DropdownItem, Input, InputGroup, UncontrolledTooltip } from 'reactstrap';
import { DropdownBtn } from '../../utils/DropdownBtn';
import { useToggle } from '../../utils/helpers/hooks';
import { DropdownBtn } from '../../src/utils/DropdownBtn';
import { useToggle } from '../../src/utils/helpers/hooks';
import type { DomainsList } from './reducers/domainsList';
import './DomainSelector.scss';

View file

@ -1,10 +1,10 @@
import type { FC } from 'react';
import { useEffect } from 'react';
import { ShlinkApiError } from '../../api/ShlinkApiError';
import { Message } from '../../utils/Message';
import { Result } from '../../utils/Result';
import { SearchField } from '../../utils/SearchField';
import { SimpleCard } from '../../utils/SimpleCard';
import { ShlinkApiError } from '../../src/api/ShlinkApiError';
import { Message } from '../../src/utils/Message';
import { Result } from '../../src/utils/Result';
import { SearchField } from '../../src/utils/SearchField';
import { SimpleCard } from '../../src/utils/SimpleCard';
import { DomainRow } from './DomainRow';
import type { EditDomainRedirects } from './reducers/domainRedirects';
import type { DomainsList } from './reducers/domainsList';

View file

@ -3,8 +3,8 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import type { FC } from 'react';
import { Link } from 'react-router-dom';
import { DropdownItem } from 'reactstrap';
import { useToggle } from '../../../utils/helpers/hooks';
import { RowDropdownBtn } from '../../../utils/RowDropdownBtn';
import { useToggle } from '../../../src/utils/helpers/hooks';
import { RowDropdownBtn } from '../../../src/utils/RowDropdownBtn';
import { useFeature } from '../../utils/features';
import { useRoutesPrefix } from '../../utils/routesPrefix';
import { DEFAULT_DOMAIN } from '../../visits/reducers/domainVisits';

View file

@ -8,8 +8,8 @@ import type { FC } from 'react';
import { useEffect, useState } from 'react';
import { ExternalLink } from 'react-external-link';
import { UncontrolledTooltip } from 'reactstrap';
import { useElementRef } from '../../../utils/helpers/hooks';
import type { MediaMatcher } from '../../../utils/types';
import { useElementRef } from '../../../src/utils/helpers/hooks';
import type { MediaMatcher } from '../../../src/utils/types';
import type { DomainStatus } from '../data';
interface DomainStatusIconProps {

View file

@ -2,10 +2,10 @@ import type { FC } from 'react';
import { useState } from 'react';
import { Button, Modal, ModalBody, ModalFooter, ModalHeader } from 'reactstrap';
import type { ShlinkDomain } from '../../../api/types';
import type { InputFormGroupProps } from '../../../utils/forms/InputFormGroup';
import { InputFormGroup } from '../../../utils/forms/InputFormGroup';
import { InfoTooltip } from '../../../utils/InfoTooltip';
import { handleEventPreventingDefault, nonEmptyValueOrNull } from '../../../utils/utils';
import type { InputFormGroupProps } from '../../../src/utils/forms/InputFormGroup';
import { InputFormGroup } from '../../../src/utils/forms/InputFormGroup';
import { InfoTooltip } from '../../../src/utils/InfoTooltip';
import { handleEventPreventingDefault, nonEmptyValueOrNull } from '../../../src/utils/utils';
import type { EditDomainRedirects } from '../reducers/domainRedirects';
interface EditDomainRedirectsModalProps {

View file

@ -1,4 +1,4 @@
import { createAsyncThunk } from '../../../utils/helpers/redux';
import { createAsyncThunk } from '../../../src/utils/helpers/redux';
import type { ShlinkApiClient, ShlinkDomainRedirects } from '../../api-contract';
const EDIT_DOMAIN_REDIRECTS = 'shlink/domainRedirects/EDIT_DOMAIN_REDIRECTS';

View file

@ -1,6 +1,6 @@
import type { AsyncThunk, SliceCaseReducers } from '@reduxjs/toolkit';
import { createAction, createSlice } from '@reduxjs/toolkit';
import { createAsyncThunk } from '../../../utils/helpers/redux';
import { createAsyncThunk } from '../../../src/utils/helpers/redux';
import type { ProblemDetailsError, ShlinkApiClient, ShlinkDomainRedirects } from '../../api-contract';
import { parseApiError } from '../../api-contract/utils';
import type { Domain, DomainStatus } from '../data';

View file

@ -23,6 +23,7 @@ export function boundToMercureHub<T = {}>(
const { interval } = mercureInfo;
const params = useParams();
// Every time mercure info changes, re-bind
useEffect(() => {
const onMessage = (visit: CreateVisit) => (interval ? pendingUpdates.add(visit) : createNewVisits([visit]));
const topics = getTopicsForProps(props, params);

View file

@ -1,5 +1,5 @@
import { createSlice } from '@reduxjs/toolkit';
import { createAsyncThunk } from '../../../utils/helpers/redux';
import { createAsyncThunk } from '../../../src/utils/helpers/redux';
import type { ShlinkApiClient, ShlinkMercureInfo } from '../../api-contract';
const REDUCER_PREFIX = 'shlink/mercure';

View file

@ -2,7 +2,7 @@ import type { FC } from 'react';
import { useEffect } from 'react';
import { Link, useNavigate } from 'react-router-dom';
import { Card, CardBody, CardHeader, Row } from 'reactstrap';
import { prettify } from '../../utils/helpers/numbers';
import { prettify } from '../../src/utils/helpers/numbers';
import type { ShlinkShortUrlsListParams } from '../api-contract';
import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub';
import { Topics } from '../mercure/helpers/Topics';

View file

@ -1,4 +1,4 @@
@import '../../../utils/base';
@import '../../../src/utils/base';
.highlight-card.highlight-card {
text-align: center;

View file

@ -3,7 +3,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import type { FC, PropsWithChildren, ReactNode } from 'react';
import { Link } from 'react-router-dom';
import { Card, CardText, CardTitle, UncontrolledTooltip } from 'reactstrap';
import { useElementRef } from '../../../utils/helpers/hooks';
import { useElementRef } from '../../../src/utils/helpers/hooks';
import './HighlightCard.scss';
export type HighlightCardProps = PropsWithChildren<{

View file

@ -1,5 +1,5 @@
import type { FC } from 'react';
import { prettify } from '../../../utils/helpers/numbers';
import { prettify } from '../../../src/utils/helpers/numbers';
import type { PartialVisitsSummary } from '../../visits/reducers/visitsOverview';
import type { HighlightCardProps } from './HighlightCard';
import { HighlightCard } from './HighlightCard';

View file

@ -5,11 +5,11 @@ import { useEffect, useMemo } from 'react';
import { ExternalLink } from 'react-external-link';
import { useLocation, useParams } from 'react-router-dom';
import { Button, Card } from 'reactstrap';
import { ShlinkApiError } from '../../api/ShlinkApiError';
import { useGoBack } from '../../utils/helpers/hooks';
import { parseQuery } from '../../utils/helpers/query';
import { Message } from '../../utils/Message';
import { Result } from '../../utils/Result';
import { ShlinkApiError } from '../../src/api/ShlinkApiError';
import { useGoBack } from '../../src/utils/helpers/hooks';
import { parseQuery } from '../../src/utils/helpers/query';
import { Message } from '../../src/utils/Message';
import { Result } from '../../src/utils/Result';
import { useSetting } from '../utils/settings';
import type { ShortUrlIdentifier } from './data';
import { shortUrlDataFromShortUrl, urlDecodeShortCode } from './helpers';

View file

@ -1,13 +1,13 @@
import { Link } from 'react-router-dom';
import { Pagination, PaginationItem, PaginationLink } from 'reactstrap';
import type {
NumberOrEllipsis } from '../../utils/helpers/pagination';
NumberOrEllipsis } from '../../src/utils/helpers/pagination';
import {
keyForPage,
pageIsEllipsis,
prettifyPageNumber,
progressivePagination,
} from '../../utils/helpers/pagination';
} from '../../src/utils/helpers/pagination';
import type { ShlinkPaginator } from '../api-contract';
import { useRoutesPrefix } from '../utils/routesPrefix';

View file

@ -1,4 +1,4 @@
@import '../../utils/base';
@import '../../src/utils/base';
.short-url-form p:last-child {
margin-bottom: 0;

View file

@ -8,13 +8,13 @@ import type { ChangeEvent, FC } from 'react';
import { useEffect, useState } from 'react';
import { Button, FormGroup, Input, Row } from 'reactstrap';
import type { InputType } from 'reactstrap/types/lib/Input';
import { Checkbox } from '../../utils/Checkbox';
import type { DateTimeInputProps } from '../../utils/dates/DateTimeInput';
import { DateTimeInput } from '../../utils/dates/DateTimeInput';
import { formatIsoDate } from '../../utils/helpers/date';
import { IconInput } from '../../utils/IconInput';
import { SimpleCard } from '../../utils/SimpleCard';
import { handleEventPreventingDefault, hasValue } from '../../utils/utils';
import { Checkbox } from '../../src/utils/Checkbox';
import type { DateTimeInputProps } from '../../src/utils/dates/DateTimeInput';
import { DateTimeInput } from '../../src/utils/dates/DateTimeInput';
import { formatIsoDate } from '../../src/utils/helpers/date';
import { IconInput } from '../../src/utils/IconInput';
import { SimpleCard } from '../../src/utils/SimpleCard';
import { handleEventPreventingDefault, hasValue } from '../../src/utils/utils';
import type { DomainSelectorProps } from '../domains/DomainSelector';
import type { TagsSelectorProps } from '../tags/helpers/TagsSelector';
import { useFeature } from '../utils/features';

View file

@ -4,13 +4,13 @@ import classNames from 'classnames';
import { isEmpty, pipe } from 'ramda';
import type { FC } from 'react';
import { Button, InputGroup, Row, UncontrolledTooltip } from 'reactstrap';
import { DateRangeSelector } from '../../utils/dates/DateRangeSelector';
import { formatIsoDate } from '../../utils/helpers/date';
import type { DateRange } from '../../utils/helpers/dateIntervals';
import { datesToDateRange } from '../../utils/helpers/dateIntervals';
import type { OrderDir } from '../../utils/helpers/ordering';
import { OrderingDropdown } from '../../utils/OrderingDropdown';
import { SearchField } from '../../utils/SearchField';
import { DateRangeSelector } from '../../src/utils/dates/DateRangeSelector';
import { formatIsoDate } from '../../src/utils/helpers/date';
import type { DateRange } from '../../src/utils/helpers/dateIntervals';
import { datesToDateRange } from '../../src/utils/helpers/dateIntervals';
import type { OrderDir } from '../../src/utils/helpers/ordering';
import { OrderingDropdown } from '../../src/utils/OrderingDropdown';
import { SearchField } from '../../src/utils/SearchField';
import type { TagsSelectorProps } from '../tags/helpers/TagsSelector';
import { useFeature } from '../utils/features';
import { useSetting } from '../utils/settings';

View file

@ -2,10 +2,10 @@ import { pipe } from 'ramda';
import { useEffect, useState } from 'react';
import { useLocation, useParams } from 'react-router-dom';
import { Card } from 'reactstrap';
import { DEFAULT_SHORT_URLS_ORDERING } from '../../settings/reducers/settings';
import type { OrderDir } from '../../utils/helpers/ordering';
import { determineOrderDir } from '../../utils/helpers/ordering';
import { TableOrderIcon } from '../../utils/table/TableOrderIcon';
import { DEFAULT_SHORT_URLS_ORDERING } from '../../src/settings/reducers/settings';
import type { OrderDir } from '../../src/utils/helpers/ordering';
import { determineOrderDir } from '../../src/utils/helpers/ordering';
import { TableOrderIcon } from '../../src/utils/table/TableOrderIcon';
import type { ShlinkShortUrlsListParams, ShlinkShortUrlsOrder } from '../api-contract';
import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub';
import { Topics } from '../mercure/helpers/Topics';

View file

@ -1,7 +1,7 @@
import { faInfoCircle as infoIcon } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { Modal, ModalBody, ModalHeader } from 'reactstrap';
import { useToggle } from '../../utils/helpers/hooks';
import { useToggle } from '../../src/utils/helpers/hooks';
import './UseExistingIfFoundInfoIcon.scss';
const InfoModal = ({ isOpen, toggle }: { isOpen: boolean; toggle: () => void }) => (

View file

@ -1,6 +1,6 @@
import type { ShlinkVisitsSummary } from '../../../api/types';
import type { Order } from '../../../utils/helpers/ordering';
import type { Nullable, OptionalString } from '../../../utils/utils';
import type { Order } from '../../../src/utils/helpers/ordering';
import type { Nullable, OptionalString } from '../../../src/utils/utils';
export interface DeviceLongUrls {
android?: OptionalString;

View file

@ -4,9 +4,9 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { useEffect } from 'react';
import CopyToClipboard from 'react-copy-to-clipboard';
import { Tooltip } from 'reactstrap';
import { ShlinkApiError } from '../../../api/ShlinkApiError';
import type { TimeoutToggle } from '../../../utils/helpers/hooks';
import { Result } from '../../../utils/Result';
import { ShlinkApiError } from '../../../src/api/ShlinkApiError';
import type { TimeoutToggle } from '../../../src/utils/helpers/hooks';
import { Result } from '../../../src/utils/Result';
import type { ShortUrlCreation } from '../reducers/shortUrlCreation';
import './CreateShortUrlResult.scss';

View file

@ -1,9 +1,9 @@
import { pipe } from 'ramda';
import { useEffect, useState } from 'react';
import { Modal, ModalBody, ModalFooter, ModalHeader } from 'reactstrap';
import { ShlinkApiError } from '../../../api/ShlinkApiError';
import { Result } from '../../../utils/Result';
import { handleEventPreventingDefault } from '../../../utils/utils';
import { ShlinkApiError } from '../../../src/api/ShlinkApiError';
import { Result } from '../../../src/utils/Result';
import { handleEventPreventingDefault } from '../../../src/utils/utils';
import { isInvalidDeletionError } from '../../api-contract/utils';
import type { ShortUrlIdentifier, ShortUrlModalProps } from '../data';
import type { ShortUrlDeletion } from '../reducers/shortUrlDeletion';

View file

@ -1,8 +1,8 @@
import type { FC } from 'react';
import { useCallback } from 'react';
import type { ReportExporter } from '../../../common/services/ReportExporter';
import { ExportBtn } from '../../../utils/ExportBtn';
import { useToggle } from '../../../utils/helpers/hooks';
import type { ReportExporter } from '../../../src/common/services/ReportExporter';
import { ExportBtn } from '../../../src/utils/ExportBtn';
import { useToggle } from '../../../src/utils/helpers/hooks';
import type { ShlinkApiClient } from '../../api-contract';
import type { ShortUrl } from '../data';
import { useShortUrlsQuery } from './hooks';

View file

@ -3,10 +3,10 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { useMemo, useState } from 'react';
import { ExternalLink } from 'react-external-link';
import { Button, FormGroup, Modal, ModalBody, ModalHeader, Row } from 'reactstrap';
import type { ImageDownloader } from '../../../common/services/ImageDownloader';
import { CopyToClipboardIcon } from '../../../utils/CopyToClipboardIcon';
import type { QrCodeFormat, QrErrorCorrection } from '../../../utils/helpers/qrCodes';
import { buildQrCodeUrl } from '../../../utils/helpers/qrCodes';
import type { ImageDownloader } from '../../../src/common/services/ImageDownloader';
import { CopyToClipboardIcon } from '../../../src/utils/CopyToClipboardIcon';
import type { QrCodeFormat, QrErrorCorrection } from '../../../src/utils/helpers/qrCodes';
import { buildQrCodeUrl } from '../../../src/utils/helpers/qrCodes';
import type { ShortUrlModalProps } from '../data';
import { QrErrorCorrectionDropdown } from './qr-codes/QrErrorCorrectionDropdown';
import { QrFormatDropdown } from './qr-codes/QrFormatDropdown';

View file

@ -1,6 +1,6 @@
import type { ChangeEvent, FC, PropsWithChildren } from 'react';
import { Checkbox } from '../../../utils/Checkbox';
import { InfoTooltip } from '../../../utils/InfoTooltip';
import { Checkbox } from '../../../src/utils/Checkbox';
import { InfoTooltip } from '../../../src/utils/InfoTooltip';
type ShortUrlFormCheckboxGroupProps = PropsWithChildren<{
checked?: boolean;

View file

@ -4,8 +4,8 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { isBefore } from 'date-fns';
import type { FC, ReactNode } from 'react';
import { UncontrolledTooltip } from 'reactstrap';
import { formatHumanFriendly, now, parseISO } from '../../../utils/helpers/date';
import { useElementRef } from '../../../utils/helpers/hooks';
import { formatHumanFriendly, now, parseISO } from '../../../src/utils/helpers/date';
import { useElementRef } from '../../../src/utils/helpers/hooks';
import type { ShortUrl } from '../data';
interface ShortUrlStatusProps {

View file

@ -2,9 +2,9 @@ import { faInfoCircle as infoIcon } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import classNames from 'classnames';
import { UncontrolledTooltip } from 'reactstrap';
import { formatHumanFriendly, parseISO } from '../../../utils/helpers/date';
import { useElementRef } from '../../../utils/helpers/hooks';
import { prettify } from '../../../utils/helpers/numbers';
import { formatHumanFriendly, parseISO } from '../../../src/utils/helpers/date';
import { useElementRef } from '../../../src/utils/helpers/hooks';
import { prettify } from '../../../src/utils/helpers/numbers';
import type { ShortUrl } from '../data';
import { ShortUrlDetailLink } from './ShortUrlDetailLink';
import './ShortUrlVisitsCount.scss';

View file

@ -1,6 +1,6 @@
import { DropdownItem } from 'reactstrap';
import { DropdownBtn } from '../../../utils/DropdownBtn';
import { hasValue } from '../../../utils/utils';
import { DropdownBtn } from '../../../src/utils/DropdownBtn';
import { hasValue } from '../../../src/utils/utils';
import type { ShortUrlsFilter } from '../data';
interface ShortUrlsFilterDropdownProps {

View file

@ -1,6 +1,6 @@
@import '../../../utils/base';
@import '../../../utils/mixins/text-ellipsis';
@import '../../../utils/mixins/vertical-align';
@import '../../../src/utils/base';
@import '../../../src/utils/mixins/text-ellipsis';
@import '../../../src/utils/mixins/vertical-align';
.short-urls-row__cell.short-urls-row__cell {
vertical-align: middle !important;

View file

@ -1,10 +1,10 @@
import type { FC } from 'react';
import { useEffect, useRef } from 'react';
import { ExternalLink } from 'react-external-link';
import { CopyToClipboardIcon } from '../../../utils/CopyToClipboardIcon';
import { Time } from '../../../utils/dates/Time';
import type { TimeoutToggle } from '../../../utils/helpers/hooks';
import type { ColorGenerator } from '../../../utils/services/ColorGenerator';
import { CopyToClipboardIcon } from '../../../src/utils/CopyToClipboardIcon';
import { Time } from '../../../src/utils/dates/Time';
import type { TimeoutToggle } from '../../../src/utils/helpers/hooks';
import type { ColorGenerator } from '../../../src/utils/services/ColorGenerator';
import { useSetting } from '../../utils/settings';
import type { ShortUrl } from '../data';
import { useShortUrlsQuery } from './hooks';

View file

@ -7,8 +7,8 @@ import {
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import type { FC } from 'react';
import { DropdownItem } from 'reactstrap';
import { useToggle } from '../../../utils/helpers/hooks';
import { RowDropdownBtn } from '../../../utils/RowDropdownBtn';
import { useToggle } from '../../../src/utils/helpers/hooks';
import { RowDropdownBtn } from '../../../src/utils/RowDropdownBtn';
import type { ShortUrl, ShortUrlModalProps } from '../data';
import { ShortUrlDetailLink } from './ShortUrlDetailLink';

View file

@ -1,6 +1,6 @@
import { isEmpty } from 'ramda';
import type { FC } from 'react';
import type { ColorGenerator } from '../../../utils/services/ColorGenerator';
import type { ColorGenerator } from '../../../src/utils/services/ColorGenerator';
import { Tag } from '../../tags/helpers/Tag';
interface TagsProps {

View file

@ -1,10 +1,10 @@
import { isEmpty, pipe } from 'ramda';
import { useMemo } from 'react';
import { useLocation, useNavigate } from 'react-router-dom';
import { orderToString, stringToOrder } from '../../../utils/helpers/ordering';
import { parseQuery, stringifyQuery } from '../../../utils/helpers/query';
import type { BooleanString } from '../../../utils/utils';
import { parseOptionalBooleanToString } from '../../../utils/utils';
import { orderToString, stringToOrder } from '../../../src/utils/helpers/ordering';
import { parseQuery, stringifyQuery } from '../../../src/utils/helpers/query';
import type { BooleanString } from '../../../src/utils/utils';
import { parseOptionalBooleanToString } from '../../../src/utils/utils';
import type { TagsFilteringMode } from '../../api-contract';
import { useRoutesPrefix } from '../../utils/routesPrefix';
import type { ShortUrlsOrder, ShortUrlsOrderableFields } from '../data';

View file

@ -1,5 +1,5 @@
import { isNil } from 'ramda';
import type { OptionalString } from '../../../utils/utils';
import type { OptionalString } from '../../../src/utils/utils';
import type { ShortUrlCreationSettings } from '../../utils/settings';
import { DEFAULT_DOMAIN } from '../../visits/reducers/domainVisits';
import type { ShortUrl, ShortUrlData } from '../data';

View file

@ -1,7 +1,7 @@
import type { FC } from 'react';
import { DropdownItem } from 'reactstrap';
import { DropdownBtn } from '../../../../utils/DropdownBtn';
import type { QrErrorCorrection } from '../../../../utils/helpers/qrCodes';
import { DropdownBtn } from '../../../../src/utils/DropdownBtn';
import type { QrErrorCorrection } from '../../../../src/utils/helpers/qrCodes';
interface QrErrorCorrectionDropdownProps {
errorCorrection: QrErrorCorrection;

View file

@ -1,7 +1,7 @@
import type { FC } from 'react';
import { DropdownItem } from 'reactstrap';
import { DropdownBtn } from '../../../../utils/DropdownBtn';
import type { QrCodeFormat } from '../../../../utils/helpers/qrCodes';
import { DropdownBtn } from '../../../../src/utils/DropdownBtn';
import type { QrCodeFormat } from '../../../../src/utils/helpers/qrCodes';
interface QrFormatDropdownProps {
format: QrCodeFormat;

View file

@ -1,6 +1,6 @@
import type { PayloadAction } from '@reduxjs/toolkit';
import { createSlice } from '@reduxjs/toolkit';
import { createAsyncThunk } from '../../../utils/helpers/redux';
import { createAsyncThunk } from '../../../src/utils/helpers/redux';
import type { ProblemDetailsError, ShlinkApiClient } from '../../api-contract';
import { parseApiError } from '../../api-contract/utils';
import type { ShortUrl, ShortUrlData } from '../data';

View file

@ -1,5 +1,5 @@
import { createAction, createSlice } from '@reduxjs/toolkit';
import { createAsyncThunk } from '../../../utils/helpers/redux';
import { createAsyncThunk } from '../../../src/utils/helpers/redux';
import type { ProblemDetailsError, ShlinkApiClient } from '../../api-contract';
import { parseApiError } from '../../api-contract/utils';
import type { ShortUrl, ShortUrlIdentifier } from '../data';

View file

@ -1,6 +1,6 @@
import type { PayloadAction } from '@reduxjs/toolkit';
import { createSlice } from '@reduxjs/toolkit';
import { createAsyncThunk } from '../../../utils/helpers/redux';
import { createAsyncThunk } from '../../../src/utils/helpers/redux';
import type { ProblemDetailsError, ShlinkApiClient } from '../../api-contract';
import { parseApiError } from '../../api-contract/utils';
import type { ShortUrl, ShortUrlIdentifier } from '../data';

View file

@ -1,6 +1,6 @@
import type { PayloadAction } from '@reduxjs/toolkit';
import { createSlice } from '@reduxjs/toolkit';
import { createAsyncThunk } from '../../../utils/helpers/redux';
import { createAsyncThunk } from '../../../src/utils/helpers/redux';
import type { ProblemDetailsError, ShlinkApiClient } from '../../api-contract';
import { parseApiError } from '../../api-contract/utils';
import type { EditShortUrlData, ShortUrl, ShortUrlIdentifier } from '../data';

View file

@ -1,6 +1,6 @@
import { createSlice } from '@reduxjs/toolkit';
import { assocPath, last, pipe, reject } from 'ramda';
import { createAsyncThunk } from '../../../utils/helpers/redux';
import { createAsyncThunk } from '../../../src/utils/helpers/redux';
import type { ShlinkApiClient, ShlinkShortUrlsListParams, ShlinkShortUrlsResponse } from '../../api-contract';
import { createNewVisits } from '../../visits/reducers/visitCreation';
import type { ShortUrl } from '../data';

View file

@ -2,12 +2,12 @@ import { pipe } from 'ramda';
import type { FC } from 'react';
import { useEffect, useState } from 'react';
import { Row } from 'reactstrap';
import { ShlinkApiError } from '../../api/ShlinkApiError';
import { determineOrderDir, sortList } from '../../utils/helpers/ordering';
import { Message } from '../../utils/Message';
import { OrderingDropdown } from '../../utils/OrderingDropdown';
import { Result } from '../../utils/Result';
import { SearchField } from '../../utils/SearchField';
import { ShlinkApiError } from '../../src/api/ShlinkApiError';
import { determineOrderDir, sortList } from '../../src/utils/helpers/ordering';
import { Message } from '../../src/utils/Message';
import { OrderingDropdown } from '../../src/utils/OrderingDropdown';
import { Result } from '../../src/utils/Result';
import { SearchField } from '../../src/utils/SearchField';
import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub';
import { Topics } from '../mercure/helpers/Topics';
import { useSettings } from '../utils/settings';

View file

@ -1,5 +1,5 @@
@import '../../utils/base';
@import '../../utils/mixins/sticky-cell';
@import '../../src/utils/base';
@import '../../src/utils/mixins/sticky-cell';
.tags-table__header-cell.tags-table__header-cell {
@include sticky-cell(false);

View file

@ -2,11 +2,11 @@ import { splitEvery } from 'ramda';
import type { FC } from 'react';
import { useEffect, useRef } from 'react';
import { useLocation } from 'react-router-dom';
import { SimplePaginator } from '../../common/SimplePaginator';
import { useQueryState } from '../../utils/helpers/hooks';
import { parseQuery } from '../../utils/helpers/query';
import { SimpleCard } from '../../utils/SimpleCard';
import { TableOrderIcon } from '../../utils/table/TableOrderIcon';
import { SimplePaginator } from '../../src/common/SimplePaginator';
import { useQueryState } from '../../src/utils/helpers/hooks';
import { parseQuery } from '../../src/utils/helpers/query';
import { SimpleCard } from '../../src/utils/SimpleCard';
import { TableOrderIcon } from '../../src/utils/table/TableOrderIcon';
import type { TagsListChildrenProps, TagsOrder, TagsOrderableFields } from './data/TagsListChildrenProps';
import type { TagsTableRowProps } from './TagsTableRow';
import './TagsTable.scss';

View file

@ -3,10 +3,10 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import type { FC } from 'react';
import { Link } from 'react-router-dom';
import { DropdownItem } from 'reactstrap';
import { useToggle } from '../../utils/helpers/hooks';
import { prettify } from '../../utils/helpers/numbers';
import { RowDropdownBtn } from '../../utils/RowDropdownBtn';
import type { ColorGenerator } from '../../utils/services/ColorGenerator';
import { useToggle } from '../../src/utils/helpers/hooks';
import { prettify } from '../../src/utils/helpers/numbers';
import { RowDropdownBtn } from '../../src/utils/RowDropdownBtn';
import type { ColorGenerator } from '../../src/utils/services/ColorGenerator';
import { useRoutesPrefix } from '../utils/routesPrefix';
import type { SimplifiedTag, TagModalProps } from './data';
import { TagBullet } from './helpers/TagBullet';

View file

@ -1,4 +1,4 @@
import type { Order } from '../../../utils/helpers/ordering';
import type { Order } from '../../../src/utils/helpers/ordering';
import type { SimplifiedTag } from './index';
export const TAGS_ORDERABLE_FIELDS = {

View file

@ -1,6 +1,6 @@
import { Button, Modal, ModalBody, ModalFooter, ModalHeader } from 'reactstrap';
import { ShlinkApiError } from '../../../api/ShlinkApiError';
import { Result } from '../../../utils/Result';
import { ShlinkApiError } from '../../../src/api/ShlinkApiError';
import { Result } from '../../../src/utils/Result';
import type { TagModalProps } from '../data';
import type { TagDeletion } from '../reducers/tagDelete';

View file

@ -4,11 +4,11 @@ import { pipe } from 'ramda';
import { useState } from 'react';
import { HexColorPicker } from 'react-colorful';
import { Button, Input, InputGroup, Modal, ModalBody, ModalFooter, ModalHeader, Popover } from 'reactstrap';
import { ShlinkApiError } from '../../../api/ShlinkApiError';
import { useToggle } from '../../../utils/helpers/hooks';
import { Result } from '../../../utils/Result';
import type { ColorGenerator } from '../../../utils/services/ColorGenerator';
import { handleEventPreventingDefault } from '../../../utils/utils';
import { ShlinkApiError } from '../../../src/api/ShlinkApiError';
import { useToggle } from '../../../src/utils/helpers/hooks';
import { Result } from '../../../src/utils/Result';
import type { ColorGenerator } from '../../../src/utils/services/ColorGenerator';
import { handleEventPreventingDefault } from '../../../src/utils/utils';
import type { TagModalProps } from '../data';
import type { EditTag, TagEdition } from '../reducers/tagEdit';
import './EditTagModal.scss';

View file

@ -1,6 +1,6 @@
import classNames from 'classnames';
import type { FC, MouseEventHandler, PropsWithChildren } from 'react';
import type { ColorGenerator } from '../../../utils/services/ColorGenerator';
import type { ColorGenerator } from '../../../src/utils/services/ColorGenerator';
import './Tag.scss';
type TagProps = PropsWithChildren<{

View file

@ -1,4 +1,4 @@
import type { ColorGenerator } from '../../../utils/services/ColorGenerator';
import type { ColorGenerator } from '../../../src/utils/services/ColorGenerator';
import './TagBullet.scss';
interface TagBulletProps {

View file

@ -1,7 +1,7 @@
import { useEffect } from 'react';
import type { SuggestionComponentProps, TagComponentProps } from 'react-tag-autocomplete';
import ReactTags from 'react-tag-autocomplete';
import type { ColorGenerator } from '../../../utils/services/ColorGenerator';
import type { ColorGenerator } from '../../../src/utils/services/ColorGenerator';
import { useSetting } from '../../utils/settings';
import type { TagsList } from '../reducers/tagsList';
import { Tag } from './Tag';

View file

@ -1,5 +1,5 @@
import { createAction, createSlice } from '@reduxjs/toolkit';
import { createAsyncThunk } from '../../../utils/helpers/redux';
import { createAsyncThunk } from '../../../src/utils/helpers/redux';
import type { ProblemDetailsError, ShlinkApiClient } from '../../api-contract';
import { parseApiError } from '../../api-contract/utils';

View file

@ -1,8 +1,8 @@
import type { PayloadAction } from '@reduxjs/toolkit';
import { createAction, createSlice } from '@reduxjs/toolkit';
import { pick } from 'ramda';
import { createAsyncThunk } from '../../../utils/helpers/redux';
import type { ColorGenerator } from '../../../utils/services/ColorGenerator';
import { createAsyncThunk } from '../../../src/utils/helpers/redux';
import type { ColorGenerator } from '../../../src/utils/services/ColorGenerator';
import type { ProblemDetailsError, ShlinkApiClient } from '../../api-contract';
import { parseApiError } from '../../api-contract/utils';

View file

@ -1,6 +1,6 @@
import { createAction, createSlice } from '@reduxjs/toolkit';
import { isEmpty, reject } from 'ramda';
import { createAsyncThunk } from '../../../utils/helpers/redux';
import { createAsyncThunk } from '../../../src/utils/helpers/redux';
import type { ProblemDetailsError, ShlinkApiClient, ShlinkTags } from '../../api-contract';
import { parseApiError } from '../../api-contract/utils';
import type { createShortUrl } from '../../short-urls/reducers/shortUrlCreation';

View file

@ -1,6 +1,6 @@
import { createContext, useContext, useMemo } from 'react';
import type { SemVer } from '../../utils/helpers/version';
import { versionMatch } from '../../utils/helpers/version';
import type { SemVer } from '../../src/utils/helpers/version';
import { versionMatch } from '../../src/utils/helpers/version';
const supportedFeatures = {
domainVisits: '3.1.0',

View file

@ -1,6 +1,6 @@
import { createContext, useContext } from 'react';
import type { DateInterval } from '../../utils/helpers/dateIntervals';
import type { Theme } from '../../utils/theme';
import type { DateInterval } from '../../src/utils/helpers/dateIntervals';
import type { Theme } from '../../src/utils/theme';
import type { ShortUrlsOrder } from '../short-urls/data';
import type { TagsOrder } from '../tags/data/TagsListChildrenProps';

View file

@ -1,6 +1,6 @@
import { useParams } from 'react-router-dom';
import type { ReportExporter } from '../../common/services/ReportExporter';
import { useGoBack } from '../../utils/helpers/hooks';
import type { ReportExporter } from '../../src/common/services/ReportExporter';
import { useGoBack } from '../../src/utils/helpers/hooks';
import type { ShlinkVisitsParams } from '../api-contract';
import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub';
import { Topics } from '../mercure/helpers/Topics';

View file

@ -1,5 +1,5 @@
import type { ReportExporter } from '../../common/services/ReportExporter';
import { useGoBack } from '../../utils/helpers/hooks';
import type { ReportExporter } from '../../src/common/services/ReportExporter';
import { useGoBack } from '../../src/utils/helpers/hooks';
import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub';
import { Topics } from '../mercure/helpers/Topics';
import type { LoadVisits, VisitsInfo } from './reducers/types';

View file

@ -1,5 +1,5 @@
import type { ReportExporter } from '../../common/services/ReportExporter';
import { useGoBack } from '../../utils/helpers/hooks';
import type { ReportExporter } from '../../src/common/services/ReportExporter';
import { useGoBack } from '../../src/utils/helpers/hooks';
import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub';
import { Topics } from '../mercure/helpers/Topics';
import type { LoadOrphanVisits } from './reducers/orphanVisits';

View file

@ -1,8 +1,8 @@
import { useEffect } from 'react';
import { useLocation, useParams } from 'react-router-dom';
import type { ReportExporter } from '../../common/services/ReportExporter';
import { useGoBack } from '../../utils/helpers/hooks';
import { parseQuery } from '../../utils/helpers/query';
import type { ReportExporter } from '../../src/common/services/ReportExporter';
import { useGoBack } from '../../src/utils/helpers/hooks';
import { parseQuery } from '../../src/utils/helpers/query';
import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub';
import { Topics } from '../mercure/helpers/Topics';
import type { ShortUrlIdentifier } from '../short-urls/data';

View file

@ -1,6 +1,6 @@
import { ExternalLink } from 'react-external-link';
import { UncontrolledTooltip } from 'reactstrap';
import { Time } from '../../utils/dates/Time';
import { Time } from '../../src/utils/dates/Time';
import type { ShortUrlDetail } from '../short-urls/reducers/shortUrlDetail';
import type { ShortUrlVisits } from './reducers/shortUrlVisits';
import { VisitsHeader } from './VisitsHeader';

View file

@ -1,8 +1,8 @@
import { useParams } from 'react-router-dom';
import type { ShlinkVisitsParams } from '../../api/types';
import type { ReportExporter } from '../../common/services/ReportExporter';
import { useGoBack } from '../../utils/helpers/hooks';
import type { ColorGenerator } from '../../utils/services/ColorGenerator';
import type { ReportExporter } from '../../src/common/services/ReportExporter';
import { useGoBack } from '../../src/utils/helpers/hooks';
import type { ColorGenerator } from '../../src/utils/services/ColorGenerator';
import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub';
import { Topics } from '../mercure/helpers/Topics';
import type { LoadTagVisits, TagVisits as TagVisitsState } from './reducers/tagVisits';

Some files were not shown because too many files have changed in this diff Show more