@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.
- package/App.d.ts +27 -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__/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/graphql.types.d.ts +17 -0
- package/api/index.d.ts +7 -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/__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.d.ts +10 -0
- package/index.js +7 -7
- package/index.mjs +1060 -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 +2 -0
- package/order/FieldSelect.d.ts +7 -0
- package/order/OrderingContext.d.ts +19 -0
- package/package.json +10 -9
- package/router/RouterContext.d.ts +19 -0
- package/search/SearchContext.d.ts +25 -0
- package/search/SearchInput.d.ts +2 -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 +10 -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 +2 -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 +13 -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 +41 -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
|
@@ -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,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,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.
|
|
4
|
+
"version": "5.0.3",
|
|
5
5
|
"author": "Bynder",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"main": "index.js",
|
|
8
|
-
"module": "index.
|
|
9
|
-
"types": "
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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,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,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,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 { 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,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 @@
|
|
|
1
|
+
export declare const debounceAsync: (fn: any, wait: any) => (...args: any[]) => Promise<unknown>;
|
package/utils/chunk.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const chunk: <T>(arr: T[], chunkSize: number) => T[][];
|
package/utils/class.d.ts
ADDED
|
@@ -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 @@
|
|
|
1
|
+
export declare const isObjectEmpty: (obj: Record<string, unknown> | undefined) => boolean;
|
package/utils/text.d.ts
ADDED
|
@@ -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,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 {};
|