@uniformdev/mesh-sdk-react 19.35.2 → 19.36.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.
Files changed (2) hide show
  1. package/dist/index.d.mts +1163 -0
  2. package/package.json +4 -4
@@ -0,0 +1,1163 @@
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, PropsWithChildren, ComponentType, HTMLAttributes, ReactNode, AnchorHTMLAttributes } from 'react';
4
+ import { TDate } from 'timeago.js';
5
+ import * as _emotion_react from '@emotion/react';
6
+ import * as _uniformdev_mesh_sdk from '@uniformdev/mesh-sdk';
7
+ import { DynamicInput, MeshLocation, SetValueOptions, DynamicInputs, DataSourceLocationValue, DataTypeLocationValue } from '@uniformdev/mesh-sdk';
8
+ export * from '@uniformdev/mesh-sdk';
9
+ import { DataVariableDefinition, DataResourceVariables, DataType } from '@uniformdev/canvas';
10
+ import { Emitter } from 'mitt';
11
+ import { BadgeThemeProps, InputSelectProps } from '@uniformdev/design-system';
12
+ export { AddListButton, AddListButtonProps, Button, ButtonProps, Callout, CalloutProps, DrawerContent, Heading, HeadingProps, Input, InputComboBox, InputComboBoxProps, InputKeywordSearch, InputProps, InputSelect, InputToggle, InputToggleProps, Label, LabelProps, LoadingIndicator, LoadingOverlay, Menu, MenuItem, MenuItemProps, MenuProps, ParameterGroup, ParameterGroupProps, ParameterImage, ParameterImageInner, ParameterImageProps, ParameterInput, ParameterInputInner, ParameterInputProps, ParameterLabel, ParameterLabelProps, ParameterMenuButton, ParameterMenuButtonProps, ParameterSelect, ParameterSelectInner, ParameterSelectProps, ParameterShell, ParameterShellContext, ParameterShellProps, ParameterTextarea, ParameterTextareaInner, ParameterTextareaProps, ParameterToggle, ParameterToggleInner, ParameterToggleProps, ScrollableList, ScrollableListItem, ScrollableListItemProps, ScrollableListProps, Switch, SwitchProps, Textarea, TextareaProps, Theme, ThemeProps, useParameterShell } from '@uniformdev/design-system';
13
+
14
+ declare const SvgCaution: (props: SVGProps<SVGSVGElement>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
15
+
16
+ declare const SvgCheckmark: (props: SVGProps<SVGSVGElement>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
17
+
18
+ declare const SvgChevronDown: (props: SVGProps<SVGSVGElement>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
19
+
20
+ declare const SvgClose: (props: SVGProps<SVGSVGElement>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
21
+
22
+ declare const SvgDanger: (props: SVGProps<SVGSVGElement>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
23
+
24
+ declare const SvgExclamationPoint: (props: SVGProps<SVGSVGElement>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
25
+
26
+ declare const SvgInfo: (props: SVGProps<SVGSVGElement>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
27
+
28
+ declare const SvgLightbulb: (props: SVGProps<SVGSVGElement>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
29
+
30
+ declare const SvgMagnifyingGlass: (props: SVGProps<SVGSVGElement>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
31
+
32
+ declare const SvgMaximizeAlt: (props: SVGProps<SVGSVGElement>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
33
+
34
+ declare const SvgMinus: (props: SVGProps<SVGSVGElement>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
35
+
36
+ declare const SvgMoreVerticalAlt: (props: SVGProps<SVGSVGElement>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
37
+
38
+ declare const SvgPlus: (props: SVGProps<SVGSVGElement>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
39
+
40
+ declare namespace index {
41
+ export {
42
+ SvgCaution as Caution,
43
+ SvgCheckmark as Checkmark,
44
+ SvgChevronDown as ChevronDown,
45
+ SvgClose as Close,
46
+ SvgDanger as Danger,
47
+ SvgExclamationPoint as ExclamationPoint,
48
+ SvgInfo as Info,
49
+ SvgLightbulb as Lightbulb,
50
+ SvgMagnifyingGlass as MagnifyingGlass,
51
+ SvgMaximizeAlt as MaximizeAlt,
52
+ SvgMinus as Minus,
53
+ SvgMoreVerticalAlt as MoreVerticalAlt,
54
+ SvgPlus as Plus,
55
+ };
56
+ }
57
+
58
+ interface EntrySearchSelectedItemProps<TResult extends EntrySearchResult = EntrySearchResult> {
59
+ selectedItem: TResult;
60
+ logoIcon: string | React__default.ComponentType<{
61
+ className?: string;
62
+ }>;
63
+ onDeselect: (item: TResult) => void;
64
+ onEditClosed?: (item: TResult) => void;
65
+ }
66
+ declare const DefaultSelectedItem: React__default.FC<EntrySearchSelectedItemProps>;
67
+
68
+ type EntrySearchQueryOptions = {
69
+ count: number;
70
+ offset: number;
71
+ contentType?: string;
72
+ cursor?: string;
73
+ };
74
+ type EntrySearchProps<TResult extends EntrySearchResult = EntrySearchResult> = {
75
+ search: (text: string, options: EntrySearchQueryOptions) => void;
76
+ results: TResult[] | undefined;
77
+ totalResults?: number | undefined;
78
+ cursor?: string;
79
+ contentTypes?: EntrySearchContentType[];
80
+ selectedItems: TResult[] | undefined;
81
+ logoIcon: string | React$1.ComponentType<{
82
+ className?: string;
83
+ }>;
84
+ select: (items: TResult[], selectedContentType?: string) => void;
85
+ requireContentType?: boolean;
86
+ multiSelectId?: string;
87
+ multiSelect?: boolean;
88
+ rowComponent?: React$1.FC<EntrySearchRowProps<TResult>>;
89
+ selectedItemComponent?: React$1.FC<EntrySearchSelectedItemProps<TResult>>;
90
+ onAddNew?: (type: EntrySearchContentType) => void;
91
+ onEditClosed?: (item: EntrySearchResult) => void;
92
+ onCancel?: () => void;
93
+ resultsLoading?: boolean;
94
+ noResultsComponent?: React$1.FC<{
95
+ searchText?: string;
96
+ selectedContentType?: string;
97
+ }>;
98
+ helpComponent?: JSX.Element;
99
+ onSort?: (items: TResult[]) => void;
100
+ typeSelectorLabel?: string;
101
+ typeSelectorAllTypesOptionText?: string;
102
+ /** Specifies how long (in milliseconds) to wait before showing the loading indicator when `resultsLoading` is true.
103
+ * @default 1000
104
+ */
105
+ loadingIndicatorDelay?: number;
106
+ };
107
+ interface EntrySearchResult {
108
+ id: string;
109
+ title: string | JSX.Element;
110
+ createdDate?: TDate;
111
+ editLink?: string;
112
+ metadata?: Record<string, string | JSX.Element>;
113
+ popoverData?: Record<string, string | JSX.Element>;
114
+ }
115
+ interface EntrySearchContentType {
116
+ id: string;
117
+ name: string;
118
+ }
119
+ interface NoResultsProps {
120
+ searchText: string | undefined;
121
+ selectedContentType: string | undefined;
122
+ }
123
+ declare const EntrySearch: <TResult extends EntrySearchResult>({ search, results, contentTypes, selectedItems, logoIcon, select, multiSelect, multiSelectId, rowComponent, selectedItemComponent, totalResults, cursor, resultsLoading, requireContentType, onAddNew, onEditClosed, onCancel, noResultsComponent, helpComponent, onSort, typeSelectorLabel, typeSelectorAllTypesOptionText, loadingIndicatorDelay, }: EntrySearchProps<TResult>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
124
+
125
+ interface EntrySearchRowProps<TResult extends EntrySearchResult = EntrySearchResult> {
126
+ result: TResult;
127
+ isSelected: boolean;
128
+ triggerSelection: () => void;
129
+ }
130
+ declare const DefaultSearchRow: React__default.FC<EntrySearchRowProps>;
131
+
132
+ declare const searchRowContainer: _emotion_react.SerializedStyles;
133
+ declare const searchRowContainerWithPopover: _emotion_react.SerializedStyles;
134
+ declare const searchRowContainerActive: _emotion_react.SerializedStyles;
135
+ declare const searchRowTextSmall: _emotion_react.SerializedStyles;
136
+ declare const searchRowText: _emotion_react.SerializedStyles;
137
+ declare const searchRowPopover: _emotion_react.SerializedStyles;
138
+ declare const searchRowBtn: _emotion_react.SerializedStyles;
139
+
140
+ declare const selectedItemContainer: _emotion_react.SerializedStyles;
141
+ declare const selectedItemInner: _emotion_react.SerializedStyles;
142
+ declare const selectedItemDetails: _emotion_react.SerializedStyles;
143
+ declare const selectedItemCopy: _emotion_react.SerializedStyles;
144
+ declare const selectedItemTitle: _emotion_react.SerializedStyles;
145
+ declare const selectedItemIcon: _emotion_react.SerializedStyles;
146
+ declare const selectItemPopover: _emotion_react.SerializedStyles;
147
+ declare const selectItemSmallText: _emotion_react.SerializedStyles;
148
+ declare const selectItemPopoverLabel: _emotion_react.SerializedStyles;
149
+ declare const selectItemLinkContainer: _emotion_react.SerializedStyles;
150
+ declare const selectItemLinkBtn: _emotion_react.SerializedStyles;
151
+
152
+ declare const entrySearchWrapper: _emotion_react.SerializedStyles;
153
+ declare const entrySearchBtn: _emotion_react.SerializedStyles;
154
+ declare const entrySearchLoadMoreBtn: _emotion_react.SerializedStyles;
155
+ declare const entrySearchConfig: _emotion_react.SerializedStyles;
156
+ declare const entrySearchConfigHidden: _emotion_react.SerializedStyles;
157
+ declare const entrySearchResultList: _emotion_react.SerializedStyles;
158
+ declare const entrySearchSelectInput: _emotion_react.SerializedStyles;
159
+ declare const entrySearchSelectIcon: _emotion_react.SerializedStyles;
160
+ declare const entrySearchSelectImg: _emotion_react.SerializedStyles;
161
+ declare const entrySearchSelectOption: _emotion_react.SerializedStyles;
162
+ declare const draggableContainer: _emotion_react.SerializedStyles;
163
+ declare const draggableIconWrapper: _emotion_react.SerializedStyles;
164
+ declare const draggableIcon: _emotion_react.SerializedStyles;
165
+ declare const draggableIconOffset: _emotion_react.SerializedStyles;
166
+ declare const badgeIcon: _emotion_react.SerializedStyles;
167
+
168
+ type GetProductsOptions = {
169
+ keyword?: string;
170
+ count?: number;
171
+ categories?: string[];
172
+ brand?: string;
173
+ sort?: string;
174
+ sortOrder?: string;
175
+ ids?: string[];
176
+ offset?: number;
177
+ };
178
+ type ProductSearchResult = EntrySearchResult & {
179
+ price?: number | string;
180
+ sku?: string;
181
+ thumbnailUrl?: string;
182
+ categories?: Array<{
183
+ id: string;
184
+ name: string;
185
+ }>;
186
+ };
187
+ interface ProductSearchResults {
188
+ total: number;
189
+ products: ProductSearchResult[];
190
+ }
191
+ interface ProductCategory {
192
+ id: string;
193
+ name: string;
194
+ children?: ProductCategory[];
195
+ }
196
+
197
+ declare const ProductPreviewList: ({ products, }: {
198
+ products: ProductSearchResults['products'] | undefined;
199
+ }) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
200
+
201
+ interface ProductDynamicSelectorValue {
202
+ count: number;
203
+ categories?: string[];
204
+ brand?: string;
205
+ keyword?: string;
206
+ sort?: string;
207
+ sortOrder?: string;
208
+ }
209
+ interface ProductQueryProps<TValue extends ProductDynamicSelectorValue = ProductDynamicSelectorValue> {
210
+ value: TValue | undefined;
211
+ setValue: (value: TValue) => Promise<void>;
212
+ brands: Brand[] | undefined;
213
+ categories: ProductQueryCategory[] | undefined;
214
+ loading?: boolean;
215
+ categoriesLoading?: boolean;
216
+ brandsLoading?: boolean;
217
+ logoIcon?: string | React__default.ComponentType<{
218
+ className?: string;
219
+ }>;
220
+ onGetProducts: (options?: GetProductsOptions) => Promise<ProductSearchResults>;
221
+ sortOptions?: Array<{
222
+ name: string;
223
+ sortKey: string;
224
+ }>;
225
+ sortOrderOptions?: Array<{
226
+ name: string;
227
+ sortOrderKey: string;
228
+ }>;
229
+ categoryLabel?: string;
230
+ brandLabel?: string;
231
+ disableBrands?: boolean;
232
+ restrictToSingleCategory?: boolean;
233
+ }
234
+ interface ProductQueryCategory {
235
+ id: string;
236
+ name: string;
237
+ children?: ProductQueryCategory[];
238
+ }
239
+ interface Brand {
240
+ id: string;
241
+ name: string;
242
+ }
243
+ declare const ProductQuery: ({ value, setValue, brands, categories, loading, categoriesLoading, brandsLoading, logoIcon, onGetProducts, sortOptions, sortOrderOptions, categoryLabel, brandLabel, disableBrands, restrictToSingleCategory, }: ProductQueryProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
244
+ interface ProductQueryContextValue {
245
+ categories: ProductQueryProps['categories'];
246
+ logoIcon: ProductQueryProps['logoIcon'];
247
+ }
248
+ declare const ProductQueryContext: React__default.Context<ProductQueryContextValue | undefined>;
249
+ declare const useProductQueryContext: () => ProductQueryContextValue;
250
+
251
+ type ProductSearchProps<TResult extends ProductSearchResult = ProductSearchResult> = Pick<EntrySearchProps<TResult>, 'multiSelect' | 'multiSelectId' | 'logoIcon' | 'rowComponent' | 'selectedItemComponent' | 'helpComponent' | 'noResultsComponent' | 'onSort' | 'typeSelectorAllTypesOptionText' | 'typeSelectorLabel'> & {
252
+ selectedProducts: TResult[] | undefined;
253
+ setSelectedProducts: (products: TResult[] | undefined) => Promise<void>;
254
+ onGetCategories: () => Promise<ProductCategory[]>;
255
+ onSearchProducts: (args: {
256
+ text: string;
257
+ options?: GetProductOptions;
258
+ }) => Promise<{
259
+ total: number;
260
+ products: TResult[];
261
+ cursor?: string;
262
+ }>;
263
+ errorComponent?: React__default.ComponentType<{
264
+ categoriesError?: Error;
265
+ searchError?: Error;
266
+ }>;
267
+ };
268
+ interface GetProductOptions {
269
+ limit?: number;
270
+ offset?: number;
271
+ categoryId?: string;
272
+ cursor?: string;
273
+ }
274
+ declare function ProductSearch({ selectedProducts, setSelectedProducts, onGetCategories, onSearchProducts, logoIcon, multiSelect, multiSelectId, selectedItemComponent, rowComponent, errorComponent, helpComponent, noResultsComponent, onSort, typeSelectorAllTypesOptionText, typeSelectorLabel, }: ProductSearchProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
275
+ interface ProductSearchContextValue {
276
+ logoIcon: ProductSearchProps['logoIcon'];
277
+ categories: ProductCategory[] | undefined;
278
+ }
279
+ declare const ProductSearchContext: React__default.Context<ProductSearchContextValue | undefined>;
280
+ declare const useProductSearchContext: () => ProductSearchContextValue;
281
+
282
+ declare function ProductSearchRow({ result, isSelected, triggerSelection, }: EntrySearchRowProps<ProductSearchResult>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
283
+
284
+ declare function ProductSelectedItem({ selectedItem, onDeselect, }: EntrySearchSelectedItemProps<ProductSearchResult>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
285
+
286
+ declare const ResolvableLoadingValue: ({ value, text, loading, }: {
287
+ value: string;
288
+ text: string | undefined;
289
+ loading: boolean;
290
+ }) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
291
+
292
+ type SelectionFieldValue = {
293
+ id: string;
294
+ name: string;
295
+ };
296
+ declare const SelectionField: ({ id, label, loading, selectedValues, values, onAdd, onRemove, }: {
297
+ id: string;
298
+ label: string;
299
+ loading: boolean;
300
+ selectedValues: string[] | undefined;
301
+ values: SelectionFieldValue[];
302
+ onAdd: (id: string) => void;
303
+ onRemove: (id: string) => void;
304
+ }) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
305
+
306
+ declare const productSearchRowContainer: _emotion_react.SerializedStyles;
307
+ declare const productSearchRowContent: _emotion_react.SerializedStyles;
308
+ declare const productSearchRowContentActive: _emotion_react.SerializedStyles;
309
+ declare const productSearchRowTitle: _emotion_react.SerializedStyles;
310
+ declare const productSearchRowCategory: _emotion_react.SerializedStyles;
311
+ declare const productSearchRowDetails: _emotion_react.SerializedStyles;
312
+ declare const productSearchRowActiveIcon: _emotion_react.SerializedStyles;
313
+
314
+ declare const productSelectedItemContainer: _emotion_react.SerializedStyles;
315
+ declare const productSelectedItemDetails: _emotion_react.SerializedStyles;
316
+ declare const productSelectedItemContent: _emotion_react.SerializedStyles;
317
+ declare const productSelectedItemImage: _emotion_react.SerializedStyles;
318
+ declare const productedSelectedItemLinkBtn: _emotion_react.SerializedStyles;
319
+ declare const productedSelectedItemSmallText: _emotion_react.SerializedStyles;
320
+ declare const productSelectedItemIcon: _emotion_react.SerializedStyles;
321
+ declare const productSelectedItemLinkContainer: _emotion_react.SerializedStyles;
322
+
323
+ interface DamItem {
324
+ id: string;
325
+ title: string | JSX.Element;
326
+ createdDate?: Date | string | number;
327
+ editLink?: string | JSX.Element;
328
+ metadata?: Record<string, string | JSX.Element>;
329
+ popoverData?: Record<string, string | JSX.Element>;
330
+ previewUrl?: string | JSX.Element;
331
+ type: 'image' | 'video' | 'file' | 'other';
332
+ }
333
+
334
+ interface DamSelectedItemProps<TResult extends DamItem = DamItem> {
335
+ /** The item used for rendering this component. */
336
+ selectedItem: TResult;
337
+ /** Logo icon is used for the `editLink` if `editLink` is a string value, otherwise the icon is not used. */
338
+ logoIcon?: string | React__default.ComponentType<{
339
+ className?: string;
340
+ }>;
341
+ /** Callback that is invoked when the "Unlink" (deselect) button is clicked. */
342
+ onDeselect: (item: TResult) => void;
343
+ /** If `editLink` is a string value, an `<a>` element will be rendered for the `editLink` and
344
+ * the `onEditClosed` callback will be invoked when the tab opened by clicking the `<a>` element is closed. */
345
+ onEditClosed?: (item: TResult) => void;
346
+ /** Allows for customizing how item details, e.g. item preview, item metadata, are rendered. If not defined,
347
+ * item details will be rendered using the default (built-in) renderer.
348
+ */
349
+ itemDetailsRendererComponent?: React__default.ComponentType<{
350
+ item: TResult;
351
+ }>;
352
+ }
353
+ declare function DamSelectedItem({ selectedItem, onDeselect, onEditClosed, logoIcon, itemDetailsRendererComponent, }: DamSelectedItemProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
354
+
355
+ declare const damSelectedItemContainer: _emotion_react.SerializedStyles;
356
+ declare const damSelectedItemInner: _emotion_react.SerializedStyles;
357
+ declare const damSelectedItemDetails: _emotion_react.SerializedStyles;
358
+ declare const damSelectedItemCopy: _emotion_react.SerializedStyles;
359
+ declare const damSelectedItemTitle: _emotion_react.SerializedStyles;
360
+ declare const damSelectedItemIcon: _emotion_react.SerializedStyles;
361
+ declare const damSelectedItemPopover: _emotion_react.SerializedStyles;
362
+ declare const damSelectedItemSmallText: _emotion_react.SerializedStyles;
363
+ declare const damSelectedItemPopoverLabel: _emotion_react.SerializedStyles;
364
+ declare const damSelectedItemLinkContainer: _emotion_react.SerializedStyles;
365
+ declare const damSelectedItemLinkBtn: _emotion_react.SerializedStyles;
366
+ declare const damSelectedItemMediaContainer: _emotion_react.SerializedStyles;
367
+ declare const damSelectedItemInfoBtn: _emotion_react.SerializedStyles;
368
+ declare const damSelectItemImage: _emotion_react.SerializedStyles;
369
+
370
+ type MinimalDynamicInput = Omit<DynamicInput, 'source'>;
371
+ type MinimalDynamicInputs = Record<string, MinimalDynamicInput>;
372
+ type DataResourceDynamicInputProviderProps = PropsWithChildren<{
373
+ /** Explicitly provide dynamic input values. If not set, Mesh location will be used */
374
+ dynamicInputs?: MinimalDynamicInputs;
375
+ }>;
376
+ /**
377
+ * Wrapper for data resource locations. Provides read-only access to dynamic inputs as if they were variables,
378
+ * using variables-aware components (i.e. InputVariables). This simplifies building dynamic-input-aware editors,
379
+ * where a data resource variable could be a static value or bound to a dynamic input from the route (project map).
380
+ */
381
+ declare function DataResourceDynamicInputProvider({ children, dynamicInputs, }: DataResourceDynamicInputProviderProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
382
+
383
+ /**
384
+ * Provides convenient access to the current Uniform Mesh location via React hook.
385
+ * Intended to be used within <MeshApp />.
386
+ *
387
+ * There are three primary ways to invoke this hook:
388
+ * 1. Without any arguments, this hook will return the current location regardless of its type. The result will be a union of all possible locations you can discriminate between i.e. with an if statement on the `type`
389
+ * const location = useMeshLocation();
390
+ * if (location.type === 'paramType') { // location is now known to be a paramType }
391
+ * 2. With a string argument, this hook will assert that the current location is the expected one and return the correct typings for that location.
392
+ * const location = useMeshLocation('settings');
393
+ * 3. With an explicit generic to set the expected param type data or param type settings data. This is useful because (2) will return unknown as the value type for param types.
394
+ * const location = useMeshLocation<'paramType', MyParamTypeValueType>();
395
+ *
396
+ * You can also combine (2) and (3) to get both explicit value typing and assertion of the location.
397
+ */
398
+ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLocationValue = unknown, TLocationSetValue = TLocationValue>(expectedLocation?: TLocationType): Omit<Extract<_uniformdev_mesh_sdk.DataSourceLocation, {
399
+ type: TLocationType;
400
+ }> | Extract<_uniformdev_mesh_sdk.DataTypeLocation, {
401
+ type: TLocationType;
402
+ }> | Extract<_uniformdev_mesh_sdk.DataResourceLocation, {
403
+ type: TLocationType;
404
+ }> | Extract<_uniformdev_mesh_sdk.ParamTypeLocation<TLocationValue, unknown, TLocationSetValue, unknown>, {
405
+ type: TLocationType;
406
+ }> | Extract<_uniformdev_mesh_sdk.ParamTypeConfigLocation<TLocationValue, unknown>, {
407
+ type: TLocationType;
408
+ }> | Extract<_uniformdev_mesh_sdk.SettingsLocation<TLocationValue>, {
409
+ type: TLocationType;
410
+ }>, "setValue"> & {
411
+ setValue: SetLocationValueDispatch<(Extract<_uniformdev_mesh_sdk.DataSourceLocation, {
412
+ type: TLocationType;
413
+ }> | Extract<_uniformdev_mesh_sdk.DataTypeLocation, {
414
+ type: TLocationType;
415
+ }> | Extract<_uniformdev_mesh_sdk.DataResourceLocation, {
416
+ type: TLocationType;
417
+ }> | Extract<_uniformdev_mesh_sdk.ParamTypeLocation<TLocationValue, unknown, TLocationSetValue, unknown>, {
418
+ type: TLocationType;
419
+ }> | Extract<_uniformdev_mesh_sdk.ParamTypeConfigLocation<TLocationValue, unknown>, {
420
+ type: TLocationType;
421
+ }> | Extract<_uniformdev_mesh_sdk.SettingsLocation<TLocationValue>, {
422
+ type: TLocationType;
423
+ }>)["value"], Parameters<(Extract<_uniformdev_mesh_sdk.DataSourceLocation, {
424
+ type: TLocationType;
425
+ }> | Extract<_uniformdev_mesh_sdk.DataTypeLocation, {
426
+ type: TLocationType;
427
+ }> | Extract<_uniformdev_mesh_sdk.DataResourceLocation, {
428
+ type: TLocationType;
429
+ }> | Extract<_uniformdev_mesh_sdk.ParamTypeLocation<TLocationValue, unknown, TLocationSetValue, unknown>, {
430
+ type: TLocationType;
431
+ }> | Extract<_uniformdev_mesh_sdk.ParamTypeConfigLocation<TLocationValue, unknown>, {
432
+ type: TLocationType;
433
+ }> | Extract<_uniformdev_mesh_sdk.SettingsLocation<TLocationValue>, {
434
+ type: TLocationType;
435
+ }>)["setValue"]>[0]>;
436
+ };
437
+ type SetLocationValueDispatch<TValue, TSetValue = TValue> = (dispatch: SetLocationValueFunction<TValue, TSetValue>) => Promise<void> | void;
438
+ type SetLocationValueFunction<TValue, TSetValue> = (previousValue: TValue) => DispatchResult<TSetValue>;
439
+ type DispatchResult<TSetValue> = {
440
+ options?: SetValueOptions;
441
+ newValue: TSetValue;
442
+ };
443
+
444
+ type PasteTransformerPluginProps = {
445
+ /**
446
+ * Transforms pasted contents before inserting them.
447
+ * Return undefined to execute default paste behaviour, or a string to set the paste's contents.
448
+ */
449
+ transformPaste?: (pastedText: string) => string | undefined;
450
+ };
451
+
452
+ type InputToken = {
453
+ name: string;
454
+ value: string;
455
+ };
456
+ type InputVariablesProps = {
457
+ /** Sets a HTML ID for the variables input and label */
458
+ id?: string;
459
+ /** Enables a label for the input */
460
+ label?: string;
461
+ /** sets the input aria-label value. */
462
+ 'aria-label'?: string;
463
+ /** sets the value of the input */
464
+ value: string;
465
+ /** sets the passed down function call */
466
+ onChange: (newValue: string) => void;
467
+ /** Disables using variables in the input */
468
+ disableVariables?: boolean;
469
+ /**
470
+ * Turns off the 'Reset' menu option that is added when:
471
+ * - inputWhenNoVariables is passed in
472
+ * - variables are, or have have been bound to
473
+ *
474
+ * The reset button returns the editor to the inputWithNoVariables state
475
+ *
476
+ * @deprecated not usually necessary to set this, it's automatic
477
+ */
478
+ disableReset?: boolean;
479
+ /** Enables adding variables from the menu */
480
+ showAddVariableMenuOption?: boolean;
481
+ /** Disables the inline variable selection menu when rendering a variables input */
482
+ disableInlineMenu?: boolean;
483
+ /** Enables clicking a variable reference to edit the variable */
484
+ enableEditingVariables?: boolean;
485
+ /**
486
+ * When no variables are referenced in the value, and this prop is provided,
487
+ * the variables-injection input will be replaced with this component.
488
+ */
489
+ inputWhenNoVariables?: JSX.Element;
490
+ /** (optional) sets and shows the the error message value */
491
+ errorMessage?: string;
492
+ /** (optional) sets and shows the the warning message value */
493
+ warningMessage?: string;
494
+ /** (optional) sets and shows the the info message value */
495
+ infoMessage?: string;
496
+ /** (optional) sets caption text value */
497
+ caption?: string;
498
+ /** Sets the test ID of the input */
499
+ 'data-test-id'?: string;
500
+ } & PasteTransformerPluginProps;
501
+ declare function InputVariables({ id, 'aria-label': ariaLabel, label, value, disableVariables, disableReset, enableEditingVariables, disableInlineMenu, onChange, transformPaste, showAddVariableMenuOption, inputWhenNoVariables, caption, errorMessage, warningMessage, infoMessage, 'data-test-id': dataTestId, }: InputVariablesProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
502
+
503
+ /** Expected prefix for variable expressions */
504
+ declare const variablePrefix = "${";
505
+ /** Expected suffix for variable expressions */
506
+ declare const variableSuffix = "}";
507
+
508
+ type DataVariableDefinitionWithName = {
509
+ name: string;
510
+ } & DataVariableDefinition;
511
+ /**
512
+ * Converts variable definitions stored in a map into a flat list,
513
+ * respecting their `order` property if set, and sorting by display name otherwise.
514
+ */
515
+ declare function variablesToList(variables: Record<string, DataVariableDefinition> | undefined): Array<DataVariableDefinitionWithName>;
516
+
517
+ type VariableEditorProps = {
518
+ variable: string;
519
+ onSubmit: (values: DataVariableDefinitionWithName) => void | Promise<void>;
520
+ /** Disables the tip about Mesh integrations. Intended for use when this is placed on a custom Mesh integration to edit variables. */
521
+ disableMeshTip?: boolean;
522
+ onCancel: () => void;
523
+ };
524
+ declare function VariableEditor({ variable, onSubmit, onCancel, disableMeshTip }: VariableEditorProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
525
+
526
+ declare function VariablesList(): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
527
+
528
+ type VariablesProviderProps = React$1.PropsWithChildren<{
529
+ /**
530
+ * Signals that components in this variables context are not intended to allow mutation
531
+ * of the variable values (i.e. editing, adding, or deleting variable definitions).
532
+ *
533
+ * Dispatching updates is still accepted, but will be ignored.
534
+ */
535
+ readOnly?: boolean;
536
+ /** Variable values to load into the context */
537
+ value: Record<string, DataVariableDefinition>;
538
+ /** Function to handle mutations to the variable values (optional when readOnly is true) */
539
+ onChange?: (newValue: Record<string, DataVariableDefinition>) => void;
540
+ /**
541
+ * Provide a component to handle editing a variable definition (e.g. a modal wrapper)
542
+ * If not passed, the editor will be rendered inline, with potentially strange results.
543
+ */
544
+ editVariableComponent?: React$1.ComponentType<VariableEditorProps>;
545
+ }>;
546
+ type VariablesAction = {
547
+ type: 'edit';
548
+ variable: string;
549
+ } | {
550
+ type: 'remove';
551
+ variable: string;
552
+ } | {
553
+ type: 'set';
554
+ variable: DataVariableDefinitionWithName;
555
+ openEditor?: boolean;
556
+ } | {
557
+ type: 'reorder';
558
+ result: Record<string, DataVariableDefinitionWithName>;
559
+ };
560
+ type VariablesEvents = {
561
+ update: string;
562
+ };
563
+ type VariablesContext = {
564
+ /**
565
+ * Signals that components in this variables context are not intended to allow mutation
566
+ * of the variable values (i.e. editing, adding, or deleting variable definitions).
567
+ *
568
+ * Dispatching updates is still accepted, but will be ignored.
569
+ */
570
+ readOnly?: boolean;
571
+ /** Dispatch update events to the variables */
572
+ dispatch: (event: VariablesAction) => void;
573
+ /** The current variables value */
574
+ variables: Readonly<Record<string, DataVariableDefinition>>;
575
+ /** Whether the context is editing a variable value currently */
576
+ isEditing: boolean;
577
+ /** Add event handles (don't forget to unhook) */
578
+ events: Emitter<VariablesEvents>;
579
+ /** Whether the context is backed by a provider, or is just a readonly fake */
580
+ canDispatch: boolean;
581
+ /**
582
+ * A flattened version of `variables` that is a plain key-value object.
583
+ * Used when binding the variables to a value.
584
+ */
585
+ flatVariables: Readonly<Record<string, string>>;
586
+ };
587
+ declare function VariablesProvider({ value, onChange, editVariableComponent, readOnly, children, }: VariablesProviderProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
588
+ declare function useVariables(returnEmptyWithoutProvider?: boolean): VariablesContext;
589
+
590
+ type DataResourceVariablesListProps = {
591
+ /**
592
+ * Overrides rendering of a variable based on the `type` property it has set on it.
593
+ * If this is not passed, all variables are rendered using TextVariableRenderer.
594
+ */
595
+ typeRenderers?: Record<string, ComponentType<DataResourceVariableRendererProps> | undefined>;
596
+ /**
597
+ * Callback when the state changes in the data resource variables.
598
+ * Can be sent directly to `useMeshLocation`'s `setValue` or intercepted for validation
599
+ * by `createLocationValidator`.
600
+ */
601
+ setVariables: SetLocationValueDispatch<DataResourceVariables>;
602
+ /**
603
+ * Component that is rendered if no variables are set on the data resource.
604
+ * Defaults to a callout stating that no settings are required.
605
+ */
606
+ noVariables?: ComponentType;
607
+ };
608
+ /**
609
+ * Renders a list of Data Type-provided variables that can be set on a Data Resource.
610
+ * Intended to provide a solid base for data resource editors that need to edit a list of variables.
611
+ * Using the optional `type` attribute of variables, one can use custom components to render different
612
+ * variables using this component, enabling flexibility for more than just text inputs.
613
+ */
614
+ declare function DataResourceVariablesList(props: DataResourceVariablesListProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
615
+ /**
616
+ * Renders a list of Data Type-provided variables that can be set on a Data Resource.
617
+ *
618
+ * This is a version of DataResourceVariablesList that does not use any Mesh context data.
619
+ * For most uses you will want to use DataResourceVariablesList instead.
620
+ */
621
+ declare function DataResourceVariablesListExplicit({ setVariables, noVariables: NoVariablesComponent, typeRenderers, dataType, dynamicInputs, value, }: DataResourceVariablesListProps & {
622
+ value: DataResourceVariables;
623
+ dataType: DataType;
624
+ dynamicInputs: DynamicInputs;
625
+ }): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
626
+ type DataResourceVariableRendererProps = {
627
+ /** Current value of the variable on the data resource */
628
+ value: string | undefined;
629
+ /** Updates the value of the variable on the data resource */
630
+ setValue: (newValue: string | undefined) => void;
631
+ /** The definition of the data variable */
632
+ definition: DataVariableDefinitionWithName;
633
+ };
634
+ /** Default data resource variable renderer, uses a text input that supports dynamic input binding */
635
+ declare function TextVariableRenderer({ definition, value, setValue }: DataResourceVariableRendererProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
636
+
637
+ type DataSourceEditorProps = PropsWithChildren<{
638
+ /**
639
+ * Callback when the state changes in the request or variables contexts.
640
+ * Can be sent directly to `useMeshLocation`'s `setValue` or intercepted for validation
641
+ * by `createLocationValidator`.
642
+ */
643
+ onChange: SetLocationValueDispatch<DataSourceLocationValue>;
644
+ } & Pick<VariablesProviderProps, 'editVariableComponent'>>;
645
+ /**
646
+ * Wrapper for editing a data source using Uniform Mesh SDK components that rely on `useRequest()`
647
+ * or `useVariables()`, or custom components that use the same hooks.
648
+ */
649
+ declare function DataSourceEditor({ onChange, children, editVariableComponent }: DataSourceEditorProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
650
+
651
+ type DataTypeEditorProps = PropsWithChildren<{
652
+ /**
653
+ * Callback when the state changes in the request or variables contexts.
654
+ * Can be sent directly to `useMeshLocation`'s `setValue` or intercepted for validation
655
+ * by `createLocationValidator`.
656
+ */
657
+ onChange: SetLocationValueDispatch<DataTypeLocationValue>;
658
+ } & Pick<VariablesProviderProps, 'editVariableComponent'>>;
659
+ /**
660
+ * Wrapper for editing a data type using Uniform Mesh SDK components that rely on `useRequest()`
661
+ * or `useVariables()`, or custom components that use the same hooks.
662
+ */
663
+ declare function DataTypeEditor({ onChange, children, editVariableComponent }: DataTypeEditorProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
664
+
665
+ type MeshAppProps = {
666
+ loadingComponent?: React__default.ComponentType;
667
+ errorComponent?: React__default.ComponentType<{
668
+ error: Error;
669
+ }>;
670
+ };
671
+ declare const MeshApp: React__default.FC<React__default.PropsWithChildren<MeshAppProps>>;
672
+
673
+ type DataRefreshButtonProps = HTMLAttributes<HTMLButtonElement> & {
674
+ /** sets the button text */
675
+ buttonText: string;
676
+ /** shows or hides the loading indicator when retrieving data */
677
+ isLoading: boolean;
678
+ /** sets the onClick function */
679
+ onRefreshData: () => void;
680
+ };
681
+ /**
682
+ * @description The data refresh button is a UI component to indicate to users a request for data is taking place
683
+ * @example <DataRefreshButton buttonText="my button" isLoading /> */
684
+ declare const DataRefreshButton: ({ buttonText, isLoading, onRefreshData, ...props }: DataRefreshButtonProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
685
+
686
+ type ObjectSearchContainerProps = {
687
+ /**
688
+ * Adds a label to the search container.
689
+ */
690
+ label?: string;
691
+ /**
692
+ * Enables a dynamic input connect button to connect a dynamic input to the selected result ID
693
+ * Prerequisites:
694
+ * - label must be set
695
+ * - wrapped in DataResourceDynamicInputProvider
696
+ */
697
+ enableDynamicInputToResultId?: boolean;
698
+ /** a child node that places components within the search location */
699
+ searchFilters: ReactNode;
700
+ /** a child node that places components within a scrollable list location */
701
+ resultList?: ReactNode;
702
+ /** allows any child element */
703
+ children?: ReactNode;
704
+ };
705
+ /**
706
+ * @description Object search container is an opinionated layout for search parameters and retrieved results
707
+ * @example <ObjectSearchContainer searchFilters={<>your component</>} resultList={<>your result list component<>} onSave={yourSaveAction} onCancel={yourCancelAction} /> */
708
+ declare const ObjectSearchContainer: ({ label, enableDynamicInputToResultId, searchFilters, resultList, children, }: ObjectSearchContainerProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
709
+
710
+ type ObjectSearchFilterProps = {
711
+ /** shows or hides the required content type select option */
712
+ requireContentType?: boolean;
713
+ /** sets the text for the required content type select option
714
+ * @default 'All content types'
715
+ */
716
+ typeSelectorAllTypesOptionText?: string;
717
+ /** sets the select input value label text
718
+ * @default 'Content Type Select'
719
+ */
720
+ selectLabel?: string;
721
+ /** sets the select input options */
722
+ selectOptions: Array<{
723
+ id: string;
724
+ name?: string;
725
+ label: string;
726
+ }>;
727
+ /** sets the search input name value
728
+ * @default 'searchText'
729
+ */
730
+ searchInputName?: string;
731
+ /** sets the search input placeholder text
732
+ * @default 'Enter keyword to narrow your results'
733
+ */
734
+ searchInputPlaceholderText?: string;
735
+ };
736
+ /**
737
+ * @description Object search filter is an opinionated filter that has pre-defined query and setQuery functions
738
+ * that can be extended with custom fuctions
739
+ * @example <ObjectSearchFilter selectOptions={[{ id: 'id value', name: 'name value'}]} /> */
740
+ declare const ObjectSearchFilter: ({ requireContentType, typeSelectorAllTypesOptionText, searchInputName, searchInputPlaceholderText, selectLabel, selectOptions, }: ObjectSearchFilterProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
741
+
742
+ type ObjectSearchFilterContainerProps = {
743
+ /**
744
+ * sets the title for the container
745
+ * @deprecated we recommend setting the label on ObjectSearchContainer instead
746
+ */
747
+ label?: string;
748
+ /** sets child components in an opinionated layout */
749
+ children?: React.ReactNode;
750
+ };
751
+ /**
752
+ * @description an opinionated layout for search filters
753
+ * @example <ObjectSearchFilterContainer label="my label"><input type="text" aria-label="my input" /></ObjectSearchFilterContainer>
754
+ */
755
+ declare const ObjectSearchFilterContainer: ({ label, children }: ObjectSearchFilterContainerProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
756
+
757
+ type SearchQueryProps<TExtraFilters = unknown> = {
758
+ /** sets the content type in the search context */
759
+ contentType?: string;
760
+ /** sets the keyword search in the search context */
761
+ keyword?: string;
762
+ } & TExtraFilters;
763
+ type SelectedItemProps<TExtraProps = unknown> = {
764
+ /** sets the id value */
765
+ id: string;
766
+ /** sets the title value */
767
+ title: string;
768
+ /**
769
+ * sets the name value, sometimes used for products
770
+ * @deprecated use title instead
771
+ */
772
+ name?: string;
773
+ /**
774
+ * sets the subtitle value
775
+ * @deprecated this is unused
776
+ */
777
+ subtitle?: string;
778
+ /** sets the content type value */
779
+ contentType?: string | string[];
780
+ /** sets the created date value using TimeAgo to transform the date */
781
+ createdAt?: TDate;
782
+ /** sets the image src */
783
+ imageUrl?: string;
784
+ /** sets the link icon */
785
+ editLinkIcon?: string | React.ComponentType<{
786
+ className?: string;
787
+ }>;
788
+ /** sets the link href value to an external source */
789
+ editLink?: string;
790
+ /** sets the published date value using TimeAgo to transform the date */
791
+ publishedAt?: TDate;
792
+ /** sets the publish status */
793
+ publishStatus?: {
794
+ /** sets the text value of the publish badge */
795
+ text: string;
796
+ /** sets the theme value of the publish badge
797
+ * @default 'unimportant'
798
+ */
799
+ theme?: BadgeThemeProps;
800
+ };
801
+ /** sets any additional meta data */
802
+ metadata?: Record<string, string>;
803
+ /** allows for child react elements to be nested in the popover */
804
+ popoverData?: ReactNode;
805
+ /** disable or enable drag and drop functionality */
806
+ disableDnD?: boolean;
807
+ } & TExtraProps;
808
+ type ItemListProps<TListItemExtraProps = unknown> = {
809
+ items?: Array<SelectedItemProps<TListItemExtraProps>>;
810
+ };
811
+ type ObjectSearchContextProps<TExtraFilters = unknown, TExtraItemProps = unknown> = {
812
+ /** function that updates / sets the search query state */
813
+ onSetQuery: (value: SearchQueryProps<TExtraFilters>) => void;
814
+ /** current search query state */
815
+ query: SearchQueryProps<TExtraFilters>;
816
+ /**
817
+ * When dynamic inputs are used, this is the query with any dynamic input values expanded
818
+ * This is the value you'd want to send to a query endpoint to fetch; `query` will possibly
819
+ * have dynamic input values that haven't been expanded yet.
820
+ */
821
+ boundQuery: SearchQueryProps<TExtraFilters>;
822
+ /** function that sets the selected items to state */
823
+ onSelectItem: (selectedResult: SelectedItemProps<TExtraItemProps> | Array<SelectedItemProps<TExtraItemProps>>) => void;
824
+ /** function that clears all selected items from state */
825
+ onRemoveAllSelectedItems: () => void;
826
+ /** current selected items in state */
827
+ selectedListItems: Array<SelectedItemProps<TExtraItemProps>>;
828
+ /** current list of results in state */
829
+ list: ItemListProps<TExtraItemProps>;
830
+ /** function that sets the list of items to state */
831
+ onSetList: (value: ItemListProps) => void;
832
+ };
833
+ type ObjectSearchProviderProps = {
834
+ children: ReactNode;
835
+ currentlySelectedItems?: Array<SelectedItemProps>;
836
+ };
837
+ declare const ObjectSearchProvider: ({ currentlySelectedItems, children }: ObjectSearchProviderProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
838
+ declare function useObjectSearchContext<TExtraSearchFilters = unknown, TExtraItemProps = unknown>(): ObjectSearchContextProps<TExtraSearchFilters, TExtraItemProps>;
839
+
840
+ type ObjectSearchListItemProps = SelectedItemProps & {
841
+ /** sets the content type value, this is normally used for subtitles e.g. Kitchens */
842
+ contentType?: string | string[];
843
+ /** sets image parameters */
844
+ image?: {
845
+ /** sets the src valuue */
846
+ src: string;
847
+ /** sets the alt text value */
848
+ alt: string;
849
+ /** set the width attribute of the image
850
+ * if both width and height are set the image loading attribute is set to `lazy`
851
+ */
852
+ width?: number;
853
+ /** set the height attribute of the image
854
+ * if both width and height are set the image loading attribute is set to `lazy`
855
+ */
856
+ height?: number;
857
+ };
858
+ /** sets the function call on the role="button" wrapping element */
859
+ onSelect?: (data?: Record<string, unknown>) => void;
860
+ /** allows child components within the popover data */
861
+ popoverData?: React$1.ReactNode;
862
+ /** allows authors to add any child component that is not controlled by Uniform */
863
+ children?: React$1.ReactNode;
864
+ /** sets whether multiple entries can be added to the results list context
865
+ * @default false
866
+ */
867
+ isMulti?: boolean;
868
+ /** sets disabled state to the interactive element */
869
+ disabled?: boolean;
870
+ };
871
+ /**
872
+ * @description entry search list item is an opinionated UI component best used for initial retrieved results
873
+ * @example <ObjectSearchListItem id="my-result-item" title="title" popoverData={<p>some data info</p>}><div>example of uncontrolled content</div></ObjectSearchListItem> */
874
+ declare const ObjectSearchListItem: ({ id, title, contentType, image, popoverData, onSelect, isMulti, disabled, children, }: ObjectSearchListItemProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
875
+ /**
876
+ * An opinionated loading skeleton component best used with ObjectSearchListItem
877
+ * @example <ObjectSearchListItemLoadingSkeleton />
878
+ */
879
+ declare const ObjectSearchListItemLoadingSkeleton: () => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
880
+
881
+ type ObjectSearchResultItemProps = SelectedItemProps & {
882
+ /** sets additional remove functionality onto of default removal */
883
+ onRemove?: () => void;
884
+ /** sets whether to show or hide the remove button
885
+ * @default false
886
+ */
887
+ hideRemoveButton?: boolean;
888
+ /** sets user defined child nodes that are uncontrolled by Uniform */
889
+ children?: ReactNode;
890
+ /** disable or enable drag and drop functionality
891
+ * @default false
892
+ */
893
+ disableDnD?: boolean;
894
+ };
895
+ /**
896
+ * @description An opinionated result item, best used for selected results
897
+ * @example <ObjectSearchResultItem id="my-result" title="title" />
898
+ */
899
+ declare const ObjectSearchResultItem: ({ id, title, name, contentType, popoverData, publishStatus, editLinkIcon, editLink, imageUrl, onRemove, createdAt, publishedAt, hideRemoveButton, disableDnD, children, }: ObjectSearchResultItemProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
900
+
901
+ type ObjectSearchResultItemButtonProps<THtml extends HTMLAttributes<HTMLElement> = HTMLAttributes<HTMLButtonElement>> = {
902
+ /** sets the button or link text value */
903
+ text: string;
904
+ /** sets the button or link icon */
905
+ icon?: string | React.ComponentType<{
906
+ className?: string;
907
+ }>;
908
+ } & THtml;
909
+ /**
910
+ * @description An opinionated button component best used within the ObjectSearchResultItem component
911
+ * @example <ObjectSearchResultItemButton text="button text" icon="/my-image.png" onClick={() => myFunction()} />
912
+ */
913
+ declare const ObjectSearchResultItemButton: ({ text, icon, ...props }: ObjectSearchResultItemButtonProps<HTMLAttributes<HTMLButtonElement>>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
914
+ /**
915
+ * @description An opinionated link component styled the same of the ObjectSearchResultItemButton component,
916
+ * that automatically sets the target and rel attributes. Best used within the ObjectSearchResultItem component
917
+ * @example <LinkButton text="link text" icon="/my-image.png" />
918
+ */
919
+ declare const LinkButton: ({ text, icon, ...props }: ObjectSearchResultItemButtonProps<Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'target' | 'rel'>>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
920
+
921
+ type ObjectSearchResultListProps<TRenderComponent extends SelectedItemProps = SelectedItemProps> = {
922
+ /** sets the result label value
923
+ * @default 'Selected'
924
+ */
925
+ resultLabelText?: string;
926
+ /** sets the on remove button click action */
927
+ onRemoveAllSelected?: () => void;
928
+ /** sets the remove button text
929
+ * @default 'Remove all'
930
+ */
931
+ removeButtonText?: string;
932
+ /** sets whether to show or hide the remove button
933
+ * @default false
934
+ */
935
+ hideRemoveButton?: boolean;
936
+ /** allows additional buttons to be added to the result title group */
937
+ additionalButtons?: React.ReactNode;
938
+ /** allows placing child components within the result list area */
939
+ renderResultComponent?: (value: TRenderComponent) => React.ReactNode;
940
+ /** disable or enable drag and drop functionality
941
+ * @default false
942
+ */
943
+ disableDnD?: boolean;
944
+ /** sets the draggable id value */
945
+ multiSelectId?: string;
946
+ /** Rendered when nothing is selected */
947
+ whenNothingSelected?: React.ReactNode;
948
+ };
949
+ /**
950
+ * @description An opinionated result list UI component that has built in drag and drop functionality and removal of all selected items from context.
951
+ * The result item component defaults to <ObjectSearchResultItem {...props} />, however this can be overridden with any other UI component and still
952
+ * maintain drag and drop functionality
953
+ * @example <ObjectSearchResultList id="my-id" title="title" renderResultComponent={(values) => <CustomComponent {...values} />} />
954
+ */
955
+ declare function ObjectSearchResultList<TRenderComponent extends SelectedItemProps = SelectedItemProps>({ resultLabelText, removeButtonText, onRemoveAllSelected, hideRemoveButton, additionalButtons, renderResultComponent, multiSelectId, disableDnD, whenNothingSelected, }: ObjectSearchResultListProps<TRenderComponent>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
956
+
957
+ type QueryFilterSearchProps = {
958
+ /** sets the count value */
959
+ count: number | string;
960
+ /** sets the sortBy filter value */
961
+ sortBy: string;
962
+ /** sets the sortOrder filter value */
963
+ sortOrder: string;
964
+ };
965
+ type QuertFilterSelectionOptionProps = Array<{
966
+ id: string;
967
+ name: string;
968
+ label: string;
969
+ }>;
970
+ type QueryFilterProps<TSelectOptions extends QuertFilterSelectionOptionProps = QuertFilterSelectionOptionProps> = {
971
+ /** sets the query filter title
972
+ * @default 'Configure Query'
973
+ */
974
+ queryFilterTitle?: string;
975
+ /** sets the content type all selected options label
976
+ * @default 'All content types'
977
+ */
978
+ typeSelectorAllTypesOptionText?: string;
979
+ /** sets the content type label value
980
+ * @default 'Filter by content type'
981
+ */
982
+ contentTypeLabel?: string;
983
+ /** sets the content type select options */
984
+ contentTypeOptions: TSelectOptions;
985
+ /** sets whether the content type filter is required */
986
+ requireContentType?: boolean;
987
+ /** sets the count label value
988
+ * @default 'Count'
989
+ */
990
+ countLabel?: string;
991
+ /** sets the count value or items to show
992
+ * @default 5
993
+ */
994
+ countValue?: number;
995
+ /** sets the sort label text
996
+ * @default 'Sort'
997
+ */
998
+ sortLabel?: string;
999
+ /** sets the sort select options value */
1000
+ sortOptions: TSelectOptions;
1001
+ /** sets the sort order lable value
1002
+ * @default 'Sort Order'
1003
+ */
1004
+ sortOrderLabel?: string;
1005
+ /** sets the sort order select options value */
1006
+ sortOrderOptions: TSelectOptions;
1007
+ /** sets the search input name value
1008
+ * @default 'searchText'
1009
+ */
1010
+ searchInputName?: string;
1011
+ /** sets the search input placeholder text
1012
+ * @default 'Enter keyword to narrow your results'
1013
+ */
1014
+ searchInputPlaceholderText?: string;
1015
+ /** sets the label for the search input
1016
+ * @default 'Query'
1017
+ */
1018
+ searchInputLabel?: string;
1019
+ /** allows for additional child components, for example more input components */
1020
+ children?: ReactNode;
1021
+ };
1022
+ /**
1023
+ * @description An opinionated multi query filter UI component, best used for querying product data or more complex scenarios
1024
+ * @example <QueryFilter contentTypeOptions={[{ id: 'id', name: 'name' }]} sortOptions={[{ id: 'id', name: 'name' }]} sortOrderOptions={[{ id: 'id', name: 'name' }]} />
1025
+ */
1026
+ declare const QueryFilter: ({ requireContentType, queryFilterTitle, contentTypeLabel, typeSelectorAllTypesOptionText, contentTypeOptions, searchInputName, searchInputPlaceholderText, searchInputLabel, countLabel, countValue, sortLabel, sortOptions, sortOrderLabel, sortOrderOptions, children, }: QueryFilterProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
1027
+
1028
+ /** Editor component to let you write a request body for POST requests */
1029
+ declare function RequestBody(): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
1030
+
1031
+ /** Editor component to manage HTTP headers on a request */
1032
+ declare function RequestHeaders({ disableVariables }: Pick<InputVariablesProps, 'disableVariables'>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
1033
+
1034
+ /** Dropdown to pick a HTTP method for a request */
1035
+ declare function RequestMethodSelect(props: Omit<InputSelectProps, 'value' | 'onChange' | 'options'>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
1036
+
1037
+ type RequestParametersProps = Pick<InputVariablesProps, 'disableVariables'>;
1038
+ /** Component to manage query parameters on a request */
1039
+ declare function RequestParameters({ disableVariables }: Pick<InputVariablesProps, 'disableVariables'>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
1040
+
1041
+ type RequestParameter = {
1042
+ key: string;
1043
+ value: string;
1044
+ };
1045
+ type BaseRequestData = {
1046
+ baseUrl: string;
1047
+ headers?: Array<RequestParameter>;
1048
+ parameters?: Array<RequestParameter>;
1049
+ };
1050
+ type RequestData = {
1051
+ relativeUrl: string;
1052
+ headers: Array<RequestParameter>;
1053
+ parameters: Array<RequestParameter>;
1054
+ baseRequest?: BaseRequestData;
1055
+ method?: string;
1056
+ body?: string;
1057
+ };
1058
+ type RequestProviderProps = React$1.PropsWithChildren<{
1059
+ value: RequestData;
1060
+ onChange: (delegate: (oldValue: RequestData) => RequestData) => void;
1061
+ }>;
1062
+ type RequestAction = {
1063
+ type: 'setRelativeUrl';
1064
+ relativeUrl: string;
1065
+ } | {
1066
+ type: 'updateHeader';
1067
+ header: RequestParameter;
1068
+ index?: number;
1069
+ } | {
1070
+ type: 'removeHeader';
1071
+ index: number;
1072
+ } | {
1073
+ type: 'updateParameter';
1074
+ parameter: RequestParameter;
1075
+ index?: number;
1076
+ } | {
1077
+ type: 'removeParameter';
1078
+ index: number;
1079
+ } | {
1080
+ type: 'setMethod';
1081
+ method: string;
1082
+ } | {
1083
+ type: 'setBody';
1084
+ body: string;
1085
+ contentType: string;
1086
+ };
1087
+ type RequestContext = {
1088
+ dispatch: (event: RequestAction) => void;
1089
+ request: Readonly<RequestData>;
1090
+ };
1091
+ /** Provides a mutable HTTP request object context. Components such as RequestBody and RequestUrl use this context to render. */
1092
+ declare function RequestProvider({ value, onChange, children }: RequestProviderProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
1093
+ declare function useRequest(): RequestContext;
1094
+
1095
+ type RequestTypeContainerProps = React$1.HTMLAttributes<HTMLDivElement> & {
1096
+ /**sets the background color of the container
1097
+ * @default 'transparent'
1098
+ */
1099
+ bgColor?: 'transparent' | 'var(--gray-100)';
1100
+ children: React$1.ReactNode;
1101
+ };
1102
+ /**
1103
+ * @description a container to layout content in a 2 column grid format = 12ch 1fr
1104
+ * @example <RequestTypeContainer bgColor="var(--gray-100)">
1105
+ * <label>Name <input type="text" /></label>
1106
+ * <label>Name <input type="text" /></label>
1107
+ * </div> */
1108
+ declare const RequestTypeContainer: ({ bgColor, children, ...props }: RequestTypeContainerProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
1109
+
1110
+ /**
1111
+ * Displays the current full URL of the request, including the base URL if one is set
1112
+ */
1113
+ declare function RequestUrl(): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
1114
+
1115
+ /**
1116
+ * Editor to modify the current URL of the request
1117
+ * Note: entering query string parameters automatically converts them and syncs the request state with them
1118
+ */
1119
+ declare function RequestUrlInput(props: Omit<InputVariablesProps, 'value' | 'onChange'>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
1120
+
1121
+ declare function urlEncodeRequestUrl(url: string, varValues?: Record<string, DataVariableDefinition>): string;
1122
+ declare function urlEncodeRequestParameter(parameter: RequestParameter, varValues?: Record<string, DataVariableDefinition>): RequestParameter;
1123
+
1124
+ /**
1125
+ * Hook to make it simple to read and write a specific request header by name,
1126
+ * instead of supporting multiple values in an array like native dispatch.
1127
+ *
1128
+ * NOTE: if multiple values are added for the named header, this hook will bind to the FIRST
1129
+ * instance of the header and leave the other values alone.
1130
+ */
1131
+ declare function useRequestHeader(headerName: string): {
1132
+ value: string;
1133
+ update: (value: string) => void;
1134
+ };
1135
+
1136
+ /**
1137
+ * Hook to make it simple to read and write a specific request query string parameter by name,
1138
+ * instead of supporting multiple values in an array like native dispatch.
1139
+ *
1140
+ * NOTE: if multiple values are added for the named parameter, this hook will bind to the FIRST
1141
+ * instance of the parameter and leave the other values alone.
1142
+ */
1143
+ declare function useRequestParameter(paramName: string): {
1144
+ value: string;
1145
+ update: (value: string) => void;
1146
+ };
1147
+
1148
+ /**
1149
+ * Provides convenient access to the current Uniform Mesh SDK instance via React hook.
1150
+ * Intended to be used within <MeshApp />.
1151
+ */
1152
+ declare function useUniformMeshSdk(): _uniformdev_mesh_sdk.UniformMeshSDK;
1153
+
1154
+ /**
1155
+ * Creates a validation interceptor between useMeshLocation's setValue function and your code.
1156
+ * You can use this utility to write cleaner validation logic for your Mesh Location UIs.
1157
+ * @param setValue The location's raw setValue function
1158
+ * @param validate A function to validate the new location's value.
1159
+ * @returns An equivalent to the setValue function that intercepts sets, performs validation, and emits the result with the new value.
1160
+ */
1161
+ declare function createLocationValidator<TSetValue>(setValue: SetLocationValueDispatch<TSetValue>, validate: (newValue: TSetValue, currentResult: SetValueOptions | undefined) => SetValueOptions): SetLocationValueDispatch<TSetValue>;
1162
+
1163
+ export { BaseRequestData, Brand, DamItem, DamSelectedItem, DamSelectedItemProps, DataRefreshButton, DataRefreshButtonProps, DataResourceDynamicInputProvider, DataResourceDynamicInputProviderProps, DataResourceVariableRendererProps, DataResourceVariablesList, DataResourceVariablesListExplicit, DataResourceVariablesListProps, DataSourceEditor, DataSourceEditorProps, DataTypeEditor, DataTypeEditorProps, DataVariableDefinitionWithName, DefaultSearchRow, DefaultSelectedItem, DispatchResult, EntrySearch, EntrySearchContentType, EntrySearchProps, EntrySearchQueryOptions, EntrySearchResult, EntrySearchRowProps, EntrySearchSelectedItemProps, GetProductOptions, GetProductsOptions, index as Icons, InputToken, InputVariables, InputVariablesProps, ItemListProps, LinkButton, MeshApp, MeshAppProps, MinimalDynamicInput, MinimalDynamicInputs, NoResultsProps, ObjectSearchContainer, ObjectSearchContainerProps, ObjectSearchContextProps, ObjectSearchFilter, ObjectSearchFilterContainer, ObjectSearchFilterContainerProps, ObjectSearchFilterProps, ObjectSearchListItem, ObjectSearchListItemLoadingSkeleton, ObjectSearchListItemProps, ObjectSearchProvider, ObjectSearchProviderProps, ObjectSearchResultItem, ObjectSearchResultItemButton, ObjectSearchResultItemButtonProps, ObjectSearchResultItemProps, ObjectSearchResultList, ObjectSearchResultListProps, ProductCategory, ProductDynamicSelectorValue, ProductPreviewList, ProductQuery, ProductQueryCategory, ProductQueryContext, ProductQueryContextValue, ProductQueryProps, ProductSearch, ProductSearchContext, ProductSearchContextValue, ProductSearchProps, ProductSearchResult, ProductSearchResults, ProductSearchRow, ProductSelectedItem, 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, TextVariableRenderer, VariableEditor, VariableEditorProps, VariablesAction, VariablesContext, VariablesEvents, 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, useMeshLocation, useObjectSearchContext, useProductQueryContext, useProductSearchContext, useRequest, useRequestHeader, useRequestParameter, useUniformMeshSdk, useVariables, variablePrefix, variableSuffix, variablesToList };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/mesh-sdk-react",
3
- "version": "19.35.2",
3
+ "version": "19.36.0",
4
4
  "description": "Uniform Mesh Framework SDK for React",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -45,8 +45,8 @@
45
45
  "dependencies": {
46
46
  "@hookform/resolvers": "^3.0.1",
47
47
  "@lexical/react": "^0.11.1",
48
- "@uniformdev/design-system": "19.35.2",
49
- "@uniformdev/mesh-sdk": "19.35.2",
48
+ "@uniformdev/design-system": "19.36.0",
49
+ "@uniformdev/mesh-sdk": "19.36.0",
50
50
  "lexical": "^0.11.1",
51
51
  "mitt": "^3.0.0",
52
52
  "react-beautiful-dnd": "13.1.1",
@@ -80,5 +80,5 @@
80
80
  "publishConfig": {
81
81
  "access": "public"
82
82
  },
83
- "gitHead": "64d3270175087c87cfaa29a283aa4a7b0a98fd2c"
83
+ "gitHead": "3ae246a7f0f39adeaf04ecba4c7e48c478c019ad"
84
84
  }