@soma-vertical-web/multi-lib 0.0.33 → 0.0.34

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soma-vertical-web/multi-lib",
3
- "version": "0.0.33",
3
+ "version": "0.0.34",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {
@@ -1,35 +1,12 @@
1
1
  import { Size } from '@soma-vertical-web/core-components/src/lib/TextField/interfaces';
2
2
  import { EditorState } from 'draft-js';
3
3
  import { CSSProperties } from 'react';
4
+ import { FACET_CROSS_SELLING_MAP, ObjectFitsDefault, PLP_FILTERS_SORT } from '../constants';
4
5
 
5
- export declare const PDPShelfType: readonly ["whosawalsosaw", "whosawalsobought", "whoboughtalsobought", "accessories", "similars", "showtogether", "suggestions"];
6
- export declare const FACET_CROSS_SELLING_MAP: {
7
- readonly buy: "whoboughtalsobought";
8
- readonly view: "whosawalsosaw";
9
- readonly similars: "similars";
10
- readonly viewAndBought: "whosawalsobought";
11
- readonly accessories: "accessories";
12
- readonly suggestions: "suggestions";
13
- };
14
6
  export interface CrossSellingFacet {
15
7
  key: keyof typeof FACET_CROSS_SELLING_MAP;
16
8
  value: string;
17
9
  }
18
- export declare const PLP_FILTERS_SORT: {
19
- placeholder: string;
20
- options: {
21
- score_desc: string;
22
- orders_desc: string;
23
- price_desc: string;
24
- price_asc: string;
25
- release_desc: string;
26
- discount_desc: string;
27
- name_asc: string;
28
- };
29
- default_option: string;
30
- };
31
- export declare const SORT_OPTIONS: string[];
32
- export declare const ObjectFitsDefault: readonly ["contain", "cover", "fill", "none"];
33
10
  /**
34
11
  * TODO: remove 'textarea-size' from InputSizes in core-compoennts
35
12
  */
@@ -72,6 +49,7 @@ export type MENU_MOB_BTN_SIDEType = 'left' | 'right';
72
49
  export type MENU_INFOType = Record<string, Record<string, string>>;
73
50
  export type MENU_NAVIGATION_BAR_ALLOWEDType = boolean;
74
51
  export type NAME_SPLIT_SYMBOLType = string;
52
+ export type OBJECT_FITS_DEFAULTType = (typeof ObjectFitsDefault)[number];
75
53
  export type PAYMENT_FLAGS_DICTIONARYType = Record<string, string>;
76
54
  export type PAYMENT_FLAGSType = any;
77
55
  export type PDP_INFOType = Record<string, Record<string, string>>;
@@ -81,6 +59,8 @@ export type PLP_FILTERSType = {
81
59
  eventLabel: string;
82
60
  order: number;
83
61
  }[];
62
+ export type PLP_FILTERS_SORTType = typeof PLP_FILTERS_SORT;
63
+ export type PLP_FILTERS_SORT_OPTIONtype = keyof typeof PLP_FILTERS_SORT.options;
84
64
  export type PLP_GRID_SCROLL_BACKType = Record<string, string>;
85
65
  export type PLP_SHOW_VIDEO_ON_PRODUCT_CARDType = boolean;
86
66
  export type PRODUCT_CARD_IMAGE_ASPECT_RATIOType = string;
@@ -3,7 +3,7 @@ import { ProductSearchResultPage } from '../../data/api/search/product';
3
3
  import { BreadCrumbItemLinkProps } from '../../layout/team-components/PDCNavigation/intex';
4
4
  import { State, Suggestion } from '../../data/api/search';
5
5
  import { Facet, SelectedFacet } from '../../data/api/search/facets';
6
- import { PLPFilterOption } from '../../layout/team-components/Sort';
6
+ import { ITEMS_PER_PAGEType, PLP_FILTERS_SORT_OPTIONtype } from '../../constants';
7
7
 
8
8
  export interface FacetsContextProps {
9
9
  breadcrumb: BreadCrumbItemLinkProps[];
@@ -13,13 +13,16 @@ export interface FacetsContextProps {
13
13
  selectedFacets: SelectedFacet[];
14
14
  searchParams: FacetsProviderProps['searchParams'];
15
15
  onToggleFacet(value: SelectedFacet): void;
16
- onSort(sort: PLPFilterOption): void;
16
+ onSort(sort: PLP_FILTERS_SORT_OPTIONtype): void;
17
17
  }
18
18
  export interface FacetsProviderProps extends PropsWithChildren, Pick<ProductsProviderProps, 'state' | 'forceUpdate'> {
19
19
  searchParams: {
20
20
  [key: string]: string | string[] | undefined;
21
21
  };
22
22
  }
23
+ export interface FacetsProviderContentProps extends FacetsProviderProps {
24
+ selectedFacets: SelectedFacet[];
25
+ }
23
26
  export interface ProductsContextProps extends ProductSearchResultPage {
24
27
  isLoading: boolean;
25
28
  total: number;
@@ -47,6 +50,9 @@ export interface SearchProviderProps extends PropsWithChildren {
47
50
  state: State;
48
51
  collectionId?: number | null;
49
52
  count?: number;
53
+ CONSTANTS: {
54
+ ITEMS_PER_PAGE: ITEMS_PER_PAGEType;
55
+ };
50
56
  }
51
57
  export interface SearchItem {
52
58
  term: string;
@@ -1,4 +1,4 @@
1
- import { ADD_TO_CARTType, ObjectFitsDefault, TEXTURE_IMAGEType, TOGGLE_STYLE_MODIFIERType, Z_INDEX_WARType, NAME_SPLIT_SYMBOLType } from '../../../constants';
1
+ import { ADD_TO_CARTType, TEXTURE_IMAGEType, TOGGLE_STYLE_MODIFIERType, Z_INDEX_WARType, NAME_SPLIT_SYMBOLType, OBJECT_FITS_DEFAULTType } from '../../../constants';
2
2
  import { CartItemStore } from '../../../contexts/store/cart';
3
3
  import { Dispatch, HTMLAttributes, MutableRefObject, ReactNode, SetStateAction, VideoHTMLAttributes } from 'react';
4
4
 
@@ -76,7 +76,7 @@ export interface TooltipProps extends HTMLAttributes<HTMLDivElement> {
76
76
  Z_INDEX_WAR: Z_INDEX_WARType;
77
77
  }
78
78
  interface MediaObjectFit {
79
- objectFit?: (typeof ObjectFitsDefault)[number];
79
+ objectFit?: OBJECT_FITS_DEFAULTType;
80
80
  }
81
81
  export interface CustomImageProps extends MediaObjectFit, HTMLImageElement {
82
82
  ImgComp: React.ComponentType<any>;
@@ -1,8 +1,7 @@
1
1
  import { ButtonProps } from '@soma-vertical-web/core-components/src/lib/Button/interfaces';
2
- import { PLP_FILTERS_SORT } from '../../../constants';
3
2
  import { Dispatch, HTMLAttributes, ReactNode, SetStateAction } from 'react';
3
+ import { PLP_FILTERS_SORT_OPTIONtype } from '../../../constants';
4
4
 
5
- export type PLPFilterOption = keyof typeof PLP_FILTERS_SORT.options;
6
5
  export type RootProps = HTMLAttributes<HTMLDivElement>;
7
6
  export interface SortButtonProps extends Omit<ButtonProps, 'adornment' | 'iconNameStart' | 'iconNameEnd'> {
8
7
  btnAdornment?: {
@@ -12,7 +11,7 @@ export interface SortButtonProps extends Omit<ButtonProps, 'adornment' | 'iconNa
12
11
  sortListOpen: boolean;
13
12
  }
14
13
  export interface SortProps extends RootProps {
15
- handleSelectValue?: (value?: PLPFilterOption) => void;
14
+ handleSelectValue?: (value?: PLP_FILTERS_SORT_OPTIONtype) => void;
16
15
  sortListOpen: boolean;
17
16
  setSortListOpen: Dispatch<SetStateAction<boolean>>;
18
17
  }