@bynder/compact-view 5.0.3 → 5.1.1

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.
@@ -1,2 +1,4 @@
1
1
  import React from 'react';
2
- export declare function DirectionSelect(): React.JSX.Element;
2
+ export declare function DirectionSelect({ nlSearch }: {
3
+ nlSearch?: boolean;
4
+ }): React.JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { Field } from './OrderingContext';
3
3
  interface FieldProps {
4
- options?: Field[];
4
+ options: Field[];
5
5
  }
6
- export declare function FieldSelect({ options, }: FieldProps): React.JSX.Element;
6
+ export declare function FieldSelect({ options }: FieldProps): React.JSX.Element;
7
7
  export {};
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { PageType } from '../router/RouterContext';
3
- export type Field = 'CREATED_AT' | 'NAME' | 'PUBLISHED_AT' | 'UPDATED_AT';
3
+ export type Field = 'CREATED_AT' | 'NAME' | 'PUBLISHED_AT' | 'UPDATED_AT' | 'NL_SEARCH';
4
4
  export type Direction = 'ASC' | 'DESC';
5
5
  export type Ordering = {
6
6
  field: Field;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bynder/compact-view",
3
3
  "description": "Bynder Compact View",
4
- "version": "5.0.3",
4
+ "version": "5.1.1",
5
5
  "author": "Bynder",
6
6
  "license": "UNLICENSED",
7
7
  "main": "index.js",
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import { useSimilaritySearchInterface } from '@src/api/getSimilarityAssets';
3
+ import { Asset } from '../views/asset/asset.type';
4
+ interface State {
5
+ isEnabled: boolean;
6
+ isSelected: boolean;
7
+ assets: Asset[];
8
+ isNLSSelected: boolean;
9
+ NLSSearchText?: string;
10
+ }
11
+ interface Actions {
12
+ setIsEnabled: (isEnabled: boolean) => void;
13
+ setIsSelected: (isSelected: boolean) => void;
14
+ setIsNLSelected: React.Dispatch<React.SetStateAction<boolean>>;
15
+ setAssets: (assets: Asset[]) => void;
16
+ setNLSSearchText: (text: string | undefined) => void;
17
+ }
18
+ export declare const SimilaritySearchContext: React.Context<(State & Actions & useSimilaritySearchInterface) | null>;
19
+ interface SimilaritySearchProviderProps {
20
+ children: React.ReactNode;
21
+ }
22
+ export declare function SimilaritySearchProvider({ children }: SimilaritySearchProviderProps): React.JSX.Element;
23
+ export declare function useSimilaritySearch(): State & Actions & useSimilaritySearchInterface;
24
+ export {};
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ interface Props {
3
+ isNLSSearchOn: boolean;
4
+ setIsNLSSearchOn: React.Dispatch<React.SetStateAction<boolean>>;
5
+ }
6
+ export declare const SwitchNLS: ({ isNLSSearchOn, setIsNLSSearchOn }: Props) => React.JSX.Element;
7
+ export {};
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ declare const Tooltip: ({ children }: {
3
+ children: any;
4
+ }) => React.JSX.Element;
5
+ export default Tooltip;
@@ -0,0 +1,3 @@
1
+ export * from './SearchContext';
2
+ export * from './SearchInput';
3
+ export * from './SimilaritySearchContext';
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { Asset, AssetData } from '../views/asset/asset.type';
3
3
  import { Collection } from '../views/collection/collection.types';
4
- type SelectedAsset = {
4
+ export type SelectedAsset = {
5
5
  type: 'asset';
6
6
  value: Asset;
7
7
  };
@@ -3,8 +3,9 @@ interface Props {
3
3
  assetIds?: string[];
4
4
  collectionId?: number;
5
5
  withExtension?: boolean;
6
+ withImage?: boolean;
6
7
  selectionMode?: SelectionMode;
7
8
  onSuccess?: () => void;
8
9
  }
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 declare function renderSelectionFooter({ assetIds, collectionId, withExtension, withImage, selectionMode, onSuccess, }?: Props): import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>;
10
11
  export {};
@@ -1,2 +1,3 @@
1
1
  import { selectedSmartfilterOptionsType } from '@src/api/rest/types';
2
2
  export declare const convertOptionsToBase64: (options: selectedSmartfilterOptionsType | undefined) => string[] | undefined;
3
+ export declare const convertAssetIdToBase64: (assetId: string) => string;
@@ -8,6 +8,8 @@ interface Props {
8
8
  onClick?: (asset: Asset, event: React.MouseEvent) => void;
9
9
  isOutlined: boolean;
10
10
  children?: React.ReactNode;
11
+ isSilimilaritySearchEnabled: boolean;
12
+ onSimilaritySearch: (selectedAsset: string[]) => void;
11
13
  }
12
- export declare function AssetCard({ className, fadeIn, asset, isSelected, isOutlined, onClick, children, }: Props): React.JSX.Element;
14
+ export declare function AssetCard({ className, fadeIn, asset, isSelected, isOutlined, onClick, children, isSilimilaritySearchEnabled, onSimilaritySearch, }: Props): React.JSX.Element;
13
15
  export {};
@@ -24,7 +24,9 @@ export interface TextMetapropertiesType {
24
24
  showInListView: boolean;
25
25
  }
26
26
  export interface Asset {
27
+ __typename: string;
27
28
  id: string;
29
+ databaseId: string;
28
30
  derivatives: Derivatives;
29
31
  extensions: string[];
30
32
  name: string;
@@ -32,6 +34,7 @@ export interface Asset {
32
34
  isArchived: boolean;
33
35
  isWatermarked: boolean;
34
36
  isLimitedUse: boolean;
37
+ similarityScore?: number;
35
38
  metaproperties?: {
36
39
  nodes: MetapropertyType[];
37
40
  };