@uniformdev/mesh-sdk-react 18.27.1-alpha.23 → 18.28.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 +12 -224
- package/dist/index.esm.js +34 -697
- package/dist/index.js +59 -737
- package/dist/index.mjs +34 -697
- package/package.json +4 -4
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
|
|
3
|
-
import React__default, { SVGProps, ComponentType, PropsWithChildren
|
|
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
|
|
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
|
|
88
|
-
selectedItemComponent?: React
|
|
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
|
|
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
|
|
473
|
+
type VariablesProviderProps = React.PropsWithChildren<{
|
|
474
474
|
value: Record<string, DataVariableDefinition>;
|
|
475
475
|
onChange: (newValue: Record<string, DataVariableDefinition>) => void;
|
|
476
|
-
editVariableComponent?: React
|
|
476
|
+
editVariableComponent?: React.ComponentType<VariableEditorProps>;
|
|
477
477
|
}>;
|
|
478
478
|
type VariablesAction = {
|
|
479
479
|
type: 'edit';
|
|
@@ -554,218 +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
|
-
};
|
|
563
|
-
/** @example <DataRefreshButton buttonText="my button" isLoading /> */
|
|
564
|
-
declare const DataRefreshButton: ({ buttonText, isLoading, ...props }: DataRefreshButtonProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
565
|
-
|
|
566
|
-
type EntrySearchContainerProps = {
|
|
567
|
-
/** a child node that places components within the search location */
|
|
568
|
-
searchFilters: ReactNode;
|
|
569
|
-
/** a child node that places components within a scrollable list location */
|
|
570
|
-
resultList: ReactNode;
|
|
571
|
-
/** allows any child element */
|
|
572
|
-
children?: ReactNode;
|
|
573
|
-
/** function for the save action */
|
|
574
|
-
onSave?: () => void;
|
|
575
|
-
/** function fort he cancel action */
|
|
576
|
-
onCancel?: () => void;
|
|
577
|
-
};
|
|
578
|
-
/** @example <EntrySearchContainer searchFilters={<>your component</>} resultList={<>your result list component<>} onSave={yourSaveAction} onCancel={yourCancelAction} /> */
|
|
579
|
-
declare const EntrySearchContainer: ({ searchFilters, resultList, onSave, onCancel, children, }: EntrySearchContainerProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
580
|
-
|
|
581
|
-
type EntrySearchFilterProps = {
|
|
582
|
-
/** shows or hides the required content type select option */
|
|
583
|
-
requireContentType?: boolean;
|
|
584
|
-
/** sets the text for the required content type select option
|
|
585
|
-
* @default 'All content types'
|
|
586
|
-
*/
|
|
587
|
-
typeSelectorAllTypesOptionText?: string;
|
|
588
|
-
/** sets the select input value label text
|
|
589
|
-
* @default 'Content Type Select'
|
|
590
|
-
*/
|
|
591
|
-
selectLabel?: string;
|
|
592
|
-
/** sets the select input options */
|
|
593
|
-
selectOptions: Array<{
|
|
594
|
-
id: string;
|
|
595
|
-
name: string;
|
|
596
|
-
}>;
|
|
597
|
-
/** sets the search input name value
|
|
598
|
-
* @default 'searchText'
|
|
599
|
-
*/
|
|
600
|
-
searchInputName?: string;
|
|
601
|
-
/** sets the search input placeholder text
|
|
602
|
-
* @default 'Enter keyword to narrow your results'
|
|
603
|
-
*/
|
|
604
|
-
searchInputPlaceholderText?: string;
|
|
605
|
-
};
|
|
606
|
-
/** @example <EntrySearchFilter selectOptions={[{ id: 'id value', name: 'name value'}]} /> */
|
|
607
|
-
declare const EntrySearchFilter: ({ requireContentType, typeSelectorAllTypesOptionText, searchInputName, searchInputPlaceholderText, selectLabel, selectOptions, }: EntrySearchFilterProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
608
|
-
|
|
609
|
-
type EntrySearchFilterContainerProps = {
|
|
610
|
-
label: string;
|
|
611
|
-
children?: React.ReactNode;
|
|
612
|
-
};
|
|
613
|
-
declare const EntrySearchFilterContainer: ({ label, children }: EntrySearchFilterContainerProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
614
|
-
|
|
615
|
-
type EntrySearchListItemProps = {
|
|
616
|
-
id: string;
|
|
617
|
-
title: string;
|
|
618
|
-
subTitle?: string | string[];
|
|
619
|
-
image?: {
|
|
620
|
-
src: string;
|
|
621
|
-
alt: string;
|
|
622
|
-
width?: number;
|
|
623
|
-
height?: number;
|
|
624
|
-
};
|
|
625
|
-
onSelect?: (data?: Record<string, unknown>) => void;
|
|
626
|
-
popoverInfo?: React$1.ReactNode;
|
|
627
|
-
children?: React$1.ReactNode;
|
|
628
|
-
};
|
|
629
|
-
declare const EntrySearchListItem: ({ id, title, subTitle, image, popoverInfo, onSelect, children, ...props }: EntrySearchListItemProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
630
|
-
declare const EntrySearchListItemLoadingSkeleton: () => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
631
|
-
|
|
632
|
-
type StatusTypes = 'published' | 'modified' | 'draft' | 'unpublished';
|
|
633
|
-
type PublishStatusProps = {
|
|
634
|
-
status: StatusTypes;
|
|
635
|
-
};
|
|
636
|
-
declare const PublishStatus: ({ status }: PublishStatusProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
637
|
-
|
|
638
|
-
type EntrySearchResultItemProps = {
|
|
639
|
-
/** sets the id which is used for removal functionality */
|
|
640
|
-
id: string;
|
|
641
|
-
/** sets the title value */
|
|
642
|
-
title: string;
|
|
643
|
-
/** sets the subtitle value */
|
|
644
|
-
subtitle?: string;
|
|
645
|
-
/** sets user defined child nodes inside the popover box */
|
|
646
|
-
popoverInfo?: ReactNode;
|
|
647
|
-
/** sets the publish status */
|
|
648
|
-
publishStatus?: StatusTypes;
|
|
649
|
-
/** sets the created date */
|
|
650
|
-
createdAt?: TDate;
|
|
651
|
-
/** sets additional remove functionality onto of default removal */
|
|
652
|
-
onRemove?: () => void;
|
|
653
|
-
/** sets whether to show or hide the remove button
|
|
654
|
-
* @default false
|
|
655
|
-
*/
|
|
656
|
-
hideRemoveButton?: boolean;
|
|
657
|
-
/** sets user defined child nodes that are uncontrolled by Uniform */
|
|
658
|
-
children?: ReactNode;
|
|
659
|
-
};
|
|
660
|
-
declare const EntrySearchResultItem: ({ id, title, subtitle, popoverInfo, publishStatus, onRemove, createdAt, hideRemoveButton, children, }: EntrySearchResultItemProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
661
|
-
|
|
662
|
-
type EntrySearchResultItemButtonProps = HTMLAttributes<HTMLButtonElement> & {
|
|
663
|
-
text: string;
|
|
664
|
-
icon?: string;
|
|
665
|
-
};
|
|
666
|
-
declare const EntrySearchResultItemButton: ({ text, icon, ...props }: EntrySearchResultItemButtonProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
667
|
-
type LinkButtonProps = AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
668
|
-
text: string;
|
|
669
|
-
icon?: string;
|
|
670
|
-
};
|
|
671
|
-
declare const LinkButton: ({ text, icon, ...props }: LinkButtonProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
672
|
-
|
|
673
|
-
type EntrySearchResultListProps = {
|
|
674
|
-
/** sets the result label value
|
|
675
|
-
* @default 'Selected'
|
|
676
|
-
*/
|
|
677
|
-
resultLabelText?: string;
|
|
678
|
-
/** sets the on remove button click action */
|
|
679
|
-
onRemoveAllSelected?: () => void;
|
|
680
|
-
/** sets the remove button text
|
|
681
|
-
* @default 'Remove all'
|
|
682
|
-
*/
|
|
683
|
-
removeButtonText?: string;
|
|
684
|
-
/** sets whether to show or hide the remove button
|
|
685
|
-
* @default false
|
|
686
|
-
*/
|
|
687
|
-
hideRemoveButton?: boolean;
|
|
688
|
-
/** allows additional buttons to be added to the result title group */
|
|
689
|
-
additionalButtons?: React.ReactNode;
|
|
690
|
-
/** allows placing child components within the result list area */
|
|
691
|
-
children?: React.ReactNode;
|
|
692
|
-
};
|
|
693
|
-
declare const EntrySearchResultList: ({ resultLabelText, removeButtonText, onRemoveAllSelected, hideRemoveButton, additionalButtons, children, }: EntrySearchResultListProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
694
|
-
|
|
695
|
-
type QueryFilterSearchProps = {
|
|
696
|
-
count: number;
|
|
697
|
-
sortBy: string;
|
|
698
|
-
sortOrder: string;
|
|
699
|
-
};
|
|
700
|
-
type QueryFilterProps = {
|
|
701
|
-
queryFilterTitle?: string;
|
|
702
|
-
requireContentType?: boolean;
|
|
703
|
-
typeSelectorAllTypesOptionText?: string;
|
|
704
|
-
contentTypeLabel?: string;
|
|
705
|
-
contentTypeOptions: Array<{
|
|
706
|
-
id: string;
|
|
707
|
-
name: string;
|
|
708
|
-
}>;
|
|
709
|
-
countLabel?: string;
|
|
710
|
-
countValue?: number;
|
|
711
|
-
sortLabel?: string;
|
|
712
|
-
sortOptions: Array<{
|
|
713
|
-
id: string;
|
|
714
|
-
name: string;
|
|
715
|
-
}>;
|
|
716
|
-
sortOrderLabel?: string;
|
|
717
|
-
sortOrderOptions: Array<{
|
|
718
|
-
id: string;
|
|
719
|
-
name: string;
|
|
720
|
-
}>;
|
|
721
|
-
children?: ReactNode;
|
|
722
|
-
};
|
|
723
|
-
declare const QueryFilter: ({ requireContentType, queryFilterTitle, contentTypeLabel, typeSelectorAllTypesOptionText, contentTypeOptions, countLabel, countValue, sortLabel, sortOptions, sortOrderLabel, sortOrderOptions, children, }: QueryFilterProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
724
|
-
|
|
725
|
-
type SearchQueryProps = {
|
|
726
|
-
/** sets the content type in the search context */
|
|
727
|
-
contentType: string | undefined;
|
|
728
|
-
/** sets the keyword search in the search context */
|
|
729
|
-
keywordSearch?: string;
|
|
730
|
-
[key: string]: unknown;
|
|
731
|
-
};
|
|
732
|
-
interface SelectedItemProps {
|
|
733
|
-
id: string;
|
|
734
|
-
title: string;
|
|
735
|
-
contentType?: string;
|
|
736
|
-
createdAt?: TDate;
|
|
737
|
-
editLink?: string;
|
|
738
|
-
metadata?: Record<string, string>;
|
|
739
|
-
popoverData?: ReactNode;
|
|
740
|
-
}
|
|
741
|
-
type ItemsProp = {
|
|
742
|
-
items?: Array<SelectedItemProps & Record<string, unknown>>;
|
|
743
|
-
};
|
|
744
|
-
type EntrySearchFilterContextProps = {
|
|
745
|
-
onSetQuery: (value: SearchQueryProps) => void;
|
|
746
|
-
query: SearchQueryProps;
|
|
747
|
-
onSelectItem: (selectedResult: any) => void;
|
|
748
|
-
onRemoveAllSelectedItems: () => void;
|
|
749
|
-
selectedListItems: Array<SelectedItemProps>;
|
|
750
|
-
list: ItemsProp;
|
|
751
|
-
onSetList: (value: ItemsProp) => void;
|
|
752
|
-
};
|
|
753
|
-
declare const EntrySearchContext: React$1.Context<EntrySearchFilterContextProps>;
|
|
754
|
-
type EntrySearchProviderProps = {
|
|
755
|
-
children: ReactNode;
|
|
756
|
-
currentlySelectedItems?: Array<SelectedItemProps>;
|
|
757
|
-
};
|
|
758
|
-
declare const EntrySearchProvider: ({ currentlySelectedItems, children }: EntrySearchProviderProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
759
|
-
declare const useEntrySearchContext: () => {
|
|
760
|
-
onSetQuery: (value: SearchQueryProps) => void;
|
|
761
|
-
query: SearchQueryProps;
|
|
762
|
-
onSelectItem: (selectedResult: any) => void;
|
|
763
|
-
onRemoveAllSelectedItems: () => void;
|
|
764
|
-
selectedListItems: Array<SelectedItemProps>;
|
|
765
|
-
list: ItemsProp;
|
|
766
|
-
onSetList: (value: ItemsProp) => void;
|
|
767
|
-
};
|
|
768
|
-
|
|
769
557
|
type MeshAppProps = {
|
|
770
558
|
loadingComponent?: React__default.ComponentType;
|
|
771
559
|
errorComponent?: React__default.ComponentType<{
|
|
@@ -804,7 +592,7 @@ type RequestData = {
|
|
|
804
592
|
method?: string;
|
|
805
593
|
body?: string;
|
|
806
594
|
};
|
|
807
|
-
type RequestProviderProps = React
|
|
595
|
+
type RequestProviderProps = React.PropsWithChildren<{
|
|
808
596
|
value: RequestData;
|
|
809
597
|
onChange: (delegate: (oldValue: RequestData) => RequestData) => void;
|
|
810
598
|
}>;
|
|
@@ -841,12 +629,12 @@ type RequestContext = {
|
|
|
841
629
|
declare function RequestProvider({ value, onChange, children }: RequestProviderProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
842
630
|
declare function useRequest(): RequestContext;
|
|
843
631
|
|
|
844
|
-
type RequestTypeContainerProps = React
|
|
632
|
+
type RequestTypeContainerProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
845
633
|
/**sets the background color of the container
|
|
846
634
|
* @default 'transparent'
|
|
847
635
|
*/
|
|
848
636
|
bgColor?: 'transparent' | 'var(--gray-100)';
|
|
849
|
-
children: React
|
|
637
|
+
children: React.ReactNode;
|
|
850
638
|
};
|
|
851
639
|
/**
|
|
852
640
|
* @description a container to layout content in a 2 column grid format = 12ch 1fr
|
|
@@ -959,4 +747,4 @@ declare function useUniformMeshSdk(): _uniformdev_mesh_sdk.UniformMeshSDK;
|
|
|
959
747
|
*/
|
|
960
748
|
declare function createLocationValidator<TSetValue>(setValue: SetLocationValueDispatch<TSetValue>, validate: (newValue: TSetValue, currentResult: SetValueOptions | undefined) => SetValueOptions): SetLocationValueDispatch<TSetValue>;
|
|
961
749
|
|
|
962
|
-
export { BaseRequestData, Brand, DamItem, DamSelectedItem, DamSelectedItemProps,
|
|
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 };
|