@bynder/compact-view 5.0.1 → 5.0.3

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 (149) hide show
  1. package/App.d.ts +27 -0
  2. package/Dat/Dat.d.ts +12 -0
  3. package/Dat/DatContext.d.ts +12 -0
  4. package/Dat/DatDropdownItem.d.ts +9 -0
  5. package/Dat/index.d.ts +3 -0
  6. package/Dat/types.d.ts +7 -0
  7. package/Main.d.ts +1 -0
  8. package/__tests__/utils/index.d.ts +116 -0
  9. package/accesibility/helpers.d.ts +3 -0
  10. package/api/__tests__/utils.d.ts +10 -0
  11. package/api/filterAssets.d.ts +42 -0
  12. package/api/getAsset.d.ts +15 -0
  13. package/api/getAssets.d.ts +10 -0
  14. package/api/getCollections.d.ts +18 -0
  15. package/api/getFilters.d.ts +33 -0
  16. package/api/graphql.types.d.ts +17 -0
  17. package/api/index.d.ts +7 -0
  18. package/api/rest/autocomplete.d.ts +22 -0
  19. package/api/rest/getAssetCounts.d.ts +15 -0
  20. package/api/rest/getInitialFilters.d.ts +7 -0
  21. package/api/rest/getMetapropertiesOptions.d.ts +12 -0
  22. package/api/rest/handlers.d.ts +7 -0
  23. package/api/rest/index.d.ts +6 -0
  24. package/api/rest/types.d.ts +66 -0
  25. package/app-config/ConfigContext.d.ts +13 -0
  26. package/app-config/appConfig.type.d.ts +46 -0
  27. package/app-config/appConfig.type.guard.d.ts +2 -0
  28. package/auth/auth.d.ts +7 -0
  29. package/auth/crypto.d.ts +3 -0
  30. package/auth/loginwindow.d.ts +7 -0
  31. package/auth/oauth2.d.ts +16 -0
  32. package/auth/result.type.d.ts +13 -0
  33. package/auth/useAuthInformation.d.ts +18 -0
  34. package/common/components/CardSkeleton.d.ts +8 -0
  35. package/common/components/Checkbox.styles.d.ts +11 -0
  36. package/common/components/Chip.d.ts +10 -0
  37. package/common/components/DocumentIcon.d.ts +2 -0
  38. package/common/components/DragSelect.d.ts +28 -0
  39. package/common/components/HorizontalScroll.d.ts +8 -0
  40. package/common/components/InfiniteScroll.d.ts +9 -0
  41. package/common/components/LeftArrow.d.ts +5 -0
  42. package/common/components/Modal.d.ts +12 -0
  43. package/common/components/NoResults.d.ts +6 -0
  44. package/common/components/RightArrow.d.ts +5 -0
  45. package/common/components/Skeleton.d.ts +6 -0
  46. package/common/components/Spinner.d.ts +9 -0
  47. package/common/components/__tests__/utils.d.ts +34 -0
  48. package/common/components/dropdown/Dropdown.d.ts +16 -0
  49. package/common/components/dropdown/DropdownContent.d.ts +12 -0
  50. package/common/components/dropdown/DropdownListItem.d.ts +10 -0
  51. package/common/hooks/useClickOutside.d.ts +2 -0
  52. package/common/hooks/useDimensions.d.ts +9 -0
  53. package/constants.d.ts +7 -0
  54. package/error-handling/ErrorIcon.d.ts +2 -0
  55. package/error-handling/ErrorMessage.d.ts +6 -0
  56. package/error-handling/Oops.d.ts +9 -0
  57. package/error-handling/ReportModal.d.ts +8 -0
  58. package/error-handling/Shield.d.ts +17 -0
  59. package/error-handling/__tests__/utils.d.ts +56 -0
  60. package/filter/AssetFilter.d.ts +2 -0
  61. package/filter/AssetFilterContext.d.ts +39 -0
  62. package/filter/__tests__/utils.d.ts +13 -0
  63. package/filter/active-filters/ActiveFilter.d.ts +6 -0
  64. package/filter/active-filters/ActiveFilters.d.ts +2 -0
  65. package/filter/assetFilter.type.d.ts +10 -0
  66. package/filter/filters/advanced/Advanced.d.ts +14 -0
  67. package/filter/filters/advanced/AssetTypeItem.d.ts +7 -0
  68. package/filter/filters/metaproperty/Metaproperty.d.ts +9 -0
  69. package/filter/filters/metaproperty/MetapropertyFilterContent.d.ts +25 -0
  70. package/filter/filters/metaproperty/MetapropertyOption.d.ts +15 -0
  71. package/filter/filters/metaproperty/SmartFilterContent.d.ts +20 -0
  72. package/filter/filters/smartfilters/Metaproperties/Autocomplete.d.ts +14 -0
  73. package/filter/filters/smartfilters/Metaproperties/Option.d.ts +13 -0
  74. package/filter/filters/smartfilters/Metaproperties/SmartFilterSelect.d.ts +11 -0
  75. package/filter/filters/smartfilters/Smartfilters.d.ts +8 -0
  76. package/filter/filters/tags/TagItem.d.ts +6 -0
  77. package/filter/filters/tags/Tags.d.ts +8 -0
  78. package/index.d.ts +10 -0
  79. package/index.js +7 -7
  80. package/index.mjs +1060 -0
  81. package/localization/index.d.ts +2 -0
  82. package/login/LoginComponent.d.ts +12 -0
  83. package/login/LoginContext.d.ts +19 -0
  84. package/login/__tests__/mocks.d.ts +1 -0
  85. package/login/__tests__/utils.d.ts +41 -0
  86. package/login/components/ConnectButton.d.ts +6 -0
  87. package/login/components/Container.d.ts +4 -0
  88. package/login/components/DomainInput.d.ts +11 -0
  89. package/login/components/Header.d.ts +2 -0
  90. package/login/components/RefreshingSpinner.d.ts +2 -0
  91. package/login/useAccountDomain.d.ts +2 -0
  92. package/order/DirectionSelect.d.ts +2 -0
  93. package/order/FieldSelect.d.ts +7 -0
  94. package/order/OrderingContext.d.ts +19 -0
  95. package/package.json +10 -9
  96. package/router/RouterContext.d.ts +19 -0
  97. package/search/SearchContext.d.ts +25 -0
  98. package/search/SearchInput.d.ts +2 -0
  99. package/select/FileSelector.d.ts +9 -0
  100. package/select/SelectionContext.d.ts +30 -0
  101. package/select/SelectionFooter.d.ts +2 -0
  102. package/select/__tests__/utils.d.ts +10 -0
  103. package/select/add-media/AddMedia.d.ts +7 -0
  104. package/select/add-media/ButtonAction.d.ts +6 -0
  105. package/select/add-media/addMedia.type.d.ts +15 -0
  106. package/select/current-selection/AssetItem.d.ts +5 -0
  107. package/select/current-selection/CollectionItem.d.ts +5 -0
  108. package/select/current-selection/SelectedItemContainer.d.ts +6 -0
  109. package/select/current-selection/SelectedItems.d.ts +5 -0
  110. package/select/file.type.d.ts +7 -0
  111. package/select/utils.d.ts +5 -0
  112. package/style/DesignSystemContext.d.ts +4 -0
  113. package/style/RootElementContext.d.ts +3 -0
  114. package/style/Theming.d.ts +27 -0
  115. package/style/shadowroot/ShadowRoot.d.ts +13 -0
  116. package/style/shadowroot/ShadowRootInternal.d.ts +12 -0
  117. package/style/shadowroot/__mocks__/ShadowRoot.d.ts +4 -0
  118. package/toolbar/Toolbar.d.ts +2 -0
  119. package/toolbar/ViewSwitch.d.ts +2 -0
  120. package/utils/__mocks__/logger.d.ts +4 -0
  121. package/utils/asyncDebounce.d.ts +1 -0
  122. package/utils/base64Converter.d.ts +2 -0
  123. package/utils/chunk.d.ts +1 -0
  124. package/utils/class.d.ts +25 -0
  125. package/utils/combineFilters.d.ts +8 -0
  126. package/utils/combineMetaproperties.d.ts +9 -0
  127. package/utils/filterEmptyMetaproperties.d.ts +2 -0
  128. package/utils/getMetaPropertiesForFilter.d.ts +2 -0
  129. package/utils/isObjectEmpty.d.ts +1 -0
  130. package/utils/logger.d.ts +6 -0
  131. package/utils/normalizeResponse.d.ts +3 -0
  132. package/utils/text.d.ts +2 -0
  133. package/utils/trimMetapropertyValue.d.ts +1 -0
  134. package/utils/url.d.ts +13 -0
  135. package/views/asset/AssetList.d.ts +20 -0
  136. package/views/asset/AssetsView.d.ts +2 -0
  137. package/views/asset/StatefulAssetList.d.ts +18 -0
  138. package/views/asset/__tests__/utils.d.ts +7 -0
  139. package/views/asset/asset-card/AssetCard.d.ts +13 -0
  140. package/views/asset/asset-card/AssetCardMetaproperties.d.ts +9 -0
  141. package/views/asset/asset-card/ContextAction.d.ts +8 -0
  142. package/views/asset/asset-card/utils.d.ts +5 -0
  143. package/views/asset/asset.type.d.ts +41 -0
  144. package/views/collection/CollectionView.d.ts +7 -0
  145. package/views/collection/collection.types.d.ts +7 -0
  146. package/views/collections/CollectionCard.d.ts +10 -0
  147. package/views/collections/CollectionList.d.ts +8 -0
  148. package/views/collections/CollectionsView.d.ts +2 -0
  149. package/views/collections/__tests__/utils.d.ts +5 -0
@@ -0,0 +1,2 @@
1
+ export declare function __(key: string): string;
2
+ export declare function useLocalization(locale: string): void;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { DomainStatus } from './useAccountDomain';
3
+ interface Props {
4
+ domainValue: string;
5
+ domainStatus: DomainStatus;
6
+ onChangeDomain: (value: string) => void;
7
+ isSubmitting: boolean;
8
+ isEditable: boolean;
9
+ onSubmit: () => void;
10
+ }
11
+ export declare function LoginComponent(props: Props): React.JSX.Element;
12
+ export {};
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { AuthInformationState } from '../auth/useAuthInformation';
3
+ import { Config, PortalConfig } from '../app-config/appConfig.type';
4
+ type ContextValue = AuthInformationState & {
5
+ logout: () => void;
6
+ hideLogout?: boolean;
7
+ };
8
+ export declare const AuthContext: React.Context<ContextValue | null>;
9
+ interface Props {
10
+ portal?: PortalConfig;
11
+ language?: string;
12
+ children: React.ReactNode;
13
+ authentication?: Config['authentication'];
14
+ onLogout?: Config['onLogout'];
15
+ }
16
+ declare const LoginWithShield: (props: Props) => React.JSX.Element;
17
+ export { LoginWithShield as Login };
18
+ export declare const useIsLoggedIn: () => boolean;
19
+ export declare const useAuth: () => ContextValue | null;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,41 @@
1
+ import React from 'react';
2
+ import { PortalConfig } from '../../app-config/appConfig.type';
3
+ export declare function getContext(): {
4
+ accessToken: string | undefined;
5
+ accountDomain: string | undefined;
6
+ isLoggedIn: boolean;
7
+ logout: () => void;
8
+ };
9
+ export declare function queryChildComponent(): HTMLElement | null;
10
+ export declare function typeAccountDomainAndClickConnect(domain: string, waitForLoading?: boolean): Promise<void>;
11
+ export declare function login(domain: string): Promise<void>;
12
+ export declare function waitForLoginWindowToOpen(): Promise<void>;
13
+ export declare function waitForChildComponentToBeRendered(): Promise<void>;
14
+ export declare function mockAccessRequest(requestArguments: {
15
+ code_verifier: string;
16
+ code: string;
17
+ }, response: number | {
18
+ refresh_token: string;
19
+ access_token: string;
20
+ expires_in: string;
21
+ }, domain?: string): void;
22
+ export declare function mockRefreshRequest(requestArguments: {
23
+ refresh_token: string;
24
+ }, response: number | {
25
+ access_token: string;
26
+ expires_in: string;
27
+ }, domain?: string): void;
28
+ export declare function mockPortalValidation(portalUrl: string, respBody?: Record<string, unknown>, isValid?: boolean): void;
29
+ export declare function fireLoginWindowEvent(options: {
30
+ origin: string;
31
+ data: string;
32
+ }): void;
33
+ export declare function MockChildComponent(): React.JSX.Element;
34
+ export declare function renderLogin(props?: {
35
+ portal?: PortalConfig;
36
+ language?: string;
37
+ authentication?: {
38
+ getAccessToken: () => string;
39
+ hideLogout?: boolean;
40
+ };
41
+ }): import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ export declare function ConnectButton(props: {
3
+ isValidDomain: boolean;
4
+ isSubmitting: boolean;
5
+ onClick: () => void;
6
+ }): React.JSX.Element;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export declare function Container(props: {
3
+ children: React.ReactNode;
4
+ }): React.JSX.Element;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { DomainStatus } from '../useAccountDomain';
3
+ interface Props {
4
+ value: string;
5
+ isReadOnly: boolean;
6
+ status: DomainStatus;
7
+ onSubmit: () => void;
8
+ onChange: (value: string) => void;
9
+ }
10
+ export declare function DomainInput({ status, isReadOnly, value, onChange, onSubmit }: Props): React.JSX.Element;
11
+ export {};
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function Header(): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function RefreshingSpinner(): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ export type DomainStatus = 'empty' | 'validating' | 'valid' | 'invalid';
2
+ export declare function useAccountDomain(initialUrl?: string | undefined): [string, (domain: string) => void, DomainStatus];
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function DirectionSelect(): React.JSX.Element;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { Field } from './OrderingContext';
3
+ interface FieldProps {
4
+ options?: Field[];
5
+ }
6
+ export declare function FieldSelect({ options, }: FieldProps): React.JSX.Element;
7
+ export {};
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { PageType } from '../router/RouterContext';
3
+ export type Field = 'CREATED_AT' | 'NAME' | 'PUBLISHED_AT' | 'UPDATED_AT';
4
+ export type Direction = 'ASC' | 'DESC';
5
+ export type Ordering = {
6
+ field: Field;
7
+ direction: Direction;
8
+ };
9
+ export declare function OrderingProvider(props: {
10
+ children: React.ReactNode;
11
+ }): React.JSX.Element;
12
+ export declare function useOrdering(): {
13
+ assets: Ordering;
14
+ collections: Ordering;
15
+ collection: Ordering;
16
+ setOrdering: (page: PageType, ordering: Ordering) => void;
17
+ reset: () => void;
18
+ };
19
+ export declare function useOrderingByPage(page: PageType): [Ordering, (ordering: Ordering) => void];
package/package.json CHANGED
@@ -1,18 +1,19 @@
1
1
  {
2
2
  "name": "@bynder/compact-view",
3
3
  "description": "Bynder Compact View",
4
- "version": "5.0.1",
4
+ "version": "5.0.3",
5
5
  "author": "Bynder",
6
6
  "license": "UNLICENSED",
7
7
  "main": "index.js",
8
- "module": "index.js",
9
- "types": "CompactView.d.ts",
10
- "files": [
11
- "index.js",
12
- "index.d.ts",
13
- "components.js",
14
- "components.d.ts"
15
- ],
8
+ "module": "index.mjs",
9
+ "types": "index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "import": "./index.mjs",
13
+ "require": "./index.js",
14
+ "types": "./index.d.ts"
15
+ }
16
+ },
16
17
  "dependencies": {},
17
18
  "peerDependencies": {
18
19
  "react": ">=16.8.0 <19.0.0",
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { Collection } from '../views/collection/collection.types';
3
+ type AssetsPage = 'assets';
4
+ type CollectionsPage = 'collections';
5
+ type CollectionPage = 'collection';
6
+ export type PageType = AssetsPage | CollectionsPage | CollectionPage;
7
+ type Page = {
8
+ page: AssetsPage;
9
+ } | {
10
+ page: CollectionsPage;
11
+ } | {
12
+ page: CollectionPage;
13
+ collection: Collection;
14
+ };
15
+ export declare function RouterProvider(props: {
16
+ children: React.ReactNode;
17
+ }): React.JSX.Element;
18
+ export declare function useRouter(): [Page, (page: Page) => void];
19
+ export {};
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ interface State {
3
+ assets: string;
4
+ collection: string;
5
+ collections: string;
6
+ isLoading: boolean;
7
+ }
8
+ interface Actions {
9
+ setSearch: (page: 'assets' | 'collections' | 'collection', value: string) => void;
10
+ setIsLoading: (isLoading: boolean) => void;
11
+ clear: () => void;
12
+ }
13
+ export interface Props {
14
+ defaultValue?: string;
15
+ children: React.ReactNode;
16
+ }
17
+ export declare function SearchStateProvider(props: Props): React.JSX.Element;
18
+ export declare function useSearchState(): State & Actions;
19
+ export declare function useSearchStateByPage(page: 'assets' | 'collections' | 'collection'): {
20
+ value: string;
21
+ isLoading: boolean;
22
+ setSearch: (newValue: string) => void;
23
+ setIsLoading: (isLoading: boolean) => void;
24
+ };
25
+ export {};
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function SearchInput(): React.JSX.Element;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { Asset } from '../views/asset/asset.type';
3
+ import { File } from './file.type';
4
+ interface Props {
5
+ asset: Asset;
6
+ onChange: (file: File | undefined) => void;
7
+ }
8
+ export declare function FileSelector({ asset, onChange }: Props): React.JSX.Element;
9
+ export {};
@@ -0,0 +1,30 @@
1
+ import React from 'react';
2
+ import { Asset, AssetData } from '../views/asset/asset.type';
3
+ import { Collection } from '../views/collection/collection.types';
4
+ type SelectedAsset = {
5
+ type: 'asset';
6
+ value: Asset;
7
+ };
8
+ export type SelectedCollection = {
9
+ type: 'collection';
10
+ value: Collection;
11
+ };
12
+ export type SelectedItem = SelectedAsset | SelectedCollection;
13
+ interface Context {
14
+ selection: SelectedItem[];
15
+ preselectedAssetIds?: string[];
16
+ clear: () => void;
17
+ selectAll: () => void;
18
+ selectAssets: (assets: Asset[]) => void;
19
+ toggleAssets: (assets: Asset[]) => void;
20
+ toggleCollection: (collection: Collection) => void;
21
+ setAllAssets: (assetData: AssetData) => void;
22
+ }
23
+ export declare function SelectionProvider(props: {
24
+ preselectedAssetIds: string[];
25
+ children: React.ReactNode;
26
+ }): React.JSX.Element;
27
+ export declare function useSelection(): Context;
28
+ export declare function useSelectedAssetIds(): string[];
29
+ export declare function useSelectedCollectionIds(): string[];
30
+ export {};
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function SelectionFooter(): React.JSX.Element | null;
@@ -0,0 +1,10 @@
1
+ import { SelectionMode } from '../../app-config/appConfig.type';
2
+ interface Props {
3
+ assetIds?: string[];
4
+ collectionId?: number;
5
+ withExtension?: boolean;
6
+ selectionMode?: SelectionMode;
7
+ onSuccess?: () => void;
8
+ }
9
+ export declare function renderSelectionFooter({ assetIds, collectionId, withExtension, selectionMode, onSuccess, }?: Props): import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>;
10
+ export {};
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { SelectedItem } from '../SelectionContext';
3
+ interface Props {
4
+ selection: SelectedItem[];
5
+ }
6
+ export declare function AddMedia(props: Props): React.JSX.Element;
7
+ export {};
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { State } from './addMedia.type';
3
+ export declare function ButtonAction({ status, numberOfSelectedItems, }: {
4
+ status: State['status'];
5
+ numberOfSelectedItems: number;
6
+ }): React.JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { File } from '../file.type';
2
+ export type State = {
3
+ status: 'Done';
4
+ } | {
5
+ status: 'Error';
6
+ } | {
7
+ status: 'Loading';
8
+ } | {
9
+ status: 'WaitingForFileSelection';
10
+ } | {
11
+ status: 'Ready';
12
+ } | {
13
+ status: 'ReadyWithFile';
14
+ file: File;
15
+ };
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { Asset } from '../../views/asset/asset.type';
3
+ export declare function AssetItem({ asset }: {
4
+ asset: Asset;
5
+ }): React.JSX.Element;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { Collection } from '../../views/collection/collection.types';
3
+ export declare function CollectionItem({ collection }: {
4
+ collection: Collection;
5
+ }): React.JSX.Element;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ export declare function SelectedItemContainer({ title, onRemove, children, }: {
3
+ title: string;
4
+ onRemove: () => void;
5
+ children: React.ReactNode;
6
+ }): React.JSX.Element;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { SelectedItem } from '../SelectionContext';
3
+ export declare function SelectedItems({ selection }: {
4
+ selection: SelectedItem[];
5
+ }): React.JSX.Element;
@@ -0,0 +1,7 @@
1
+ export interface File {
2
+ url: string;
3
+ width?: number;
4
+ height?: number;
5
+ fileSize?: number;
6
+ isFakeOriginal?: boolean;
7
+ }
@@ -0,0 +1,5 @@
1
+ import { File } from './file.type';
2
+ export declare function getDefaultKey(files: Record<string, File>): 'transformBaseUrl' | 'original' | 'webImage';
3
+ export declare function splitByCamelCase(str: string): string;
4
+ export declare function getUrlExtension(url: string): string | undefined;
5
+ export declare function getHumanReadableFileSize(bytes: number): string;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export declare function DesignSystemProvider(props: {
3
+ children: React.ReactNode;
4
+ }): React.JSX.Element;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ export declare const RootElementProvider: import("react").Provider<HTMLElement | null>;
3
+ export declare const useRootElement: () => HTMLElement;
@@ -0,0 +1,27 @@
1
+ /// <reference types="react" />
2
+ export interface Theme {
3
+ colorPrimary?: string;
4
+ colorButtonPrimary?: string;
5
+ colorButtonPrimaryLabel?: string;
6
+ colorButtonPrimaryActive?: string;
7
+ colorButtonPrimaryHover?: string;
8
+ colorButtonPrimaryHoverLabel?: string;
9
+ }
10
+ export declare const themeVariables: (theme?: Theme) => {
11
+ '--componentButtonPrimaryBorderHover': string | undefined;
12
+ '--componentButtonPrimaryBorderActive': string | undefined;
13
+ '--componentButtonPrimaryBorderFocus': string | undefined;
14
+ '--componentButtonPrimaryColor': string | undefined;
15
+ '--componentButtonPrimaryColorHover': string | undefined;
16
+ '--componentButtonPrimaryColorActive': string | undefined;
17
+ '--componentButtonPrimaryColorFocus': string | undefined;
18
+ '--componentButtonPrimaryColorDisabled': string | undefined;
19
+ '--componentButtonPrimaryFill': string | undefined;
20
+ '--componentButtonPrimaryFillHover': string | undefined;
21
+ '--componentButtonPrimaryFillActive': string | undefined;
22
+ '--componentButtonPrimaryFillFocus': string | undefined;
23
+ };
24
+ export declare const ThemeStyles: import("react").NamedExoticComponent<import("styled-components").ExecutionProps & {
25
+ theme?: Theme | undefined;
26
+ }>;
27
+ export declare function stringifyTheme(theme?: Theme): string;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ interface ShadowRootProps {
3
+ children: React.ReactNode;
4
+ isContainerMode?: boolean;
5
+ }
6
+ /**
7
+ * This component will create a shadow root if it is the first ShadowRoot in the tree.
8
+ * Otherwise, it will just render it's children. This is useful as we don't always know
9
+ * which component will be first in the tree, especially when the components are used
10
+ * externally from the npm package.
11
+ */
12
+ export declare function ShadowRoot({ children, isContainerMode }: ShadowRootProps): React.JSX.Element;
13
+ export {};
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ interface Props {
3
+ children: React.ReactNode;
4
+ isContainerMode?: boolean;
5
+ }
6
+ /**
7
+ * This component creates a shadow root and injects styling so that outside
8
+ * styling do not interfere with compactview and compactview styling does
9
+ * not interfere with the DOM it's rendered in.
10
+ */
11
+ export declare function ShadowRootInternal({ children, isContainerMode }: Props): React.JSX.Element;
12
+ export {};
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export declare function ShadowRoot(props: {
3
+ children: React.ReactNode;
4
+ }): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function Toolbar(): React.JSX.Element | null;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function ViewSwitch(): React.JSX.Element;
@@ -0,0 +1,4 @@
1
+ /// <reference types="jest" />
2
+ export declare const logger: {
3
+ error: jest.Mock<any, any>;
4
+ };
@@ -0,0 +1 @@
1
+ export declare const debounceAsync: (fn: any, wait: any) => (...args: any[]) => Promise<unknown>;
@@ -0,0 +1,2 @@
1
+ import { selectedSmartfilterOptionsType } from '@src/api/rest/types';
2
+ export declare const convertOptionsToBase64: (options: selectedSmartfilterOptionsType | undefined) => string[] | undefined;
@@ -0,0 +1 @@
1
+ export declare const chunk: <T>(arr: T[], chunkSize: number) => T[][];
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Concatenates the list of classes given into a single class string.
3
+ *
4
+ * If a parameter is `false` or `undefined`, then it will be ignored. This
5
+ * is useful for building a single class string out of several classes,
6
+ * some of which are conditionally included.
7
+ *
8
+ * @example
9
+ * // When isActive is true, returns "link active"
10
+ * // When isActive is false, returns "link inactive"
11
+ * concatClasses(
12
+ * "link",
13
+ * isActive && "active",
14
+ * !isActive && "inactive"
15
+ * )
16
+ *
17
+ * @example
18
+ * // Ehen props.icon is defined, returns "base with-icon"
19
+ * // When props.icon is undefined, returns "base"
20
+ * concatClasses(
21
+ * "base",
22
+ * props.icon && "with-icon"
23
+ * )
24
+ */
25
+ export declare function concatClasses(...classes: (string | false | undefined)[]): string;
@@ -0,0 +1,8 @@
1
+ import { AssetType } from '@src/views/asset/asset.type';
2
+ type AssetTypeFiltersParams = {
3
+ filters?: string[] | AssetType[];
4
+ predefinedFilters?: string[] | AssetType[];
5
+ showToolbar?: boolean;
6
+ };
7
+ export declare const combineFilters: ({ filters, predefinedFilters, showToolbar, }: AssetTypeFiltersParams) => string[] | AssetType[] | undefined;
8
+ export {};
@@ -0,0 +1,9 @@
1
+ import { MetapropertyType } from '@src/filter/filters/metaproperty/MetapropertyFilterContent';
2
+ import { TextMetapropertiesType } from '@src/views/asset/asset.type';
3
+ interface ReturnType {
4
+ label: string;
5
+ value: string;
6
+ zIndex: number;
7
+ }
8
+ export declare const combineMetaproperties: (metaproperties?: MetapropertyType[], textMetaproperties?: TextMetapropertiesType[]) => ReturnType[];
9
+ export {};
@@ -0,0 +1,2 @@
1
+ import { SmartfilterMetaproperty } from '@src/api/rest/types';
2
+ export declare const filterEmptyMetaproperties: (metaproperties: Record<string, Record<string, SmartfilterMetaproperty>>) => {};
@@ -0,0 +1,2 @@
1
+ import { MetapropertyOptionType } from '@src/filter/filters/metaproperty/MetapropertyOption';
2
+ export declare const getMetaProperties: (metaproperties: MetapropertyOptionType[] | undefined) => string[] | undefined;
@@ -0,0 +1 @@
1
+ export declare const isObjectEmpty: (obj: Record<string, unknown> | undefined) => boolean;
@@ -0,0 +1,6 @@
1
+ export declare const logger: {
2
+ error: {
3
+ (...data: any[]): void;
4
+ (message?: any, ...optionalParams: any[]): void;
5
+ };
6
+ };
@@ -0,0 +1,3 @@
1
+ import { File } from '@src/select/file.type';
2
+ export declare function normalizeFilesResponse(files: Record<string, File>): Record<string, File>;
3
+ export declare function normalizeAssetsResponse(response: any): any;
@@ -0,0 +1,2 @@
1
+ export declare function pluralize(count: number, singular: string, plural: string): string;
2
+ export declare const nbsp = "\u00A0";
@@ -0,0 +1 @@
1
+ export declare const trimMetapropertyValue: (value: string) => string;
package/utils/url.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Converts given string to an URL which starts with `https://` and ends with
3
+ * a single trailing slash.
4
+ *
5
+ * @example
6
+ * // Returns "https://www.bynder.com/"
7
+ * ensureValidUrl("www.bynder.com")
8
+ *
9
+ * @example
10
+ * // Replaces http with https to return "https://www.bynder.com/"
11
+ * ensureValidUrl("http://www.bynder.com/")
12
+ */
13
+ export declare function ensureValidUrl(url: string): string;
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { SelectionMode } from '@src/app-config/appConfig.type';
3
+ import { Theme } from '@src/style/Theming';
4
+ import { Asset, AssetData } from './asset.type';
5
+ interface Props {
6
+ assets: AssetData;
7
+ count?: number;
8
+ hasNextPage?: boolean;
9
+ isLoading?: boolean;
10
+ loadMore?: () => void;
11
+ onSelect?: (assets: Asset[]) => void;
12
+ onToggle?: (assets: Asset[]) => void;
13
+ emptyStateElement?: React.ReactElement | null;
14
+ selectedAssetIds?: string[];
15
+ selectionMode?: SelectionMode;
16
+ theme?: Theme;
17
+ children?: React.ReactNode;
18
+ }
19
+ export declare function AssetList({ assets, count, hasNextPage, isLoading, loadMore, onSelect, onToggle, emptyStateElement, selectedAssetIds, selectionMode, theme, children, }: Props): React.JSX.Element;
20
+ export {};
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function AssetsView(): React.JSX.Element;
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { Connection } from '@src/api/graphql.types';
3
+ import { Asset } from './asset.type';
4
+ interface DataValue {
5
+ searchAssets: {
6
+ assets: {
7
+ totalCount: number;
8
+ nodes: Asset[];
9
+ };
10
+ };
11
+ }
12
+ interface Props {
13
+ connection: Connection<DataValue>;
14
+ totalCount?: number;
15
+ showActiveFilters?: boolean;
16
+ }
17
+ export declare function StatefulAssetList(props: Props): React.JSX.Element;
18
+ export {};
@@ -0,0 +1,7 @@
1
+ import { SelectionMode } from '../../../app-config/appConfig.type';
2
+ import { AssetFilterJson } from '../../../filter/assetFilter.type';
3
+ export declare function renderAssetsView({ hideExternalAccess, predefinedFilter, selectionMode, }?: {
4
+ hideExternalAccess?: boolean;
5
+ selectionMode?: SelectionMode;
6
+ predefinedFilter?: AssetFilterJson;
7
+ }): import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { Asset } from '../asset.type';
3
+ interface Props {
4
+ className?: string;
5
+ fadeIn?: boolean;
6
+ asset: Asset;
7
+ isSelected: boolean;
8
+ onClick?: (asset: Asset, event: React.MouseEvent) => void;
9
+ isOutlined: boolean;
10
+ children?: React.ReactNode;
11
+ }
12
+ export declare function AssetCard({ className, fadeIn, asset, isSelected, isOutlined, onClick, children, }: Props): React.JSX.Element;
13
+ export {};