@uniformdev/mesh-sdk-react 17.4.1-alpha.37 → 17.5.1-alpha.105

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
@@ -6,7 +6,9 @@ import React__default, { SVGProps } from 'react';
6
6
  import * as _emotion_react_types_jsx_namespace from '@emotion/react/types/jsx-namespace';
7
7
  import { TDate } from 'timeago.js';
8
8
  import * as _emotion_react from '@emotion/react';
9
- export { AddListButton, AddListButtonProps, Button, ButtonProps, Callout, CalloutProps, Heading, HeadingProps, Input, InputProps, InputSelect, InputToggle, InputToggleProps, InputKeywordSearch as KeywordSearchInput, Label, LabelProps, LoadingIndicator, LoadingOverlay, Menu, MenuItem, MenuItemProps, MenuProps, ScrollableList, ScrollableListItem, ScrollableListItemProps, ScrollableListProps, Switch, SwitchProps, Textarea, TextareaProps, Theme, ThemeProps } from '@uniformdev/design-system';
9
+ import { DataVariableDefinition } from '@uniformdev/canvas';
10
+ import { InputSelectProps } from '@uniformdev/design-system';
11
+ export { AddListButton, AddListButtonProps, Button, ButtonProps, Callout, CalloutProps, Heading, HeadingProps, Input, InputComboBox, InputComboBoxProps, InputProps, InputSelect, InputToggle, InputToggleProps, InputKeywordSearch as KeywordSearchInput, Label, LabelProps, LoadingIndicator, LoadingOverlay, Menu, MenuItem, MenuItemProps, MenuProps, ScrollableList, ScrollableListItem, ScrollableListItemProps, ScrollableListProps, Switch, SwitchProps, Textarea, TextareaProps, Theme, ThemeProps } from '@uniformdev/design-system';
10
12
 
11
13
  /**
12
14
  * Provides convenient access to the current Uniform Mesh location via React hook.
@@ -417,6 +419,137 @@ declare type MeshAppProps = {
417
419
  };
418
420
  declare const MeshApp: React__default.FC<React__default.PropsWithChildren<MeshAppProps>>;
419
421
 
422
+ declare type DataVariableDefinitionWithName = {
423
+ name: string;
424
+ } & DataVariableDefinition;
425
+ declare function variablesToList(variables: Record<string, DataVariableDefinition> | undefined): Array<DataVariableDefinitionWithName>;
426
+
427
+ declare type VariableEditorProps = {
428
+ variable: string;
429
+ onSubmit: (values: DataVariableDefinitionWithName) => void | Promise<void>;
430
+ onCancel: () => void;
431
+ };
432
+ declare function VariableEditor({ variable, onSubmit, onCancel }: VariableEditorProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
433
+
434
+ declare type VariablesProviderProps = React.PropsWithChildren<{
435
+ value: Record<string, DataVariableDefinition>;
436
+ onChange: (newValue: Record<string, DataVariableDefinition>) => void;
437
+ editVariableComponent?: React.ComponentType<VariableEditorProps>;
438
+ }>;
439
+ declare type VariablesAction = {
440
+ type: 'edit';
441
+ variable: string;
442
+ } | {
443
+ type: 'remove';
444
+ variable: string;
445
+ } | {
446
+ type: 'set';
447
+ variable: DataVariableDefinitionWithName;
448
+ openEditor?: boolean;
449
+ } | {
450
+ type: 'reorder';
451
+ result: Record<string, DataVariableDefinitionWithName>;
452
+ };
453
+ declare type VariablesContext = {
454
+ dispatch: (event: VariablesAction) => void;
455
+ variables: Readonly<Record<string, DataVariableDefinition>>;
456
+ };
457
+ declare function VariablesProvider({ value, onChange, editVariableComponent, children, }: VariablesProviderProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
458
+ declare function useVariables(): VariablesContext;
459
+
460
+ declare function VariablesList(): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
461
+
462
+ declare type InputToken = {
463
+ name: string;
464
+ value: string;
465
+ };
466
+ declare type InputVariablesProps = {
467
+ /** sets the input label value */
468
+ label: string;
469
+ /** sets the value of the input */
470
+ value: string;
471
+ /** sets the passed down function call */
472
+ onChange: (newValue: string) => void;
473
+ disableVariables?: boolean;
474
+ };
475
+ declare function InputVariables({ label, value, disableVariables, onChange }: InputVariablesProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
476
+
477
+ declare function RequestBody(): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
478
+
479
+ declare function RequestHeaders({ disableVariables }: Pick<InputVariablesProps, 'disableVariables'>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
480
+
481
+ declare function RequestMethodSelect(props: Omit<InputSelectProps, 'value' | 'onChange' | 'options'>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
482
+
483
+ declare function RequestParameters({ disableVariables }: Pick<InputVariablesProps, 'disableVariables'>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
484
+
485
+ declare type RequestParameter = {
486
+ key: string;
487
+ value: string;
488
+ };
489
+ declare type RequestData = {
490
+ relativeUrl: string;
491
+ headers: Array<RequestParameter>;
492
+ baseUrl?: string;
493
+ method?: string;
494
+ body?: string;
495
+ };
496
+ declare type ComputedRequestData = RequestData & {
497
+ parameters: Array<RequestParameter>;
498
+ };
499
+ declare type RequestProviderProps = React.PropsWithChildren<{
500
+ value: RequestData;
501
+ onChange: (newValue: ComputedRequestData) => void;
502
+ }>;
503
+ declare type RequestAction = {
504
+ type: 'setRelativeUrl';
505
+ relativeUrl: string;
506
+ } | {
507
+ type: 'updateHeader';
508
+ header: RequestParameter;
509
+ index?: number;
510
+ } | {
511
+ type: 'removeHeader';
512
+ index: number;
513
+ } | {
514
+ type: 'updateParameter';
515
+ parameter: RequestParameter;
516
+ index?: number;
517
+ } | {
518
+ type: 'removeParameter';
519
+ index: number;
520
+ } | {
521
+ type: 'setMethod';
522
+ method: string;
523
+ } | {
524
+ type: 'setBody';
525
+ body: string;
526
+ contentType: string;
527
+ };
528
+ declare type RequestContext = {
529
+ dispatch: (event: RequestAction) => void;
530
+ request: Readonly<ComputedRequestData>;
531
+ };
532
+ declare function RequestProvider({ value, onChange, children }: RequestProviderProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
533
+ declare function useRequest(): RequestContext;
534
+ declare function decomposeRelativeUrl(relativeUrl: string): [string, Array<RequestParameter>];
535
+
536
+ declare function RequestUrlInput(props: Omit<InputVariablesProps, 'value' | 'onChange'>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
537
+
538
+ declare type RequestTypeContainerProps = React.HTMLAttributes<HTMLDivElement> & {
539
+ /**sets the background color of the container
540
+ * @default 'transparent'
541
+ */
542
+ bgColor?: 'transparent' | 'var(--gray-100)';
543
+ children: React.ReactNode;
544
+ };
545
+ /**
546
+ * @description a container to layout content in a 2 column grid format = 12ch 1fr
547
+ * @example <RequestTypeContainer bgColor="var(--gray-100)">
548
+ * <label>Name <input type="text" /></label>
549
+ * <label>Name <input type="text" /></label>
550
+ * </div> */
551
+ declare const RequestTypeContainer: ({ bgColor, children, ...props }: RequestTypeContainerProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
552
+
420
553
  declare const SvgCaution: (props: SVGProps<SVGSVGElement>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
421
554
 
422
555
  declare const SvgCheckmark: (props: SVGProps<SVGSVGElement>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
@@ -461,4 +594,4 @@ declare namespace index {
461
594
  };
462
595
  }
463
596
 
464
- export { Brand, DamItem, DamSelectedItem, DamSelectedItemProps, DefaultSearchRow, DefaultSelectedItem, EntrySearch, EntrySearchContentType, EntrySearchProps, EntrySearchQueryOptions, EntrySearchResult, EntrySearchRowProps, EntrySearchSelectedItemProps, GetProductOptions, GetProductsOptions, index as Icons, MeshApp, MeshAppProps, NoResultsProps, ProductCategory, ProductDynamicSelectorValue, ProductPreviewList, ProductQuery, ProductQueryCategory, ProductQueryContext, ProductQueryContextValue, ProductQueryProps, ProductSearch, ProductSearchContext, ProductSearchContextValue, ProductSearchProps, ProductSearchResult, ProductSearchResults, ProductSearchRow, ProductSelectedItem, ResolvableLoadingValue, SelectionField, SelectionFieldValue, UniformMeshLocationContext, UniformMeshLocationContextProvider, UniformMeshLocationContextValue, UniformMeshSdkContext, UniformMeshSdkContextProvider, UniformMeshSdkContextValue, UseUniformMeshSdkOptions, badgeIcon, 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, useInitializeUniformMeshSdk, useMeshLocation, useProductQueryContext, useProductSearchContext, useUniformMeshLocation, useUniformMeshLocationContext, useUniformMeshSdk, useUniformMeshSdkContext };
597
+ export { Brand, ComputedRequestData, DamItem, DamSelectedItem, DamSelectedItemProps, DataVariableDefinitionWithName, DefaultSearchRow, DefaultSelectedItem, 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, RequestProvider, RequestProviderProps, RequestTypeContainer, RequestTypeContainerProps, RequestUrlInput, ResolvableLoadingValue, SelectionField, SelectionFieldValue, UniformMeshLocationContext, UniformMeshLocationContextProvider, UniformMeshLocationContextValue, UniformMeshSdkContext, UniformMeshSdkContextProvider, UniformMeshSdkContextValue, UseUniformMeshSdkOptions, VariableEditor, VariableEditorProps, VariablesAction, VariablesContext, VariablesList, VariablesProvider, VariablesProviderProps, badgeIcon, damSelectItemImage, damSelectedItemContainer, damSelectedItemCopy, damSelectedItemDetails, damSelectedItemIcon, damSelectedItemInfoBtn, damSelectedItemInner, damSelectedItemLinkBtn, damSelectedItemLinkContainer, damSelectedItemMediaContainer, damSelectedItemPopover, damSelectedItemPopoverLabel, damSelectedItemSmallText, damSelectedItemTitle, decomposeRelativeUrl, 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, useInitializeUniformMeshSdk, useMeshLocation, useProductQueryContext, useProductSearchContext, useRequest, useUniformMeshLocation, useUniformMeshLocationContext, useUniformMeshSdk, useUniformMeshSdkContext, useVariables, variablesToList };