@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.
Files changed (157) hide show
  1. package/App.d.ts +27 -0
  2. package/Components.d.ts +20 -0
  3. package/Dat/Dat.d.ts +12 -0
  4. package/Dat/DatContext.d.ts +12 -0
  5. package/Dat/DatDropdownItem.d.ts +9 -0
  6. package/Dat/index.d.ts +3 -0
  7. package/Dat/types.d.ts +7 -0
  8. package/Main.d.ts +1 -0
  9. package/__tests__/utils/index.d.ts +116 -0
  10. package/accesibility/helpers.d.ts +3 -0
  11. package/api/__tests__/testMocks/mocks.d.ts +14 -0
  12. package/api/__tests__/utils.d.ts +10 -0
  13. package/api/filterAssets.d.ts +42 -0
  14. package/api/getAsset.d.ts +15 -0
  15. package/api/getAssets.d.ts +10 -0
  16. package/api/getCollections.d.ts +18 -0
  17. package/api/getFilters.d.ts +33 -0
  18. package/api/getSimilarityAssets.d.ts +25 -0
  19. package/api/graphql.types.d.ts +17 -0
  20. package/api/index.d.ts +8 -0
  21. package/api/rest/autocomplete.d.ts +22 -0
  22. package/api/rest/getAssetCounts.d.ts +15 -0
  23. package/api/rest/getInitialFilters.d.ts +7 -0
  24. package/api/rest/getMetapropertiesOptions.d.ts +12 -0
  25. package/api/rest/handlers.d.ts +7 -0
  26. package/api/rest/index.d.ts +6 -0
  27. package/api/rest/types.d.ts +66 -0
  28. package/app-config/ConfigContext.d.ts +13 -0
  29. package/app-config/appConfig.type.d.ts +46 -0
  30. package/app-config/appConfig.type.guard.d.ts +2 -0
  31. package/auth/auth.d.ts +7 -0
  32. package/auth/crypto.d.ts +3 -0
  33. package/auth/loginwindow.d.ts +7 -0
  34. package/auth/oauth2.d.ts +16 -0
  35. package/auth/result.type.d.ts +13 -0
  36. package/auth/useAuthInformation.d.ts +18 -0
  37. package/common/components/CardSkeleton.d.ts +8 -0
  38. package/common/components/Checkbox.styles.d.ts +11 -0
  39. package/common/components/Chip.d.ts +10 -0
  40. package/common/components/DocumentIcon.d.ts +2 -0
  41. package/common/components/DragSelect.d.ts +28 -0
  42. package/common/components/HorizontalScroll.d.ts +8 -0
  43. package/common/components/InfiniteScroll.d.ts +9 -0
  44. package/common/components/LeftArrow.d.ts +5 -0
  45. package/common/components/Modal.d.ts +12 -0
  46. package/common/components/NoResults.d.ts +6 -0
  47. package/common/components/RightArrow.d.ts +5 -0
  48. package/common/components/Skeleton.d.ts +6 -0
  49. package/common/components/Spinner.d.ts +9 -0
  50. package/common/components/Tooltip.d.ts +13 -0
  51. package/common/components/__mocks__/Tooltip.d.ts +6 -0
  52. package/common/components/__tests__/utils.d.ts +34 -0
  53. package/common/components/dropdown/Dropdown.d.ts +16 -0
  54. package/common/components/dropdown/DropdownContent.d.ts +12 -0
  55. package/common/components/dropdown/DropdownListItem.d.ts +10 -0
  56. package/common/hooks/useClickOutside.d.ts +2 -0
  57. package/common/hooks/useDimensions.d.ts +9 -0
  58. package/constants.d.ts +7 -0
  59. package/error-handling/ErrorIcon.d.ts +2 -0
  60. package/error-handling/ErrorMessage.d.ts +6 -0
  61. package/error-handling/Oops.d.ts +9 -0
  62. package/error-handling/ReportModal.d.ts +8 -0
  63. package/error-handling/Shield.d.ts +17 -0
  64. package/error-handling/__tests__/utils.d.ts +56 -0
  65. package/filter/AssetFilter.d.ts +2 -0
  66. package/filter/AssetFilterContext.d.ts +39 -0
  67. package/filter/__tests__/utils.d.ts +13 -0
  68. package/filter/active-filters/ActiveFilter.d.ts +6 -0
  69. package/filter/active-filters/ActiveFilters.d.ts +2 -0
  70. package/filter/assetFilter.type.d.ts +10 -0
  71. package/filter/filters/advanced/Advanced.d.ts +14 -0
  72. package/filter/filters/advanced/AssetTypeItem.d.ts +7 -0
  73. package/filter/filters/metaproperty/Metaproperty.d.ts +9 -0
  74. package/filter/filters/metaproperty/MetapropertyFilterContent.d.ts +25 -0
  75. package/filter/filters/metaproperty/MetapropertyOption.d.ts +15 -0
  76. package/filter/filters/metaproperty/SmartFilterContent.d.ts +20 -0
  77. package/filter/filters/smartfilters/Metaproperties/Autocomplete.d.ts +14 -0
  78. package/filter/filters/smartfilters/Metaproperties/Option.d.ts +13 -0
  79. package/filter/filters/smartfilters/Metaproperties/SmartFilterSelect.d.ts +11 -0
  80. package/filter/filters/smartfilters/Smartfilters.d.ts +8 -0
  81. package/filter/filters/tags/TagItem.d.ts +6 -0
  82. package/filter/filters/tags/Tags.d.ts +8 -0
  83. package/index.js +308 -218
  84. package/index.mjs +1150 -0
  85. package/localization/index.d.ts +2 -0
  86. package/login/LoginComponent.d.ts +12 -0
  87. package/login/LoginContext.d.ts +19 -0
  88. package/login/__tests__/mocks.d.ts +1 -0
  89. package/login/__tests__/utils.d.ts +41 -0
  90. package/login/components/ConnectButton.d.ts +6 -0
  91. package/login/components/Container.d.ts +4 -0
  92. package/login/components/DomainInput.d.ts +11 -0
  93. package/login/components/Header.d.ts +2 -0
  94. package/login/components/RefreshingSpinner.d.ts +2 -0
  95. package/login/useAccountDomain.d.ts +2 -0
  96. package/order/DirectionSelect.d.ts +4 -0
  97. package/order/FieldSelect.d.ts +7 -0
  98. package/order/OrderingContext.d.ts +19 -0
  99. package/package.json +1 -7
  100. package/router/RouterContext.d.ts +19 -0
  101. package/search/SearchContext.d.ts +25 -0
  102. package/search/SearchInput.d.ts +2 -0
  103. package/search/SimilaritySearchContext.d.ts +24 -0
  104. package/search/SwitchNLS.d.ts +7 -0
  105. package/search/__mocks__/SimilaritySearchContext.d.ts +5 -0
  106. package/search/index.d.ts +3 -0
  107. package/select/FileSelector.d.ts +9 -0
  108. package/select/SelectionContext.d.ts +30 -0
  109. package/select/SelectionFooter.d.ts +2 -0
  110. package/select/__tests__/utils.d.ts +11 -0
  111. package/select/add-media/AddMedia.d.ts +7 -0
  112. package/select/add-media/ButtonAction.d.ts +6 -0
  113. package/select/add-media/addMedia.type.d.ts +15 -0
  114. package/select/current-selection/AssetItem.d.ts +5 -0
  115. package/select/current-selection/CollectionItem.d.ts +5 -0
  116. package/select/current-selection/SelectedItemContainer.d.ts +6 -0
  117. package/select/current-selection/SelectedItems.d.ts +5 -0
  118. package/select/file.type.d.ts +7 -0
  119. package/select/utils.d.ts +5 -0
  120. package/style/DesignSystemContext.d.ts +4 -0
  121. package/style/RootElementContext.d.ts +3 -0
  122. package/style/Theming.d.ts +27 -0
  123. package/style/shadowroot/ShadowRoot.d.ts +13 -0
  124. package/style/shadowroot/ShadowRootInternal.d.ts +12 -0
  125. package/style/shadowroot/__mocks__/ShadowRoot.d.ts +4 -0
  126. package/toolbar/Toolbar.d.ts +2 -0
  127. package/toolbar/ViewSwitch.d.ts +2 -0
  128. package/utils/__mocks__/logger.d.ts +4 -0
  129. package/utils/asyncDebounce.d.ts +1 -0
  130. package/utils/base64Converter.d.ts +3 -0
  131. package/utils/chunk.d.ts +1 -0
  132. package/utils/class.d.ts +25 -0
  133. package/utils/combineFilters.d.ts +8 -0
  134. package/utils/combineMetaproperties.d.ts +9 -0
  135. package/utils/filterEmptyMetaproperties.d.ts +2 -0
  136. package/utils/getMetaPropertiesForFilter.d.ts +2 -0
  137. package/utils/isObjectEmpty.d.ts +1 -0
  138. package/utils/logger.d.ts +6 -0
  139. package/utils/normalizeResponse.d.ts +3 -0
  140. package/utils/text.d.ts +2 -0
  141. package/utils/trimMetapropertyValue.d.ts +1 -0
  142. package/utils/url.d.ts +13 -0
  143. package/views/asset/AssetList.d.ts +20 -0
  144. package/views/asset/AssetsView.d.ts +2 -0
  145. package/views/asset/StatefulAssetList.d.ts +18 -0
  146. package/views/asset/__tests__/utils.d.ts +7 -0
  147. package/views/asset/asset-card/AssetCard.d.ts +15 -0
  148. package/views/asset/asset-card/AssetCardMetaproperties.d.ts +9 -0
  149. package/views/asset/asset-card/ContextAction.d.ts +8 -0
  150. package/views/asset/asset-card/utils.d.ts +5 -0
  151. package/views/asset/asset.type.d.ts +44 -0
  152. package/views/collection/CollectionView.d.ts +7 -0
  153. package/views/collection/collection.types.d.ts +7 -0
  154. package/views/collections/CollectionCard.d.ts +10 -0
  155. package/views/collections/CollectionList.d.ts +8 -0
  156. package/views/collections/CollectionsView.d.ts +2 -0
  157. package/views/collections/__tests__/utils.d.ts +5 -0
@@ -0,0 +1,7 @@
1
+ import { Result } from './result.type';
2
+ interface LoginWindowResponse {
3
+ state: string | null;
4
+ code: string | null;
5
+ }
6
+ export declare function waitForAuthorizationFromLoginWindow(url: string): Promise<Result<LoginWindowResponse, string>>;
7
+ export {};
@@ -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,8 @@
1
+ import React from 'react';
2
+ interface Props {
3
+ title?: React.ReactNode;
4
+ rows: number;
5
+ columns: number;
6
+ }
7
+ export declare function CardSkeleton(props: Props): React.JSX.Element;
8
+ 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,10 @@
1
+ import React from 'react';
2
+ interface Props {
3
+ loading?: boolean;
4
+ active?: boolean;
5
+ onClick?: () => void;
6
+ children: React.ReactNode;
7
+ ['data-testid']?: string;
8
+ }
9
+ export declare function Chip(props: Props): React.JSX.Element;
10
+ export {};
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function DocumentIcon(): React.JSX.Element;
@@ -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,8 @@
1
+ import React from 'react';
2
+ interface Props {
3
+ static?: React.ReactNode;
4
+ children: React.ReactNode;
5
+ isActiveFilter?: boolean;
6
+ }
7
+ export declare function HorizontalScroll(props: Props): React.JSX.Element;
8
+ export {};
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ interface Props {
3
+ isLoading: boolean;
4
+ hasNextPage: boolean;
5
+ loadMore: () => void;
6
+ children: React.ReactNode;
7
+ }
8
+ export declare function InfiniteScroll(props: Props): React.JSX.Element;
9
+ export {};
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ export declare function LeftArrow(props: Readonly<{
3
+ isDisabled: boolean;
4
+ onClick: () => void;
5
+ }>): React.JSX.Element;
@@ -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,6 @@
1
+ import React from 'react';
2
+ interface Props {
3
+ onReset: () => void;
4
+ }
5
+ export declare function NoResults(props: Props): React.JSX.Element;
6
+ export {};
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ export declare function RightArrow(props: Readonly<{
3
+ isDisabled: boolean;
4
+ onClick: () => void;
5
+ }>): React.JSX.Element;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ interface Props {
3
+ width?: number;
4
+ }
5
+ export declare function Skeleton({ width }: Props): React.JSX.Element;
6
+ export {};
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ interface Props {
3
+ isRelative?: boolean;
4
+ isHidden?: boolean;
5
+ isRefreshingSpinner?: boolean;
6
+ isNotUsingMargin?: boolean;
7
+ }
8
+ export declare function Spinner(props: Props): React.JSX.Element;
9
+ 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,6 @@
1
+ import React from 'react';
2
+ declare const Tooltip: ({ text, children }: {
3
+ text: any;
4
+ children: any;
5
+ }) => React.JSX.Element;
6
+ export { Tooltip };
@@ -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 {};
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function useClickOutside(targetRefs: React.MutableRefObject<Element | null>[], handler: () => void): void;
@@ -0,0 +1,9 @@
1
+ export interface Dimensions {
2
+ width: number;
3
+ height: number;
4
+ scrollWidth: number;
5
+ }
6
+ export declare function useDimensions(node: Element | null): {
7
+ dimensions?: Dimensions;
8
+ remeasure: (newNode?: Element | null) => void;
9
+ };
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,2 @@
1
+ import React from 'react';
2
+ export declare function ErrorIcon(): React.JSX.Element;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ export declare function ErrorMessage(props: {
3
+ isReportSent: boolean;
4
+ onClickSend: () => void;
5
+ onClickRetry: () => void;
6
+ }): React.JSX.Element;
@@ -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,8 @@
1
+ import React from 'react';
2
+ export declare function ReportModal(props: {
3
+ isOpen: boolean;
4
+ error: Error;
5
+ container: Element;
6
+ onDone: () => void;
7
+ onCancel: () => void;
8
+ }): React.JSX.Element;
@@ -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,2 @@
1
+ import React from 'react';
2
+ export declare function AssetFilter(): React.JSX.Element | null;
@@ -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,6 @@
1
+ import React from 'react';
2
+ export declare function ActiveFilter(props: {
3
+ onClick?: () => void;
4
+ title: string;
5
+ icon?: React.ReactNode;
6
+ }): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function ActiveFilters(): React.JSX.Element;
@@ -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,7 @@
1
+ import React from 'react';
2
+ import { AssetType } from '../../../views/asset/asset.type';
3
+ export declare function AssetTypeItem(props: {
4
+ type: AssetType;
5
+ count: number;
6
+ isLoading: boolean;
7
+ }): React.JSX.Element;
@@ -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 {};