@uniformdev/mesh-sdk-react 17.7.1-alpha.34 → 18.0.1-alpha.3
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/LICENSE.txt +1 -1
- package/dist/index.d.ts +29 -29
- package/dist/index.esm.js +3550 -153
- package/dist/index.js +3649 -153
- package/dist/index.mjs +3550 -153
- package/package.json +9 -9
package/LICENSE.txt
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
©
|
|
1
|
+
© 2023 Uniform Systems, Inc. All Rights Reserved.
|
|
2
2
|
See details of Uniform Systems, Inc. Master Subscription Agreement here: https://uniform.dev/eula
|
package/dist/index.d.ts
CHANGED
|
@@ -64,13 +64,13 @@ interface EntrySearchSelectedItemProps<TResult extends EntrySearchResult = Entry
|
|
|
64
64
|
}
|
|
65
65
|
declare const DefaultSelectedItem: React__default.FC<EntrySearchSelectedItemProps>;
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
type EntrySearchQueryOptions = {
|
|
68
68
|
count: number;
|
|
69
69
|
offset: number;
|
|
70
70
|
contentType?: string;
|
|
71
71
|
cursor?: string;
|
|
72
72
|
};
|
|
73
|
-
|
|
73
|
+
type EntrySearchProps<TResult extends EntrySearchResult = EntrySearchResult> = {
|
|
74
74
|
search: (text: string, options: EntrySearchQueryOptions) => void;
|
|
75
75
|
results: TResult[] | undefined;
|
|
76
76
|
totalResults?: number | undefined;
|
|
@@ -164,7 +164,7 @@ declare const draggableIcon: _emotion_react.SerializedStyles;
|
|
|
164
164
|
declare const draggableIconOffset: _emotion_react.SerializedStyles;
|
|
165
165
|
declare const badgeIcon: _emotion_react.SerializedStyles;
|
|
166
166
|
|
|
167
|
-
|
|
167
|
+
type GetProductsOptions = {
|
|
168
168
|
keyword?: string;
|
|
169
169
|
count?: number;
|
|
170
170
|
categories?: string[];
|
|
@@ -174,7 +174,7 @@ declare type GetProductsOptions = {
|
|
|
174
174
|
ids?: string[];
|
|
175
175
|
offset?: number;
|
|
176
176
|
};
|
|
177
|
-
|
|
177
|
+
type ProductSearchResult = EntrySearchResult & {
|
|
178
178
|
price?: number | string;
|
|
179
179
|
sku?: string;
|
|
180
180
|
thumbnailUrl?: string;
|
|
@@ -251,7 +251,7 @@ interface ProductQueryContextValue {
|
|
|
251
251
|
declare const ProductQueryContext: React__default.Context<ProductQueryContextValue | undefined>;
|
|
252
252
|
declare const useProductQueryContext: () => ProductQueryContextValue;
|
|
253
253
|
|
|
254
|
-
|
|
254
|
+
type ProductSearchProps<TResult extends ProductSearchResult = ProductSearchResult> = Pick<EntrySearchProps<TResult>, 'multiSelect' | 'multiSelectId' | 'logoIcon' | 'rowComponent' | 'selectedItemComponent' | 'helpComponent' | 'noResultsComponent' | 'onSort' | 'typeSelectorAllTypesOptionText' | 'typeSelectorLabel'> & {
|
|
255
255
|
selectedProducts: TResult[] | undefined;
|
|
256
256
|
setSelectedProducts: (products: TResult[] | undefined) => Promise<void>;
|
|
257
257
|
onGetCategories: () => Promise<ProductCategory[]>;
|
|
@@ -292,7 +292,7 @@ declare const ResolvableLoadingValue: ({ value, text, loading, }: {
|
|
|
292
292
|
loading: boolean;
|
|
293
293
|
}) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
294
294
|
|
|
295
|
-
|
|
295
|
+
type SelectionFieldValue = {
|
|
296
296
|
id: string;
|
|
297
297
|
name: string;
|
|
298
298
|
};
|
|
@@ -430,18 +430,18 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
|
|
|
430
430
|
type: TLocationType;
|
|
431
431
|
}>)["setValue"]>[0]>;
|
|
432
432
|
};
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
433
|
+
type SetLocationValueDispatch<TValue, TSetValue = TValue> = (dispatch: SetLocationValueFunction<TValue, TSetValue>) => Promise<void> | void;
|
|
434
|
+
type SetLocationValueFunction<TValue, TSetValue> = (previousValue: TValue) => DispatchResult<TSetValue>;
|
|
435
|
+
type DispatchResult<TSetValue> = {
|
|
436
436
|
options?: SetValueOptions;
|
|
437
437
|
newValue: TSetValue;
|
|
438
438
|
};
|
|
439
439
|
|
|
440
|
-
|
|
440
|
+
type InputToken = {
|
|
441
441
|
name: string;
|
|
442
442
|
value: string;
|
|
443
443
|
};
|
|
444
|
-
|
|
444
|
+
type InputVariablesProps = {
|
|
445
445
|
/** sets the input aria-label value. */
|
|
446
446
|
'aria-label'?: string;
|
|
447
447
|
/** sets the value of the input */
|
|
@@ -454,12 +454,12 @@ declare type InputVariablesProps = {
|
|
|
454
454
|
};
|
|
455
455
|
declare function InputVariables({ 'aria-label': ariaLabel, value, disableVariables, onChange, onPaste, }: InputVariablesProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
456
456
|
|
|
457
|
-
|
|
457
|
+
type DataVariableDefinitionWithName = {
|
|
458
458
|
name: string;
|
|
459
459
|
} & DataVariableDefinition;
|
|
460
460
|
declare function variablesToList(variables: Record<string, DataVariableDefinition> | undefined): Array<DataVariableDefinitionWithName>;
|
|
461
461
|
|
|
462
|
-
|
|
462
|
+
type VariableEditorProps = {
|
|
463
463
|
variable: string;
|
|
464
464
|
onSubmit: (values: DataVariableDefinitionWithName) => void | Promise<void>;
|
|
465
465
|
onCancel: () => void;
|
|
@@ -468,12 +468,12 @@ declare function VariableEditor({ variable, onSubmit, onCancel }: VariableEditor
|
|
|
468
468
|
|
|
469
469
|
declare function VariablesList(): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
470
470
|
|
|
471
|
-
|
|
471
|
+
type VariablesProviderProps = React.PropsWithChildren<{
|
|
472
472
|
value: Record<string, DataVariableDefinition>;
|
|
473
473
|
onChange: (newValue: Record<string, DataVariableDefinition>) => void;
|
|
474
474
|
editVariableComponent?: React.ComponentType<VariableEditorProps>;
|
|
475
475
|
}>;
|
|
476
|
-
|
|
476
|
+
type VariablesAction = {
|
|
477
477
|
type: 'edit';
|
|
478
478
|
variable: string;
|
|
479
479
|
} | {
|
|
@@ -487,14 +487,14 @@ declare type VariablesAction = {
|
|
|
487
487
|
type: 'reorder';
|
|
488
488
|
result: Record<string, DataVariableDefinitionWithName>;
|
|
489
489
|
};
|
|
490
|
-
|
|
490
|
+
type VariablesContext = {
|
|
491
491
|
dispatch: (event: VariablesAction) => void;
|
|
492
492
|
variables: Readonly<Record<string, DataVariableDefinition>>;
|
|
493
493
|
};
|
|
494
494
|
declare function VariablesProvider({ value, onChange, editVariableComponent, children, }: VariablesProviderProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
495
495
|
declare function useVariables(): VariablesContext;
|
|
496
496
|
|
|
497
|
-
|
|
497
|
+
type DataResourceVariablesListProps = {
|
|
498
498
|
/**
|
|
499
499
|
* Overrides rendering of a variable based on the `type` property it has set on it.
|
|
500
500
|
* If this is not passed, all variables are rendered using TextVariableRenderer.
|
|
@@ -513,7 +513,7 @@ declare type DataResourceVariablesListProps = {
|
|
|
513
513
|
noVariables?: ComponentType;
|
|
514
514
|
};
|
|
515
515
|
declare function DataResourceVariablesList({ setVariables, noVariables: NoVariablesComponent, typeRenderers, }: DataResourceVariablesListProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
516
|
-
|
|
516
|
+
type DataResourceVariableRendererProps = {
|
|
517
517
|
/** Current value of the variable on the data resource */
|
|
518
518
|
value: string | undefined;
|
|
519
519
|
/** Updates the value of the variable on the data resource */
|
|
@@ -524,7 +524,7 @@ declare type DataResourceVariableRendererProps = {
|
|
|
524
524
|
/** Default data resource variable renderer, uses a text input */
|
|
525
525
|
declare function TextVariableRenderer({ definition, value, setValue }: DataResourceVariableRendererProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
526
526
|
|
|
527
|
-
|
|
527
|
+
type DataSourceEditorProps = PropsWithChildren<{
|
|
528
528
|
/**
|
|
529
529
|
* Callback when the state changes in the request or variables contexts.
|
|
530
530
|
* Can be sent directly to `useMeshLocation`'s `setValue` or intercepted for validation
|
|
@@ -538,7 +538,7 @@ declare type DataSourceEditorProps = PropsWithChildren<{
|
|
|
538
538
|
*/
|
|
539
539
|
declare function DataSourceEditor({ onChange, children }: DataSourceEditorProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
540
540
|
|
|
541
|
-
|
|
541
|
+
type DataTypeEditorProps = PropsWithChildren<{
|
|
542
542
|
/**
|
|
543
543
|
* Callback when the state changes in the request or variables contexts.
|
|
544
544
|
* Can be sent directly to `useMeshLocation`'s `setValue` or intercepted for validation
|
|
@@ -552,7 +552,7 @@ declare type DataTypeEditorProps = PropsWithChildren<{
|
|
|
552
552
|
*/
|
|
553
553
|
declare function DataTypeEditor({ onChange, children }: DataTypeEditorProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
554
554
|
|
|
555
|
-
|
|
555
|
+
type MeshAppProps = {
|
|
556
556
|
loadingComponent?: React__default.ComponentType;
|
|
557
557
|
errorComponent?: React__default.ComponentType<{
|
|
558
558
|
error: Error;
|
|
@@ -566,19 +566,19 @@ declare function RequestHeaders({ disableVariables }: Pick<InputVariablesProps,
|
|
|
566
566
|
|
|
567
567
|
declare function RequestMethodSelect(props: Omit<InputSelectProps, 'value' | 'onChange' | 'options'>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
568
568
|
|
|
569
|
-
|
|
569
|
+
type RequestParametersProps = Pick<InputVariablesProps, 'disableVariables'>;
|
|
570
570
|
declare function RequestParameters({ disableVariables }: Pick<InputVariablesProps, 'disableVariables'>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
571
571
|
|
|
572
|
-
|
|
572
|
+
type RequestParameter = {
|
|
573
573
|
key: string;
|
|
574
574
|
value: string;
|
|
575
575
|
};
|
|
576
|
-
|
|
576
|
+
type BaseRequestData = {
|
|
577
577
|
baseUrl: string;
|
|
578
578
|
headers?: Array<RequestParameter>;
|
|
579
579
|
parameters?: Array<RequestParameter>;
|
|
580
580
|
};
|
|
581
|
-
|
|
581
|
+
type RequestData = {
|
|
582
582
|
relativeUrl: string;
|
|
583
583
|
headers: Array<RequestParameter>;
|
|
584
584
|
parameters: Array<RequestParameter>;
|
|
@@ -586,11 +586,11 @@ declare type RequestData = {
|
|
|
586
586
|
method?: string;
|
|
587
587
|
body?: string;
|
|
588
588
|
};
|
|
589
|
-
|
|
589
|
+
type RequestProviderProps = React.PropsWithChildren<{
|
|
590
590
|
value: RequestData;
|
|
591
591
|
onChange: (delegate: (oldValue: RequestData) => RequestData) => void;
|
|
592
592
|
}>;
|
|
593
|
-
|
|
593
|
+
type RequestAction = {
|
|
594
594
|
type: 'setRelativeUrl';
|
|
595
595
|
relativeUrl: string;
|
|
596
596
|
} | {
|
|
@@ -615,14 +615,14 @@ declare type RequestAction = {
|
|
|
615
615
|
body: string;
|
|
616
616
|
contentType: string;
|
|
617
617
|
};
|
|
618
|
-
|
|
618
|
+
type RequestContext = {
|
|
619
619
|
dispatch: (event: RequestAction) => void;
|
|
620
620
|
request: Readonly<RequestData>;
|
|
621
621
|
};
|
|
622
622
|
declare function RequestProvider({ value, onChange, children }: RequestProviderProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
623
623
|
declare function useRequest(): RequestContext;
|
|
624
624
|
|
|
625
|
-
|
|
625
|
+
type RequestTypeContainerProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
626
626
|
/**sets the background color of the container
|
|
627
627
|
* @default 'transparent'
|
|
628
628
|
*/
|