@uniformdev/mesh-sdk-react 18.27.1-alpha.25 → 18.29.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.
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as _emotion_react_types_jsx_namespace from '@emotion/react/types/jsx-namespace';
2
- import * as React$1 from 'react';
3
- import React__default, { SVGProps, ComponentType, PropsWithChildren, HTMLAttributes, ReactNode, AnchorHTMLAttributes } from 'react';
2
+ import * as React from 'react';
3
+ import React__default, { SVGProps, ComponentType, PropsWithChildren } from 'react';
4
4
  import { TDate } from 'timeago.js';
5
5
  import * as _emotion_react from '@emotion/react';
6
6
  import { DataVariableDefinition, DataResourceVariables } from '@uniformdev/canvas';
@@ -77,20 +77,20 @@ type EntrySearchProps<TResult extends EntrySearchResult = EntrySearchResult> = {
77
77
  cursor?: string;
78
78
  contentTypes?: EntrySearchContentType[];
79
79
  selectedItems: TResult[] | undefined;
80
- logoIcon: string | React$1.ComponentType<{
80
+ logoIcon: string | React.ComponentType<{
81
81
  className?: string;
82
82
  }>;
83
83
  select: (items: TResult[], selectedContentType?: string) => void;
84
84
  requireContentType?: boolean;
85
85
  multiSelectId?: string;
86
86
  multiSelect?: boolean;
87
- rowComponent?: React$1.FC<EntrySearchRowProps<TResult>>;
88
- selectedItemComponent?: React$1.FC<EntrySearchSelectedItemProps<TResult>>;
87
+ rowComponent?: React.FC<EntrySearchRowProps<TResult>>;
88
+ selectedItemComponent?: React.FC<EntrySearchSelectedItemProps<TResult>>;
89
89
  onAddNew?: (type: EntrySearchContentType) => void;
90
90
  onEditClosed?: (item: EntrySearchResult) => void;
91
91
  onCancel?: () => void;
92
92
  resultsLoading?: boolean;
93
- noResultsComponent?: React$1.FC<{
93
+ noResultsComponent?: React.FC<{
94
94
  searchText?: string;
95
95
  selectedContentType?: string;
96
96
  }>;
@@ -470,10 +470,10 @@ declare function VariableEditor({ variable, onSubmit, onCancel }: VariableEditor
470
470
 
471
471
  declare function VariablesList(): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
472
472
 
473
- type VariablesProviderProps = React$1.PropsWithChildren<{
473
+ type VariablesProviderProps = React.PropsWithChildren<{
474
474
  value: Record<string, DataVariableDefinition>;
475
475
  onChange: (newValue: Record<string, DataVariableDefinition>) => void;
476
- editVariableComponent?: React$1.ComponentType<VariableEditorProps>;
476
+ editVariableComponent?: React.ComponentType<VariableEditorProps>;
477
477
  }>;
478
478
  type VariablesAction = {
479
479
  type: 'edit';
@@ -554,242 +554,6 @@ type DataTypeEditorProps = PropsWithChildren<{
554
554
  */
555
555
  declare function DataTypeEditor({ onChange, children, editVariableComponent }: DataTypeEditorProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
556
556
 
557
- type DataRefreshButtonProps = HTMLAttributes<HTMLButtonElement> & {
558
- /** sets the button text */
559
- buttonText: string;
560
- /** shows or hides the loading indicator when retrieving data */
561
- isLoading: boolean;
562
- /** sets the onClick function */
563
- onRefreshData: () => void;
564
- };
565
- /** @example <DataRefreshButton buttonText="my button" isLoading /> */
566
- declare const DataRefreshButton: ({ buttonText, isLoading, onRefreshData, ...props }: DataRefreshButtonProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
567
-
568
- type EntrySearchContainerProps = {
569
- /** a child node that places components within the search location */
570
- searchFilters: ReactNode;
571
- /** a child node that places components within a scrollable list location */
572
- resultList?: ReactNode;
573
- /** allows any child element */
574
- children?: ReactNode;
575
- /** function for the save action */
576
- onSave?: () => void;
577
- /** function fort he cancel action */
578
- onCancel?: () => void;
579
- };
580
- /** @example <EntrySearchContainer searchFilters={<>your component</>} resultList={<>your result list component<>} onSave={yourSaveAction} onCancel={yourCancelAction} /> */
581
- declare const EntrySearchContainer: ({ searchFilters, resultList, onSave, onCancel, children, }: EntrySearchContainerProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
582
-
583
- type EntrySearchFilterProps = {
584
- /** shows or hides the required content type select option */
585
- requireContentType?: boolean;
586
- /** sets the text for the required content type select option
587
- * @default 'All content types'
588
- */
589
- typeSelectorAllTypesOptionText?: string;
590
- /** sets the select input value label text
591
- * @default 'Content Type Select'
592
- */
593
- selectLabel?: string;
594
- /** sets the select input options */
595
- selectOptions: Array<{
596
- id: string;
597
- name: string;
598
- }>;
599
- /** sets the search input name value
600
- * @default 'searchText'
601
- */
602
- searchInputName?: string;
603
- /** sets the search input placeholder text
604
- * @default 'Enter keyword to narrow your results'
605
- */
606
- searchInputPlaceholderText?: string;
607
- };
608
- /** @example <EntrySearchFilter selectOptions={[{ id: 'id value', name: 'name value'}]} /> */
609
- declare const EntrySearchFilter: ({ requireContentType, typeSelectorAllTypesOptionText, searchInputName, searchInputPlaceholderText, selectLabel, selectOptions, }: EntrySearchFilterProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
610
-
611
- type EntrySearchFilterContainerProps = {
612
- label: string;
613
- children?: React.ReactNode;
614
- };
615
- declare const EntrySearchFilterContainer: ({ label, children }: EntrySearchFilterContainerProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
616
-
617
- type StatusTypes = 'published' | 'modified' | 'draft' | 'unpublished';
618
- type PublishStatusProps = {
619
- status: StatusTypes;
620
- };
621
- declare const PublishStatus: ({ status }: PublishStatusProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
622
-
623
- type SearchQueryProps = {
624
- /** sets the content type in the search context */
625
- contentType: string | undefined;
626
- /** sets the keyword search in the search context */
627
- keywordSearch?: string;
628
- };
629
- type SelectedItemProps = {
630
- /** sets the id value */
631
- id: string;
632
- /** sets the title value */
633
- title: string;
634
- /** sets the name valu, sometimes used for products */
635
- name?: string;
636
- /** sets the subtitle value */
637
- subtitle?: string;
638
- /** sets the content type value */
639
- contentType?: string;
640
- /** sets the created date value using TimeAgo to transform the date */
641
- createdAt?: TDate;
642
- /** sets the image src */
643
- imageUrl?: string;
644
- /** sets the link icon */
645
- editLinkIcon?: string | React.ComponentType<{
646
- className?: string;
647
- }>;
648
- /** sets the link href value to an external source */
649
- editLink?: string;
650
- /** sets the publish status */
651
- publishStatus?: StatusTypes;
652
- /** sets any additional meta data */
653
- metadata?: Record<string, string>;
654
- /** allows for child react elements to be nested in the popover */
655
- popoverData?: ReactNode;
656
- };
657
- type ItemsProp = Array<SelectedItemProps & Record<string, unknown>>;
658
- type ItemListProps<TList extends ItemsProp = ItemsProp> = {
659
- items?: TList;
660
- [key: string]: unknown;
661
- };
662
- type EntrySearchContextProps = {
663
- /** function that updates / sets the search query state */
664
- onSetQuery: (value: SearchQueryProps) => void;
665
- /** current search query state */
666
- query: SearchQueryProps;
667
- /** function that sets the selected items to state */
668
- onSelectItem: (selectedResult: any) => void;
669
- /** function that clears all selected items from state */
670
- onRemoveAllSelectedItems: () => void;
671
- /** current selected items in state */
672
- selectedListItems: Array<SelectedItemProps>;
673
- /** current list of results in state */
674
- list: ItemListProps;
675
- /** function that sets the list of items to state */
676
- onSetList: (value: ItemListProps) => void;
677
- };
678
- declare const EntrySearchContext: React$1.Context<EntrySearchContextProps>;
679
- type EntrySearchProviderProps = {
680
- children: ReactNode;
681
- currentlySelectedItems?: Array<SelectedItemProps>;
682
- };
683
- declare const EntrySearchProvider: ({ currentlySelectedItems, children }: EntrySearchProviderProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
684
- declare const useEntrySearchContext: () => {
685
- /** function that updates / sets the search query state */
686
- onSetQuery: (value: SearchQueryProps) => void;
687
- /** current search query state */
688
- query: SearchQueryProps;
689
- /** function that sets the selected items to state */
690
- onSelectItem: (selectedResult: any) => void;
691
- /** function that clears all selected items from state */
692
- onRemoveAllSelectedItems: () => void;
693
- /** current selected items in state */
694
- selectedListItems: Array<SelectedItemProps>;
695
- /** current list of results in state */
696
- list: ItemListProps;
697
- /** function that sets the list of items to state */
698
- onSetList: (value: ItemListProps) => void;
699
- };
700
-
701
- type EntrySearchListItemProps = SelectedItemProps & {
702
- contentType?: string | string[];
703
- image?: {
704
- src: string;
705
- alt: string;
706
- width?: number;
707
- height?: number;
708
- };
709
- onSelect?: (data?: Record<string, unknown>) => void;
710
- popoverInfo?: React$1.ReactNode;
711
- children?: React$1.ReactNode;
712
- };
713
- declare const EntrySearchListItem: ({ id, title, contentType, image, popoverInfo, onSelect, children, ...props }: EntrySearchListItemProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
714
- declare const EntrySearchListItemLoadingSkeleton: () => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
715
-
716
- type EntrySearchResultItemProps = SelectedItemProps & {
717
- /** sets additional remove functionality onto of default removal */
718
- onRemove?: () => void;
719
- /** sets whether to show or hide the remove button
720
- * @default false
721
- */
722
- hideRemoveButton?: boolean;
723
- /** sets user defined child nodes that are uncontrolled by Uniform */
724
- children?: ReactNode;
725
- };
726
- declare const EntrySearchResultItem: ({ id, title, name, contentType, popoverData, publishStatus, editLinkIcon, editLink, imageUrl, onRemove, createdAt, hideRemoveButton, children, }: EntrySearchResultItemProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
727
-
728
- type EntrySearchResultItemButtonProps<THtml extends HTMLAttributes<HTMLElement> = HTMLAttributes<HTMLButtonElement>> = {
729
- text: string;
730
- icon?: string | React.ComponentType<{
731
- className?: string;
732
- }>;
733
- } & THtml;
734
- declare const EntrySearchResultItemButton: ({ text, icon, ...props }: EntrySearchResultItemButtonProps<HTMLAttributes<HTMLButtonElement>>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
735
- declare const LinkButton: ({ text, icon, ...props }: EntrySearchResultItemButtonProps<AnchorHTMLAttributes<HTMLAnchorElement>>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
736
-
737
- type EntrySearchResultListProps<TRenderComponent extends SelectedItemProps = SelectedItemProps> = {
738
- /** sets the result label value
739
- * @default 'Selected'
740
- */
741
- resultLabelText?: string;
742
- /** sets the on remove button click action */
743
- onRemoveAllSelected?: () => void;
744
- /** sets the remove button text
745
- * @default 'Remove all'
746
- */
747
- removeButtonText?: string;
748
- /** sets whether to show or hide the remove button
749
- * @default false
750
- */
751
- hideRemoveButton?: boolean;
752
- /** allows additional buttons to be added to the result title group */
753
- additionalButtons?: React.ReactNode;
754
- /** allows placing child components within the result list area */
755
- renderResultComponent?: (value: TRenderComponent) => React.ReactNode;
756
- /** disable or enable drag and drop functionality
757
- * @default false
758
- */
759
- disableDnD?: boolean;
760
- };
761
- declare const EntrySearchResultList: ({ resultLabelText, removeButtonText, onRemoveAllSelected, hideRemoveButton, additionalButtons, renderResultComponent, disableDnD, }: EntrySearchResultListProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
762
-
763
- type QueryFilterSearchProps = {
764
- count: number;
765
- sortBy: string;
766
- sortOrder: string;
767
- };
768
- type QueryFilterProps = {
769
- queryFilterTitle?: string;
770
- requireContentType?: boolean;
771
- typeSelectorAllTypesOptionText?: string;
772
- contentTypeLabel?: string;
773
- contentTypeOptions: Array<{
774
- id: string;
775
- name: string;
776
- }>;
777
- countLabel?: string;
778
- countValue?: number;
779
- sortLabel?: string;
780
- sortOptions: Array<{
781
- id: string;
782
- name: string;
783
- }>;
784
- sortOrderLabel?: string;
785
- sortOrderOptions: Array<{
786
- id: string;
787
- name: string;
788
- }>;
789
- children?: ReactNode;
790
- };
791
- declare const QueryFilter: ({ requireContentType, queryFilterTitle, contentTypeLabel, typeSelectorAllTypesOptionText, contentTypeOptions, countLabel, countValue, sortLabel, sortOptions, sortOrderLabel, sortOrderOptions, children, }: QueryFilterProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
792
-
793
557
  type MeshAppProps = {
794
558
  loadingComponent?: React__default.ComponentType;
795
559
  errorComponent?: React__default.ComponentType<{
@@ -828,7 +592,7 @@ type RequestData = {
828
592
  method?: string;
829
593
  body?: string;
830
594
  };
831
- type RequestProviderProps = React$1.PropsWithChildren<{
595
+ type RequestProviderProps = React.PropsWithChildren<{
832
596
  value: RequestData;
833
597
  onChange: (delegate: (oldValue: RequestData) => RequestData) => void;
834
598
  }>;
@@ -865,12 +629,12 @@ type RequestContext = {
865
629
  declare function RequestProvider({ value, onChange, children }: RequestProviderProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
866
630
  declare function useRequest(): RequestContext;
867
631
 
868
- type RequestTypeContainerProps = React$1.HTMLAttributes<HTMLDivElement> & {
632
+ type RequestTypeContainerProps = React.HTMLAttributes<HTMLDivElement> & {
869
633
  /**sets the background color of the container
870
634
  * @default 'transparent'
871
635
  */
872
636
  bgColor?: 'transparent' | 'var(--gray-100)';
873
- children: React$1.ReactNode;
637
+ children: React.ReactNode;
874
638
  };
875
639
  /**
876
640
  * @description a container to layout content in a 2 column grid format = 12ch 1fr
@@ -983,4 +747,4 @@ declare function useUniformMeshSdk(): _uniformdev_mesh_sdk.UniformMeshSDK;
983
747
  */
984
748
  declare function createLocationValidator<TSetValue>(setValue: SetLocationValueDispatch<TSetValue>, validate: (newValue: TSetValue, currentResult: SetValueOptions | undefined) => SetValueOptions): SetLocationValueDispatch<TSetValue>;
985
749
 
986
- export { BaseRequestData, Brand, DamItem, DamSelectedItem, DamSelectedItemProps, DataRefreshButton, DataRefreshButtonProps, DataResourceVariableRendererProps, DataResourceVariablesList, DataResourceVariablesListProps, DataSourceEditor, DataSourceEditorProps, DataTypeEditor, DataTypeEditorProps, DataVariableDefinitionWithName, DefaultSearchRow, DefaultSelectedItem, DispatchResult, EntrySearch, EntrySearchContainer, EntrySearchContainerProps, EntrySearchContentType, EntrySearchContext, EntrySearchContextProps, EntrySearchFilter, EntrySearchFilterContainer, EntrySearchFilterContainerProps, EntrySearchFilterProps, EntrySearchListItem, EntrySearchListItemLoadingSkeleton, EntrySearchListItemProps, EntrySearchProps, EntrySearchProvider, EntrySearchProviderProps, EntrySearchQueryOptions, EntrySearchResult, EntrySearchResultItem, EntrySearchResultItemButton, EntrySearchResultItemButtonProps, EntrySearchResultItemProps, EntrySearchResultList, EntrySearchResultListProps, EntrySearchRowProps, EntrySearchSelectedItemProps, GetProductOptions, GetProductsOptions, index as Icons, InputToken, InputVariables, InputVariablesProps, ItemListProps, LinkButton, MeshApp, MeshAppProps, NoResultsProps, ProductCategory, ProductDynamicSelectorValue, ProductPreviewList, ProductQuery, ProductQueryCategory, ProductQueryContext, ProductQueryContextValue, ProductQueryProps, ProductSearch, ProductSearchContext, ProductSearchContextValue, ProductSearchProps, ProductSearchResult, ProductSearchResults, ProductSearchRow, ProductSelectedItem, PublishStatus, PublishStatusProps, QueryFilter, QueryFilterProps, QueryFilterSearchProps, RequestAction, RequestBody, RequestContext, RequestData, RequestHeaders, RequestMethodSelect, RequestParameter, RequestParameters, RequestParametersProps, RequestProvider, RequestProviderProps, RequestTypeContainer, RequestTypeContainerProps, RequestUrl, RequestUrlInput, ResolvableLoadingValue, SearchQueryProps, SelectedItemProps, SelectionField, SelectionFieldValue, SetLocationValueDispatch, SetLocationValueFunction, StatusTypes, TextVariableRenderer, UniformMeshLocationContext, UniformMeshLocationContextProvider, UniformMeshLocationContextValue, UniformMeshSdkContext, UniformMeshSdkContextProvider, UniformMeshSdkContextValue, UseUniformMeshSdkOptions, VariableEditor, VariableEditorProps, VariablesAction, VariablesContext, VariablesList, VariablesProvider, VariablesProviderProps, badgeIcon, createLocationValidator, damSelectItemImage, damSelectedItemContainer, damSelectedItemCopy, damSelectedItemDetails, damSelectedItemIcon, damSelectedItemInfoBtn, damSelectedItemInner, damSelectedItemLinkBtn, damSelectedItemLinkContainer, damSelectedItemMediaContainer, damSelectedItemPopover, damSelectedItemPopoverLabel, damSelectedItemSmallText, damSelectedItemTitle, draggableContainer, draggableIcon, draggableIconOffset, draggableIconWrapper, entrySearchBtn, entrySearchConfig, entrySearchConfigHidden, entrySearchLoadMoreBtn, entrySearchResultList, entrySearchSelectIcon, entrySearchSelectImg, entrySearchSelectInput, entrySearchSelectOption, entrySearchWrapper, productSearchRowActiveIcon, productSearchRowCategory, productSearchRowContainer, productSearchRowContent, productSearchRowContentActive, productSearchRowDetails, productSearchRowTitle, productSelectedItemContainer, productSelectedItemContent, productSelectedItemDetails, productSelectedItemIcon, productSelectedItemImage, productSelectedItemLinkContainer, productedSelectedItemLinkBtn, productedSelectedItemSmallText, searchRowBtn, searchRowContainer, searchRowContainerActive, searchRowContainerWithPopover, searchRowPopover, searchRowText, searchRowTextSmall, selectItemLinkBtn, selectItemLinkContainer, selectItemPopover, selectItemPopoverLabel, selectItemSmallText, selectedItemContainer, selectedItemCopy, selectedItemDetails, selectedItemIcon, selectedItemInner, selectedItemTitle, urlEncodeRequestParameter, urlEncodeRequestUrl, useEntrySearchContext, useInitializeUniformMeshSdk, useMeshLocation, useProductQueryContext, useProductSearchContext, useRequest, useRequestHeader, useRequestParameter, useUniformMeshLocation, useUniformMeshLocationContext, useUniformMeshSdk, useUniformMeshSdkContext, useVariables, variablesToList };
750
+ export { BaseRequestData, Brand, DamItem, DamSelectedItem, DamSelectedItemProps, DataResourceVariableRendererProps, DataResourceVariablesList, DataResourceVariablesListProps, DataSourceEditor, DataSourceEditorProps, DataTypeEditor, DataTypeEditorProps, DataVariableDefinitionWithName, DefaultSearchRow, DefaultSelectedItem, DispatchResult, EntrySearch, EntrySearchContentType, EntrySearchProps, EntrySearchQueryOptions, EntrySearchResult, EntrySearchRowProps, EntrySearchSelectedItemProps, GetProductOptions, GetProductsOptions, index as Icons, InputToken, InputVariables, InputVariablesProps, MeshApp, MeshAppProps, NoResultsProps, ProductCategory, ProductDynamicSelectorValue, ProductPreviewList, ProductQuery, ProductQueryCategory, ProductQueryContext, ProductQueryContextValue, ProductQueryProps, ProductSearch, ProductSearchContext, ProductSearchContextValue, ProductSearchProps, ProductSearchResult, ProductSearchResults, ProductSearchRow, ProductSelectedItem, RequestAction, RequestBody, RequestContext, RequestData, RequestHeaders, RequestMethodSelect, RequestParameter, RequestParameters, RequestParametersProps, RequestProvider, RequestProviderProps, RequestTypeContainer, RequestTypeContainerProps, RequestUrl, RequestUrlInput, ResolvableLoadingValue, SelectionField, SelectionFieldValue, SetLocationValueDispatch, SetLocationValueFunction, TextVariableRenderer, UniformMeshLocationContext, UniformMeshLocationContextProvider, UniformMeshLocationContextValue, UniformMeshSdkContext, UniformMeshSdkContextProvider, UniformMeshSdkContextValue, UseUniformMeshSdkOptions, VariableEditor, VariableEditorProps, VariablesAction, VariablesContext, VariablesList, VariablesProvider, VariablesProviderProps, badgeIcon, createLocationValidator, damSelectItemImage, damSelectedItemContainer, damSelectedItemCopy, damSelectedItemDetails, damSelectedItemIcon, damSelectedItemInfoBtn, damSelectedItemInner, damSelectedItemLinkBtn, damSelectedItemLinkContainer, damSelectedItemMediaContainer, damSelectedItemPopover, damSelectedItemPopoverLabel, damSelectedItemSmallText, damSelectedItemTitle, draggableContainer, draggableIcon, draggableIconOffset, draggableIconWrapper, entrySearchBtn, entrySearchConfig, entrySearchConfigHidden, entrySearchLoadMoreBtn, entrySearchResultList, entrySearchSelectIcon, entrySearchSelectImg, entrySearchSelectInput, entrySearchSelectOption, entrySearchWrapper, productSearchRowActiveIcon, productSearchRowCategory, productSearchRowContainer, productSearchRowContent, productSearchRowContentActive, productSearchRowDetails, productSearchRowTitle, productSelectedItemContainer, productSelectedItemContent, productSelectedItemDetails, productSelectedItemIcon, productSelectedItemImage, productSelectedItemLinkContainer, productedSelectedItemLinkBtn, productedSelectedItemSmallText, searchRowBtn, searchRowContainer, searchRowContainerActive, searchRowContainerWithPopover, searchRowPopover, searchRowText, searchRowTextSmall, selectItemLinkBtn, selectItemLinkContainer, selectItemPopover, selectItemPopoverLabel, selectItemSmallText, selectedItemContainer, selectedItemCopy, selectedItemDetails, selectedItemIcon, selectedItemInner, selectedItemTitle, urlEncodeRequestParameter, urlEncodeRequestUrl, useInitializeUniformMeshSdk, useMeshLocation, useProductQueryContext, useProductSearchContext, useRequest, useRequestHeader, useRequestParameter, useUniformMeshLocation, useUniformMeshLocationContext, useUniformMeshSdk, useUniformMeshSdkContext, useVariables, variablesToList };