@bynder/compact-view 5.0.2 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/App.d.ts +27 -0
- package/Components.d.ts +20 -0
- package/Dat/Dat.d.ts +12 -0
- package/Dat/DatContext.d.ts +12 -0
- package/Dat/DatDropdownItem.d.ts +9 -0
- package/Dat/index.d.ts +3 -0
- package/Dat/types.d.ts +7 -0
- package/Main.d.ts +1 -0
- package/__tests__/utils/index.d.ts +116 -0
- package/accesibility/helpers.d.ts +3 -0
- package/api/__tests__/testMocks/mocks.d.ts +14 -0
- package/api/__tests__/utils.d.ts +10 -0
- package/api/filterAssets.d.ts +42 -0
- package/api/getAsset.d.ts +15 -0
- package/api/getAssets.d.ts +10 -0
- package/api/getCollections.d.ts +18 -0
- package/api/getFilters.d.ts +33 -0
- package/api/getSimilarityAssets.d.ts +25 -0
- package/api/graphql.types.d.ts +17 -0
- package/api/index.d.ts +8 -0
- package/api/rest/autocomplete.d.ts +22 -0
- package/api/rest/getAssetCounts.d.ts +15 -0
- package/api/rest/getInitialFilters.d.ts +7 -0
- package/api/rest/getMetapropertiesOptions.d.ts +12 -0
- package/api/rest/handlers.d.ts +7 -0
- package/api/rest/index.d.ts +6 -0
- package/api/rest/types.d.ts +66 -0
- package/app-config/ConfigContext.d.ts +13 -0
- package/app-config/appConfig.type.d.ts +46 -0
- package/app-config/appConfig.type.guard.d.ts +2 -0
- package/auth/auth.d.ts +7 -0
- package/auth/crypto.d.ts +3 -0
- package/auth/loginwindow.d.ts +7 -0
- package/auth/oauth2.d.ts +16 -0
- package/auth/result.type.d.ts +13 -0
- package/auth/useAuthInformation.d.ts +18 -0
- package/common/components/CardSkeleton.d.ts +8 -0
- package/common/components/Checkbox.styles.d.ts +11 -0
- package/common/components/Chip.d.ts +10 -0
- package/common/components/DocumentIcon.d.ts +2 -0
- package/common/components/DragSelect.d.ts +28 -0
- package/common/components/HorizontalScroll.d.ts +8 -0
- package/common/components/InfiniteScroll.d.ts +9 -0
- package/common/components/LeftArrow.d.ts +5 -0
- package/common/components/Modal.d.ts +12 -0
- package/common/components/NoResults.d.ts +6 -0
- package/common/components/RightArrow.d.ts +5 -0
- package/common/components/Skeleton.d.ts +6 -0
- package/common/components/Spinner.d.ts +9 -0
- package/common/components/Tooltip.d.ts +13 -0
- package/common/components/__mocks__/Tooltip.d.ts +6 -0
- package/common/components/__tests__/utils.d.ts +34 -0
- package/common/components/dropdown/Dropdown.d.ts +16 -0
- package/common/components/dropdown/DropdownContent.d.ts +12 -0
- package/common/components/dropdown/DropdownListItem.d.ts +10 -0
- package/common/hooks/useClickOutside.d.ts +2 -0
- package/common/hooks/useDimensions.d.ts +9 -0
- package/constants.d.ts +7 -0
- package/error-handling/ErrorIcon.d.ts +2 -0
- package/error-handling/ErrorMessage.d.ts +6 -0
- package/error-handling/Oops.d.ts +9 -0
- package/error-handling/ReportModal.d.ts +8 -0
- package/error-handling/Shield.d.ts +17 -0
- package/error-handling/__tests__/utils.d.ts +56 -0
- package/filter/AssetFilter.d.ts +2 -0
- package/filter/AssetFilterContext.d.ts +39 -0
- package/filter/__tests__/utils.d.ts +13 -0
- package/filter/active-filters/ActiveFilter.d.ts +6 -0
- package/filter/active-filters/ActiveFilters.d.ts +2 -0
- package/filter/assetFilter.type.d.ts +10 -0
- package/filter/filters/advanced/Advanced.d.ts +14 -0
- package/filter/filters/advanced/AssetTypeItem.d.ts +7 -0
- package/filter/filters/metaproperty/Metaproperty.d.ts +9 -0
- package/filter/filters/metaproperty/MetapropertyFilterContent.d.ts +25 -0
- package/filter/filters/metaproperty/MetapropertyOption.d.ts +15 -0
- package/filter/filters/metaproperty/SmartFilterContent.d.ts +20 -0
- package/filter/filters/smartfilters/Metaproperties/Autocomplete.d.ts +14 -0
- package/filter/filters/smartfilters/Metaproperties/Option.d.ts +13 -0
- package/filter/filters/smartfilters/Metaproperties/SmartFilterSelect.d.ts +11 -0
- package/filter/filters/smartfilters/Smartfilters.d.ts +8 -0
- package/filter/filters/tags/TagItem.d.ts +6 -0
- package/filter/filters/tags/Tags.d.ts +8 -0
- package/index.js +308 -218
- package/index.mjs +1150 -0
- package/localization/index.d.ts +2 -0
- package/login/LoginComponent.d.ts +12 -0
- package/login/LoginContext.d.ts +19 -0
- package/login/__tests__/mocks.d.ts +1 -0
- package/login/__tests__/utils.d.ts +41 -0
- package/login/components/ConnectButton.d.ts +6 -0
- package/login/components/Container.d.ts +4 -0
- package/login/components/DomainInput.d.ts +11 -0
- package/login/components/Header.d.ts +2 -0
- package/login/components/RefreshingSpinner.d.ts +2 -0
- package/login/useAccountDomain.d.ts +2 -0
- package/order/DirectionSelect.d.ts +4 -0
- package/order/FieldSelect.d.ts +7 -0
- package/order/OrderingContext.d.ts +19 -0
- package/package.json +1 -7
- package/router/RouterContext.d.ts +19 -0
- package/search/SearchContext.d.ts +25 -0
- package/search/SearchInput.d.ts +2 -0
- package/search/SimilaritySearchContext.d.ts +24 -0
- package/search/SwitchNLS.d.ts +7 -0
- package/search/__mocks__/SimilaritySearchContext.d.ts +5 -0
- package/search/index.d.ts +3 -0
- package/select/FileSelector.d.ts +9 -0
- package/select/SelectionContext.d.ts +30 -0
- package/select/SelectionFooter.d.ts +2 -0
- package/select/__tests__/utils.d.ts +11 -0
- package/select/add-media/AddMedia.d.ts +7 -0
- package/select/add-media/ButtonAction.d.ts +6 -0
- package/select/add-media/addMedia.type.d.ts +15 -0
- package/select/current-selection/AssetItem.d.ts +5 -0
- package/select/current-selection/CollectionItem.d.ts +5 -0
- package/select/current-selection/SelectedItemContainer.d.ts +6 -0
- package/select/current-selection/SelectedItems.d.ts +5 -0
- package/select/file.type.d.ts +7 -0
- package/select/utils.d.ts +5 -0
- package/style/DesignSystemContext.d.ts +4 -0
- package/style/RootElementContext.d.ts +3 -0
- package/style/Theming.d.ts +27 -0
- package/style/shadowroot/ShadowRoot.d.ts +13 -0
- package/style/shadowroot/ShadowRootInternal.d.ts +12 -0
- package/style/shadowroot/__mocks__/ShadowRoot.d.ts +4 -0
- package/toolbar/Toolbar.d.ts +2 -0
- package/toolbar/ViewSwitch.d.ts +2 -0
- package/utils/__mocks__/logger.d.ts +4 -0
- package/utils/asyncDebounce.d.ts +1 -0
- package/utils/base64Converter.d.ts +3 -0
- package/utils/chunk.d.ts +1 -0
- package/utils/class.d.ts +25 -0
- package/utils/combineFilters.d.ts +8 -0
- package/utils/combineMetaproperties.d.ts +9 -0
- package/utils/filterEmptyMetaproperties.d.ts +2 -0
- package/utils/getMetaPropertiesForFilter.d.ts +2 -0
- package/utils/isObjectEmpty.d.ts +1 -0
- package/utils/logger.d.ts +6 -0
- package/utils/normalizeResponse.d.ts +3 -0
- package/utils/text.d.ts +2 -0
- package/utils/trimMetapropertyValue.d.ts +1 -0
- package/utils/url.d.ts +13 -0
- package/views/asset/AssetList.d.ts +20 -0
- package/views/asset/AssetsView.d.ts +2 -0
- package/views/asset/StatefulAssetList.d.ts +18 -0
- package/views/asset/__tests__/utils.d.ts +7 -0
- package/views/asset/asset-card/AssetCard.d.ts +15 -0
- package/views/asset/asset-card/AssetCardMetaproperties.d.ts +9 -0
- package/views/asset/asset-card/ContextAction.d.ts +8 -0
- package/views/asset/asset-card/utils.d.ts +5 -0
- package/views/asset/asset.type.d.ts +44 -0
- package/views/collection/CollectionView.d.ts +7 -0
- package/views/collection/collection.types.d.ts +7 -0
- package/views/collections/CollectionCard.d.ts +10 -0
- package/views/collections/CollectionList.d.ts +8 -0
- package/views/collections/CollectionsView.d.ts +2 -0
- package/views/collections/__tests__/utils.d.ts +5 -0
package/auth/oauth2.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Result } from './result.type';
|
|
2
|
+
export declare const redirectOrigin: string;
|
|
3
|
+
export type AuthPlatform = 'bynder' | 'webdam' | 'invalid';
|
|
4
|
+
export declare function makeAuthorizeRequestUrl(codeChallenge: string, state: string, accountDomain: string): string;
|
|
5
|
+
interface TokenRequest {
|
|
6
|
+
refreshToken: string;
|
|
7
|
+
accessToken: string;
|
|
8
|
+
expiresIn: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function postTokenRequest(code: string, code_verifier: string, accountDomain: string): Promise<Result<TokenRequest, string>>;
|
|
11
|
+
interface RefreshTokenRequest {
|
|
12
|
+
accessToken: string;
|
|
13
|
+
expiresIn: number;
|
|
14
|
+
}
|
|
15
|
+
export declare function postRefreshTokenRequest(refreshToken: string, accountDomain: string): Promise<Result<RefreshTokenRequest, string>>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type Ok<T> = {
|
|
2
|
+
tag: 'ok';
|
|
3
|
+
value: T;
|
|
4
|
+
};
|
|
5
|
+
export interface Err<E> {
|
|
6
|
+
tag: 'error';
|
|
7
|
+
error: E;
|
|
8
|
+
}
|
|
9
|
+
export type Result<T, E> = Ok<T> | Err<E>;
|
|
10
|
+
export declare function ok<T>(value: T): Ok<T>;
|
|
11
|
+
export declare function err<E>(error: E): Err<E>;
|
|
12
|
+
export declare function isOk<T, E = unknown>(result: Result<T, E>): result is Ok<T>;
|
|
13
|
+
export declare function isErr<E, T = unknown>(result: Result<T, E>): result is Err<E>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface SetAuthInformationParameters {
|
|
2
|
+
getAccessToken: () => string;
|
|
3
|
+
expiresIn?: number;
|
|
4
|
+
refreshToken?: string;
|
|
5
|
+
accountDomain?: string;
|
|
6
|
+
}
|
|
7
|
+
export type AuthStatus = 'authenticated' | 'not-authenticated' | 'refreshing';
|
|
8
|
+
export interface AuthInformationState {
|
|
9
|
+
getAccessToken?: () => string;
|
|
10
|
+
accountDomain?: string;
|
|
11
|
+
status: AuthStatus;
|
|
12
|
+
}
|
|
13
|
+
export declare function useAuthInformation(): [
|
|
14
|
+
AuthInformationState,
|
|
15
|
+
(info: SetAuthInformationParameters) => void,
|
|
16
|
+
() => void
|
|
17
|
+
];
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledCheckboxWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
3
|
+
$isLoading?: boolean | undefined;
|
|
4
|
+
$isChecked: boolean;
|
|
5
|
+
$isFlex?: boolean | undefined;
|
|
6
|
+
}>> & string;
|
|
7
|
+
export declare const ListItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, never>> & string;
|
|
8
|
+
export declare const Content: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
9
|
+
$isChecked: boolean;
|
|
10
|
+
}>> & string;
|
|
11
|
+
export declare const Label: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type DragAction = 'select' | 'inverse';
|
|
3
|
+
type Rect = {
|
|
4
|
+
left: number;
|
|
5
|
+
top: number;
|
|
6
|
+
height: number;
|
|
7
|
+
width: number;
|
|
8
|
+
};
|
|
9
|
+
type Position = {
|
|
10
|
+
x: number | null;
|
|
11
|
+
y: number | null;
|
|
12
|
+
};
|
|
13
|
+
type Props = {
|
|
14
|
+
dragContainer: string;
|
|
15
|
+
selectionBoxCustomAttr: React.HTMLAttributes<HTMLElement>;
|
|
16
|
+
onSelect: (selectedIds: string[]) => void;
|
|
17
|
+
onDeselect: (deselectedIds: string[]) => void;
|
|
18
|
+
onDragStart?: (action: DragAction) => void;
|
|
19
|
+
onDragEnd?: (action: DragAction) => void;
|
|
20
|
+
};
|
|
21
|
+
export declare const DragSelect: ({ dragContainer, selectionBoxCustomAttr, onSelect, onDeselect, onDragStart, onDragEnd, }: Props) => React.ReactPortal | null;
|
|
22
|
+
export declare const makeSelectable: ({ id }: {
|
|
23
|
+
id: string;
|
|
24
|
+
}) => {
|
|
25
|
+
"data-drag-select-id": string;
|
|
26
|
+
};
|
|
27
|
+
export declare const getSelectionBoxRect: (start: Position, end: Position, rootElement: Element | null) => Rect;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const useModalContext: () => {
|
|
3
|
+
onClose: () => void;
|
|
4
|
+
} | null;
|
|
5
|
+
interface Props {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
isOpen?: boolean;
|
|
8
|
+
style?: React.CSSProperties;
|
|
9
|
+
onClose?: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function Modal({ children, isOpen, style, onClose, }: Props): React.JSX.Element | null;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
type TooltipPosition = 'top' | 'bottom' | 'left' | 'right';
|
|
3
|
+
type TooltipMargin = 'top' | 'bottom' | 'left' | 'right';
|
|
4
|
+
type TooltipMarginAmount = 'spacing1' | 'spacing2' | 'spacing3' | 'spacing4' | 'spacing5';
|
|
5
|
+
interface TooltipProps {
|
|
6
|
+
text: string;
|
|
7
|
+
position?: TooltipPosition;
|
|
8
|
+
margin?: TooltipMargin;
|
|
9
|
+
marginAmount?: TooltipMarginAmount;
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare const Tooltip: ({ text, position, margin, marginAmount, children, }: TooltipProps) => React.JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export declare const mockConfig: {
|
|
2
|
+
theme: {
|
|
3
|
+
colorPrimary: string;
|
|
4
|
+
colorButtonPrimary: string;
|
|
5
|
+
colorButtonPrimaryLabel: string;
|
|
6
|
+
colorButtonPrimaryActive: string;
|
|
7
|
+
colorButtonPrimaryHover: string;
|
|
8
|
+
colorButtonPrimaryHoverLabel: string;
|
|
9
|
+
};
|
|
10
|
+
assetTypes: import("../../..").assetType[];
|
|
11
|
+
language: string;
|
|
12
|
+
onSuccess: import("../../..").OnSuccessCallback;
|
|
13
|
+
assetFieldSelection?: string | undefined;
|
|
14
|
+
assetFilter?: import("../../..").assetFilter | undefined;
|
|
15
|
+
mode?: import("../../..").selectionMode | undefined;
|
|
16
|
+
hideExternalAccess?: boolean | undefined;
|
|
17
|
+
__shouldAddOriginal__?: boolean | undefined;
|
|
18
|
+
hideSwitch?: boolean | undefined;
|
|
19
|
+
noCache?: boolean | undefined;
|
|
20
|
+
selectAllOption?: boolean | undefined;
|
|
21
|
+
selectionMode: import("../../..").selectionMode;
|
|
22
|
+
};
|
|
23
|
+
export declare const regularButtonStyle: {
|
|
24
|
+
background: string;
|
|
25
|
+
color: string;
|
|
26
|
+
};
|
|
27
|
+
export declare const hoverButtonStyle: {
|
|
28
|
+
background: string;
|
|
29
|
+
color: string;
|
|
30
|
+
};
|
|
31
|
+
export declare const activeButtonStyle: {
|
|
32
|
+
background: string;
|
|
33
|
+
color: string;
|
|
34
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
className?: string;
|
|
4
|
+
fadeIn?: boolean;
|
|
5
|
+
buttonKind?: 'clean' | 'secondary';
|
|
6
|
+
isSmall?: boolean;
|
|
7
|
+
direction?: 'Down' | 'Up';
|
|
8
|
+
title: React.ReactNode;
|
|
9
|
+
alt?: string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
isPaddingContent?: boolean;
|
|
12
|
+
isMetapropertyDropdown?: boolean;
|
|
13
|
+
children: (toggle: () => void) => React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export declare function Dropdown({ buttonKind, direction, isSmall, fadeIn, isMetapropertyDropdown, ...props }: Props): React.JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface DropdownContentProps {
|
|
3
|
+
onClickOutside: () => void;
|
|
4
|
+
direction: 'Down' | 'Up';
|
|
5
|
+
target: React.MutableRefObject<Element | null>;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
id: string;
|
|
8
|
+
isPaddingContent?: boolean;
|
|
9
|
+
isMetapropertyDropdown?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function DropdownContent(props: DropdownContentProps): React.ReactPortal | null;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ListItemProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
onClick?: () => void;
|
|
5
|
+
selected?: boolean;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
isFieldSelect?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function DropdownListItem({ selected, ...props }: ListItemProps): React.JSX.Element;
|
|
10
|
+
export {};
|
package/constants.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const WEBDAM_TRANSFORM_BASE_URL_NAME = "transformBaseURL";
|
|
2
|
+
export declare const BYNDER_TRANSFORM_BASE_URL_NAME = "transformBaseUrl";
|
|
3
|
+
export declare const DATE_METAPROPERTY_TYPE = "date";
|
|
4
|
+
export declare const DATE_METAPROPERTY_LOCALE = "en-GB";
|
|
5
|
+
export declare const DATE_METAPROPERTY_OPTIONS: Intl.DateTimeFormatOptions;
|
|
6
|
+
export declare const MAX_METAPROPERTY_LENGTH = 100;
|
|
7
|
+
export declare const MAX_GET_ASSETS_LIMIT = 280;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BrowserClient } from '@sentry/browser';
|
|
3
|
+
interface Props {
|
|
4
|
+
error: Error;
|
|
5
|
+
onRetry: () => void;
|
|
6
|
+
sentryClient?: BrowserClient;
|
|
7
|
+
}
|
|
8
|
+
export declare function Oops({ error, onRetry, sentryClient }: Props): React.JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BrowserClient } from '@sentry/browser';
|
|
3
|
+
interface Props {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
sentryClient?: BrowserClient;
|
|
6
|
+
}
|
|
7
|
+
interface State {
|
|
8
|
+
error: Error | null;
|
|
9
|
+
}
|
|
10
|
+
export declare class Shield extends React.Component<Props, State> {
|
|
11
|
+
constructor(props: Props);
|
|
12
|
+
static getDerivedStateFromError(error: Error): {
|
|
13
|
+
error: Error;
|
|
14
|
+
};
|
|
15
|
+
render(): string | number | boolean | React.JSX.Element | Iterable<React.ReactNode> | null | undefined;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export declare function renderShield(options: any, sentryClient?: any): {
|
|
2
|
+
rerender: (rerenderOptions: any) => any;
|
|
3
|
+
container: HTMLElement;
|
|
4
|
+
baseElement: HTMLElement;
|
|
5
|
+
debug: (baseElement?: Element | DocumentFragment | (Element | DocumentFragment)[] | undefined, maxLength?: number | undefined, options?: import("pretty-format").PrettyFormatOptions | undefined) => void;
|
|
6
|
+
unmount: () => void;
|
|
7
|
+
asFragment: () => DocumentFragment;
|
|
8
|
+
getByLabelText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement;
|
|
9
|
+
getAllByLabelText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement[];
|
|
10
|
+
queryByLabelText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement | null;
|
|
11
|
+
queryAllByLabelText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement[];
|
|
12
|
+
findByLabelText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
|
|
13
|
+
findAllByLabelText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
14
|
+
getByPlaceholderText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement;
|
|
15
|
+
getAllByPlaceholderText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
16
|
+
queryByPlaceholderText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement | null;
|
|
17
|
+
queryAllByPlaceholderText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
18
|
+
findByPlaceholderText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
|
|
19
|
+
findAllByPlaceholderText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
20
|
+
getByText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement;
|
|
21
|
+
getAllByText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement[];
|
|
22
|
+
queryByText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement | null;
|
|
23
|
+
queryAllByText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement[];
|
|
24
|
+
findByText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
|
|
25
|
+
findAllByText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
26
|
+
getByAltText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement;
|
|
27
|
+
getAllByAltText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
28
|
+
queryByAltText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement | null;
|
|
29
|
+
queryAllByAltText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
30
|
+
findByAltText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
|
|
31
|
+
findAllByAltText: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
32
|
+
getByTitle: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement;
|
|
33
|
+
getAllByTitle: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
34
|
+
queryByTitle: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement | null;
|
|
35
|
+
queryAllByTitle: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
36
|
+
findByTitle: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
|
|
37
|
+
findAllByTitle: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
38
|
+
getByDisplayValue: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement;
|
|
39
|
+
getAllByDisplayValue: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
40
|
+
queryByDisplayValue: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement | null;
|
|
41
|
+
queryAllByDisplayValue: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
42
|
+
findByDisplayValue: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
|
|
43
|
+
findAllByDisplayValue: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
44
|
+
getByRole: (role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined) => HTMLElement;
|
|
45
|
+
getAllByRole: (role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined) => HTMLElement[];
|
|
46
|
+
queryByRole: (role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined) => HTMLElement | null;
|
|
47
|
+
queryAllByRole: (role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined) => HTMLElement[];
|
|
48
|
+
findByRole: (role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
|
|
49
|
+
findAllByRole: (role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
50
|
+
getByTestId: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement;
|
|
51
|
+
getAllByTestId: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
52
|
+
queryByTestId: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement | null;
|
|
53
|
+
queryAllByTestId: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
|
|
54
|
+
findByTestId: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
|
|
55
|
+
findAllByTestId: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
56
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AssetType } from '../views/asset/asset.type';
|
|
3
|
+
import { MetapropertyOptionType as MetapropertyOption } from './filters/metaproperty/MetapropertyOption';
|
|
4
|
+
import { AssetFilterJson } from '@src/filter/assetFilter.type';
|
|
5
|
+
import { AutcompleteResponseOption, SmartfilterOption, selectedSmartfilterOptionsType, AssetCountType } from '@src/api/rest/types';
|
|
6
|
+
export interface Filter {
|
|
7
|
+
assetTypes: AssetType[];
|
|
8
|
+
metaproperties: MetapropertyOption[];
|
|
9
|
+
metapropertyIds?: string[];
|
|
10
|
+
tags: string[];
|
|
11
|
+
isLimited?: boolean;
|
|
12
|
+
isDropdownActive?: boolean;
|
|
13
|
+
selectedSmartfilterOptions?: selectedSmartfilterOptionsType;
|
|
14
|
+
existingFilters?: Record<string, Record<string, number>> | null;
|
|
15
|
+
}
|
|
16
|
+
interface Actions {
|
|
17
|
+
addAssetType: (assetType: AssetType) => void;
|
|
18
|
+
removeAssetType: (assetType: AssetType) => void;
|
|
19
|
+
addMetaproperty: (metaproperty: MetapropertyOption) => void;
|
|
20
|
+
removeMetaproperty: (metaproperty: MetapropertyOption) => void;
|
|
21
|
+
setPredefinedMetaproperties: (metaproperties: Record<string, MetapropertyOption>) => void;
|
|
22
|
+
addTag: (tag: string) => void;
|
|
23
|
+
removeTag: (tag: string) => void;
|
|
24
|
+
clear: () => void;
|
|
25
|
+
setDropdownState: (active: boolean) => void;
|
|
26
|
+
selectSmartfilterOption: (metapropertyName: string, option: SmartfilterOption | AutcompleteResponseOption, isMultifilter?: boolean) => void;
|
|
27
|
+
removeSmartfilterOption: (metapropertyName: string, optionId: string) => void;
|
|
28
|
+
setActiveFiltersState: (count: AssetCountType) => void;
|
|
29
|
+
}
|
|
30
|
+
type MetapropertyMapType = Record<string, MetapropertyOption>;
|
|
31
|
+
export declare const AssetFilterContext: React.Context<(Filter & Actions) | null>;
|
|
32
|
+
export declare function AssetFilterProvider({ children, hideLimitedUse, predefinedFilter, }: {
|
|
33
|
+
children: React.ReactNode;
|
|
34
|
+
hideLimitedUse?: boolean;
|
|
35
|
+
predefinedFilter?: AssetFilterJson;
|
|
36
|
+
}): React.JSX.Element;
|
|
37
|
+
export declare function keepPredefinedMetapropertiesInMap(metapropertyMap: MetapropertyMapType, predefinedMetaproperties: string[]): {};
|
|
38
|
+
export declare function useAssetFilter(): Filter & Actions;
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare function renderAssetFilter({ options, predefinedFilters, assetIds, withExtension, }: {
|
|
2
|
+
options?: any;
|
|
3
|
+
predefinedFilters?: any;
|
|
4
|
+
assetIds?: string[];
|
|
5
|
+
withExtension?: boolean;
|
|
6
|
+
}): void;
|
|
7
|
+
export declare const customAssetFilterRender: (ui: any, { predefinedFilter, providedProps, assetIds, withExtension, ...renderOptions }: {
|
|
8
|
+
[x: string]: any;
|
|
9
|
+
predefinedFilter: any;
|
|
10
|
+
providedProps: any;
|
|
11
|
+
assetIds?: never[] | undefined;
|
|
12
|
+
withExtension?: boolean | undefined;
|
|
13
|
+
}) => void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AssetType } from '../views/asset/asset.type';
|
|
2
|
+
export interface AssetFilterJson {
|
|
3
|
+
predefinedAssetType?: AssetType[];
|
|
4
|
+
collectionId?: string;
|
|
5
|
+
predefinedMetapropertiesOptions?: Record<string, Record<string, string>>;
|
|
6
|
+
searchTerm?: string;
|
|
7
|
+
predefinedTagNames?: string[];
|
|
8
|
+
isLimitedUse?: boolean;
|
|
9
|
+
showToolbar?: boolean;
|
|
10
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Count {
|
|
3
|
+
audio: number;
|
|
4
|
+
document: number;
|
|
5
|
+
image: number;
|
|
6
|
+
video: number;
|
|
7
|
+
archive: number;
|
|
8
|
+
}
|
|
9
|
+
interface AdvancedProps {
|
|
10
|
+
isLoading: boolean;
|
|
11
|
+
count: Count;
|
|
12
|
+
}
|
|
13
|
+
export declare function Advanced(props: AdvancedProps): React.JSX.Element | null;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MetapropertyType } from './MetapropertyFilterContent';
|
|
3
|
+
import { SmartfilterType } from './SmartFilterContent';
|
|
4
|
+
interface Props {
|
|
5
|
+
metapropertyFilters: Array<MetapropertyType | SmartfilterType>;
|
|
6
|
+
isLoading: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function Metaproperty(props: Props): React.JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MetapropertyOptionType } from './MetapropertyOption';
|
|
3
|
+
export interface MetapropertyType {
|
|
4
|
+
__typename: 'Metaproperty';
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
zIndex: number;
|
|
8
|
+
options: MetapropertyOptionType[];
|
|
9
|
+
showInGridView: boolean;
|
|
10
|
+
showInListView: boolean;
|
|
11
|
+
}
|
|
12
|
+
interface MetapropertyProps {
|
|
13
|
+
metaproperty: MetapropertyType;
|
|
14
|
+
selectedOptionIds: string[];
|
|
15
|
+
isLoading: boolean;
|
|
16
|
+
onAddOption: (metapropertyOption: MetapropertyOptionType) => void;
|
|
17
|
+
onRemoveOption: (metapropertyOption: MetapropertyOptionType) => void;
|
|
18
|
+
}
|
|
19
|
+
export declare function MetaPropertyFilterContent(props: MetapropertyProps): React.JSX.Element;
|
|
20
|
+
export interface Tag {
|
|
21
|
+
id: string;
|
|
22
|
+
name: string;
|
|
23
|
+
assetCount: number;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface MetapropertyOptionType {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
assetCount: number;
|
|
6
|
+
}
|
|
7
|
+
interface MetapropertyOptionProps {
|
|
8
|
+
metapropertyOption: MetapropertyOptionType;
|
|
9
|
+
selectedOptionIds?: string[];
|
|
10
|
+
isLoading?: boolean;
|
|
11
|
+
onAddOption: () => void;
|
|
12
|
+
onRemoveOption: () => void;
|
|
13
|
+
}
|
|
14
|
+
export declare function MetapropertyOptionComponent(props: MetapropertyOptionProps): React.JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MetapropertyType } from './MetapropertyFilterContent';
|
|
3
|
+
import { MetapropertyOptionType } from './MetapropertyOption';
|
|
4
|
+
export interface SmartfilterType {
|
|
5
|
+
__typename: 'Smartfilter';
|
|
6
|
+
id: string;
|
|
7
|
+
label: string;
|
|
8
|
+
metaproperties: MetapropertyType[];
|
|
9
|
+
icon?: string;
|
|
10
|
+
zIndex: number;
|
|
11
|
+
}
|
|
12
|
+
interface SmartfilterProps {
|
|
13
|
+
smartfilter: SmartfilterType;
|
|
14
|
+
selectedOptionIds: string[];
|
|
15
|
+
isLoading: boolean;
|
|
16
|
+
onAddOption: (metapropertyOption: MetapropertyOptionType) => void;
|
|
17
|
+
onRemoveOption: (metapropertyOption: MetapropertyOptionType) => void;
|
|
18
|
+
}
|
|
19
|
+
export declare function SmartFilterContent(props: SmartfilterProps): React.JSX.Element;
|
|
20
|
+
export {};
|