@uniformdev/mesh-sdk-react 19.35.2 → 19.35.3-alpha.82
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.mts +1480 -0
- package/dist/index.d.ts +372 -55
- package/dist/index.esm.js +1888 -2570
- package/dist/index.js +1932 -2586
- package/dist/index.mjs +1888 -2570
- package/package.json +7 -4
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,1480 @@
|
|
|
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, ReactNode, MutableRefObject, ComponentType, PropsWithChildren, HTMLAttributes, 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, BindableTypes } 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
|
+
import * as lexical from 'lexical';
|
|
14
|
+
import { SerializedEditorState, SerializedLexicalNode, Spread, DecoratorNode, NodeKey, LexicalEditor, LexicalNode, EditorState } from 'lexical';
|
|
15
|
+
import { MenuOption } from '@lexical/react/LexicalTypeaheadMenuPlugin';
|
|
16
|
+
|
|
17
|
+
declare const SvgCaution: (props: SVGProps<SVGSVGElement>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
18
|
+
|
|
19
|
+
declare const SvgCheckmark: (props: SVGProps<SVGSVGElement>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
20
|
+
|
|
21
|
+
declare const SvgChevronDown: (props: SVGProps<SVGSVGElement>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
22
|
+
|
|
23
|
+
declare const SvgClose: (props: SVGProps<SVGSVGElement>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
24
|
+
|
|
25
|
+
declare const SvgDanger: (props: SVGProps<SVGSVGElement>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
26
|
+
|
|
27
|
+
declare const SvgExclamationPoint: (props: SVGProps<SVGSVGElement>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
28
|
+
|
|
29
|
+
declare const SvgInfo: (props: SVGProps<SVGSVGElement>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
30
|
+
|
|
31
|
+
declare const SvgLightbulb: (props: SVGProps<SVGSVGElement>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
32
|
+
|
|
33
|
+
declare const SvgMagnifyingGlass: (props: SVGProps<SVGSVGElement>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
34
|
+
|
|
35
|
+
declare const SvgMaximizeAlt: (props: SVGProps<SVGSVGElement>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
36
|
+
|
|
37
|
+
declare const SvgMinus: (props: SVGProps<SVGSVGElement>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
38
|
+
|
|
39
|
+
declare const SvgMoreVerticalAlt: (props: SVGProps<SVGSVGElement>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
40
|
+
|
|
41
|
+
declare const SvgPlus: (props: SVGProps<SVGSVGElement>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
42
|
+
|
|
43
|
+
declare namespace index {
|
|
44
|
+
export {
|
|
45
|
+
SvgCaution as Caution,
|
|
46
|
+
SvgCheckmark as Checkmark,
|
|
47
|
+
SvgChevronDown as ChevronDown,
|
|
48
|
+
SvgClose as Close,
|
|
49
|
+
SvgDanger as Danger,
|
|
50
|
+
SvgExclamationPoint as ExclamationPoint,
|
|
51
|
+
SvgInfo as Info,
|
|
52
|
+
SvgLightbulb as Lightbulb,
|
|
53
|
+
SvgMagnifyingGlass as MagnifyingGlass,
|
|
54
|
+
SvgMaximizeAlt as MaximizeAlt,
|
|
55
|
+
SvgMinus as Minus,
|
|
56
|
+
SvgMoreVerticalAlt as MoreVerticalAlt,
|
|
57
|
+
SvgPlus as Plus,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
interface EntrySearchSelectedItemProps<TResult extends EntrySearchResult = EntrySearchResult> {
|
|
62
|
+
selectedItem: TResult;
|
|
63
|
+
logoIcon: string | React__default.ComponentType<{
|
|
64
|
+
className?: string;
|
|
65
|
+
}>;
|
|
66
|
+
onDeselect: (item: TResult) => void;
|
|
67
|
+
onEditClosed?: (item: TResult) => void;
|
|
68
|
+
}
|
|
69
|
+
declare const DefaultSelectedItem: React__default.FC<EntrySearchSelectedItemProps>;
|
|
70
|
+
|
|
71
|
+
type EntrySearchQueryOptions = {
|
|
72
|
+
count: number;
|
|
73
|
+
offset: number;
|
|
74
|
+
contentType?: string;
|
|
75
|
+
cursor?: string;
|
|
76
|
+
};
|
|
77
|
+
type EntrySearchProps<TResult extends EntrySearchResult = EntrySearchResult> = {
|
|
78
|
+
search: (text: string, options: EntrySearchQueryOptions) => void;
|
|
79
|
+
results: TResult[] | undefined;
|
|
80
|
+
totalResults?: number | undefined;
|
|
81
|
+
cursor?: string;
|
|
82
|
+
contentTypes?: EntrySearchContentType[];
|
|
83
|
+
selectedItems: TResult[] | undefined;
|
|
84
|
+
logoIcon: string | React$1.ComponentType<{
|
|
85
|
+
className?: string;
|
|
86
|
+
}>;
|
|
87
|
+
select: (items: TResult[], selectedContentType?: string) => void;
|
|
88
|
+
requireContentType?: boolean;
|
|
89
|
+
multiSelectId?: string;
|
|
90
|
+
multiSelect?: boolean;
|
|
91
|
+
rowComponent?: React$1.FC<EntrySearchRowProps<TResult>>;
|
|
92
|
+
selectedItemComponent?: React$1.FC<EntrySearchSelectedItemProps<TResult>>;
|
|
93
|
+
onAddNew?: (type: EntrySearchContentType) => void;
|
|
94
|
+
onEditClosed?: (item: EntrySearchResult) => void;
|
|
95
|
+
onCancel?: () => void;
|
|
96
|
+
resultsLoading?: boolean;
|
|
97
|
+
noResultsComponent?: React$1.FC<{
|
|
98
|
+
searchText?: string;
|
|
99
|
+
selectedContentType?: string;
|
|
100
|
+
}>;
|
|
101
|
+
helpComponent?: JSX.Element;
|
|
102
|
+
onSort?: (items: TResult[]) => void;
|
|
103
|
+
typeSelectorLabel?: string;
|
|
104
|
+
typeSelectorAllTypesOptionText?: string;
|
|
105
|
+
/** Specifies how long (in milliseconds) to wait before showing the loading indicator when `resultsLoading` is true.
|
|
106
|
+
* @default 1000
|
|
107
|
+
*/
|
|
108
|
+
loadingIndicatorDelay?: number;
|
|
109
|
+
};
|
|
110
|
+
interface EntrySearchResult {
|
|
111
|
+
id: string;
|
|
112
|
+
title: string | JSX.Element;
|
|
113
|
+
createdDate?: TDate;
|
|
114
|
+
editLink?: string;
|
|
115
|
+
metadata?: Record<string, string | JSX.Element>;
|
|
116
|
+
popoverData?: Record<string, string | JSX.Element>;
|
|
117
|
+
}
|
|
118
|
+
interface EntrySearchContentType {
|
|
119
|
+
id: string;
|
|
120
|
+
name: string;
|
|
121
|
+
}
|
|
122
|
+
interface NoResultsProps {
|
|
123
|
+
searchText: string | undefined;
|
|
124
|
+
selectedContentType: string | undefined;
|
|
125
|
+
}
|
|
126
|
+
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;
|
|
127
|
+
|
|
128
|
+
interface EntrySearchRowProps<TResult extends EntrySearchResult = EntrySearchResult> {
|
|
129
|
+
result: TResult;
|
|
130
|
+
isSelected: boolean;
|
|
131
|
+
triggerSelection: () => void;
|
|
132
|
+
}
|
|
133
|
+
declare const DefaultSearchRow: React__default.FC<EntrySearchRowProps>;
|
|
134
|
+
|
|
135
|
+
declare const searchRowContainer: _emotion_react.SerializedStyles;
|
|
136
|
+
declare const searchRowContainerWithPopover: _emotion_react.SerializedStyles;
|
|
137
|
+
declare const searchRowContainerActive: _emotion_react.SerializedStyles;
|
|
138
|
+
declare const searchRowTextSmall: _emotion_react.SerializedStyles;
|
|
139
|
+
declare const searchRowText: _emotion_react.SerializedStyles;
|
|
140
|
+
declare const searchRowPopover: _emotion_react.SerializedStyles;
|
|
141
|
+
declare const searchRowBtn: _emotion_react.SerializedStyles;
|
|
142
|
+
|
|
143
|
+
declare const selectedItemContainer: _emotion_react.SerializedStyles;
|
|
144
|
+
declare const selectedItemInner: _emotion_react.SerializedStyles;
|
|
145
|
+
declare const selectedItemDetails: _emotion_react.SerializedStyles;
|
|
146
|
+
declare const selectedItemCopy: _emotion_react.SerializedStyles;
|
|
147
|
+
declare const selectedItemTitle: _emotion_react.SerializedStyles;
|
|
148
|
+
declare const selectedItemIcon: _emotion_react.SerializedStyles;
|
|
149
|
+
declare const selectItemPopover: _emotion_react.SerializedStyles;
|
|
150
|
+
declare const selectItemSmallText: _emotion_react.SerializedStyles;
|
|
151
|
+
declare const selectItemPopoverLabel: _emotion_react.SerializedStyles;
|
|
152
|
+
declare const selectItemLinkContainer: _emotion_react.SerializedStyles;
|
|
153
|
+
declare const selectItemLinkBtn: _emotion_react.SerializedStyles;
|
|
154
|
+
|
|
155
|
+
declare const entrySearchWrapper: _emotion_react.SerializedStyles;
|
|
156
|
+
declare const entrySearchBtn: _emotion_react.SerializedStyles;
|
|
157
|
+
declare const entrySearchLoadMoreBtn: _emotion_react.SerializedStyles;
|
|
158
|
+
declare const entrySearchConfig: _emotion_react.SerializedStyles;
|
|
159
|
+
declare const entrySearchConfigHidden: _emotion_react.SerializedStyles;
|
|
160
|
+
declare const entrySearchResultList: _emotion_react.SerializedStyles;
|
|
161
|
+
declare const entrySearchSelectInput: _emotion_react.SerializedStyles;
|
|
162
|
+
declare const entrySearchSelectIcon: _emotion_react.SerializedStyles;
|
|
163
|
+
declare const entrySearchSelectImg: _emotion_react.SerializedStyles;
|
|
164
|
+
declare const entrySearchSelectOption: _emotion_react.SerializedStyles;
|
|
165
|
+
declare const draggableContainer: _emotion_react.SerializedStyles;
|
|
166
|
+
declare const draggableIconWrapper: _emotion_react.SerializedStyles;
|
|
167
|
+
declare const draggableIcon: _emotion_react.SerializedStyles;
|
|
168
|
+
declare const draggableIconOffset: _emotion_react.SerializedStyles;
|
|
169
|
+
declare const badgeIcon: _emotion_react.SerializedStyles;
|
|
170
|
+
|
|
171
|
+
type GetProductsOptions = {
|
|
172
|
+
keyword?: string;
|
|
173
|
+
count?: number;
|
|
174
|
+
categories?: string[];
|
|
175
|
+
brand?: string;
|
|
176
|
+
sort?: string;
|
|
177
|
+
sortOrder?: string;
|
|
178
|
+
ids?: string[];
|
|
179
|
+
offset?: number;
|
|
180
|
+
};
|
|
181
|
+
type ProductSearchResult = EntrySearchResult & {
|
|
182
|
+
price?: number | string;
|
|
183
|
+
sku?: string;
|
|
184
|
+
thumbnailUrl?: string;
|
|
185
|
+
categories?: Array<{
|
|
186
|
+
id: string;
|
|
187
|
+
name: string;
|
|
188
|
+
}>;
|
|
189
|
+
};
|
|
190
|
+
interface ProductSearchResults {
|
|
191
|
+
total: number;
|
|
192
|
+
products: ProductSearchResult[];
|
|
193
|
+
}
|
|
194
|
+
interface ProductCategory {
|
|
195
|
+
id: string;
|
|
196
|
+
name: string;
|
|
197
|
+
children?: ProductCategory[];
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
declare const ProductPreviewList: ({ products, }: {
|
|
201
|
+
products: ProductSearchResults['products'] | undefined;
|
|
202
|
+
}) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
203
|
+
|
|
204
|
+
interface ProductDynamicSelectorValue {
|
|
205
|
+
count: number;
|
|
206
|
+
categories?: string[];
|
|
207
|
+
brand?: string;
|
|
208
|
+
keyword?: string;
|
|
209
|
+
sort?: string;
|
|
210
|
+
sortOrder?: string;
|
|
211
|
+
}
|
|
212
|
+
interface ProductQueryProps<TValue extends ProductDynamicSelectorValue = ProductDynamicSelectorValue> {
|
|
213
|
+
value: TValue | undefined;
|
|
214
|
+
setValue: (value: TValue) => Promise<void>;
|
|
215
|
+
brands: Brand[] | undefined;
|
|
216
|
+
categories: ProductQueryCategory[] | undefined;
|
|
217
|
+
loading?: boolean;
|
|
218
|
+
categoriesLoading?: boolean;
|
|
219
|
+
brandsLoading?: boolean;
|
|
220
|
+
logoIcon?: string | React__default.ComponentType<{
|
|
221
|
+
className?: string;
|
|
222
|
+
}>;
|
|
223
|
+
onGetProducts: (options?: GetProductsOptions) => Promise<ProductSearchResults>;
|
|
224
|
+
sortOptions?: Array<{
|
|
225
|
+
name: string;
|
|
226
|
+
sortKey: string;
|
|
227
|
+
}>;
|
|
228
|
+
sortOrderOptions?: Array<{
|
|
229
|
+
name: string;
|
|
230
|
+
sortOrderKey: string;
|
|
231
|
+
}>;
|
|
232
|
+
categoryLabel?: string;
|
|
233
|
+
brandLabel?: string;
|
|
234
|
+
disableBrands?: boolean;
|
|
235
|
+
restrictToSingleCategory?: boolean;
|
|
236
|
+
}
|
|
237
|
+
interface ProductQueryCategory {
|
|
238
|
+
id: string;
|
|
239
|
+
name: string;
|
|
240
|
+
children?: ProductQueryCategory[];
|
|
241
|
+
}
|
|
242
|
+
interface Brand {
|
|
243
|
+
id: string;
|
|
244
|
+
name: string;
|
|
245
|
+
}
|
|
246
|
+
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;
|
|
247
|
+
interface ProductQueryContextValue {
|
|
248
|
+
categories: ProductQueryProps['categories'];
|
|
249
|
+
logoIcon: ProductQueryProps['logoIcon'];
|
|
250
|
+
}
|
|
251
|
+
declare const ProductQueryContext: React__default.Context<ProductQueryContextValue | undefined>;
|
|
252
|
+
declare const useProductQueryContext: () => ProductQueryContextValue;
|
|
253
|
+
|
|
254
|
+
type ProductSearchProps<TResult extends ProductSearchResult = ProductSearchResult> = Pick<EntrySearchProps<TResult>, 'multiSelect' | 'multiSelectId' | 'logoIcon' | 'rowComponent' | 'selectedItemComponent' | 'helpComponent' | 'noResultsComponent' | 'onSort' | 'typeSelectorAllTypesOptionText' | 'typeSelectorLabel'> & {
|
|
255
|
+
selectedProducts: TResult[] | undefined;
|
|
256
|
+
setSelectedProducts: (products: TResult[] | undefined) => Promise<void>;
|
|
257
|
+
onGetCategories: () => Promise<ProductCategory[]>;
|
|
258
|
+
onSearchProducts: (args: {
|
|
259
|
+
text: string;
|
|
260
|
+
options?: GetProductOptions;
|
|
261
|
+
}) => Promise<{
|
|
262
|
+
total: number;
|
|
263
|
+
products: TResult[];
|
|
264
|
+
cursor?: string;
|
|
265
|
+
}>;
|
|
266
|
+
errorComponent?: React__default.ComponentType<{
|
|
267
|
+
categoriesError?: Error;
|
|
268
|
+
searchError?: Error;
|
|
269
|
+
}>;
|
|
270
|
+
};
|
|
271
|
+
interface GetProductOptions {
|
|
272
|
+
limit?: number;
|
|
273
|
+
offset?: number;
|
|
274
|
+
categoryId?: string;
|
|
275
|
+
cursor?: string;
|
|
276
|
+
}
|
|
277
|
+
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;
|
|
278
|
+
interface ProductSearchContextValue {
|
|
279
|
+
logoIcon: ProductSearchProps['logoIcon'];
|
|
280
|
+
categories: ProductCategory[] | undefined;
|
|
281
|
+
}
|
|
282
|
+
declare const ProductSearchContext: React__default.Context<ProductSearchContextValue | undefined>;
|
|
283
|
+
declare const useProductSearchContext: () => ProductSearchContextValue;
|
|
284
|
+
|
|
285
|
+
declare function ProductSearchRow({ result, isSelected, triggerSelection, }: EntrySearchRowProps<ProductSearchResult>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
286
|
+
|
|
287
|
+
declare function ProductSelectedItem({ selectedItem, onDeselect, }: EntrySearchSelectedItemProps<ProductSearchResult>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
288
|
+
|
|
289
|
+
declare const ResolvableLoadingValue: ({ value, text, loading, }: {
|
|
290
|
+
value: string;
|
|
291
|
+
text: string | undefined;
|
|
292
|
+
loading: boolean;
|
|
293
|
+
}) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
294
|
+
|
|
295
|
+
type SelectionFieldValue = {
|
|
296
|
+
id: string;
|
|
297
|
+
name: string;
|
|
298
|
+
};
|
|
299
|
+
declare const SelectionField: ({ id, label, loading, selectedValues, values, onAdd, onRemove, }: {
|
|
300
|
+
id: string;
|
|
301
|
+
label: string;
|
|
302
|
+
loading: boolean;
|
|
303
|
+
selectedValues: string[] | undefined;
|
|
304
|
+
values: SelectionFieldValue[];
|
|
305
|
+
onAdd: (id: string) => void;
|
|
306
|
+
onRemove: (id: string) => void;
|
|
307
|
+
}) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
308
|
+
|
|
309
|
+
declare const productSearchRowContainer: _emotion_react.SerializedStyles;
|
|
310
|
+
declare const productSearchRowContent: _emotion_react.SerializedStyles;
|
|
311
|
+
declare const productSearchRowContentActive: _emotion_react.SerializedStyles;
|
|
312
|
+
declare const productSearchRowTitle: _emotion_react.SerializedStyles;
|
|
313
|
+
declare const productSearchRowCategory: _emotion_react.SerializedStyles;
|
|
314
|
+
declare const productSearchRowDetails: _emotion_react.SerializedStyles;
|
|
315
|
+
declare const productSearchRowActiveIcon: _emotion_react.SerializedStyles;
|
|
316
|
+
|
|
317
|
+
declare const productSelectedItemContainer: _emotion_react.SerializedStyles;
|
|
318
|
+
declare const productSelectedItemDetails: _emotion_react.SerializedStyles;
|
|
319
|
+
declare const productSelectedItemContent: _emotion_react.SerializedStyles;
|
|
320
|
+
declare const productSelectedItemImage: _emotion_react.SerializedStyles;
|
|
321
|
+
declare const productedSelectedItemLinkBtn: _emotion_react.SerializedStyles;
|
|
322
|
+
declare const productedSelectedItemSmallText: _emotion_react.SerializedStyles;
|
|
323
|
+
declare const productSelectedItemIcon: _emotion_react.SerializedStyles;
|
|
324
|
+
declare const productSelectedItemLinkContainer: _emotion_react.SerializedStyles;
|
|
325
|
+
|
|
326
|
+
interface DamItem {
|
|
327
|
+
id: string;
|
|
328
|
+
title: string | JSX.Element;
|
|
329
|
+
createdDate?: Date | string | number;
|
|
330
|
+
editLink?: string | JSX.Element;
|
|
331
|
+
metadata?: Record<string, string | JSX.Element>;
|
|
332
|
+
popoverData?: Record<string, string | JSX.Element>;
|
|
333
|
+
previewUrl?: string | JSX.Element;
|
|
334
|
+
type: 'image' | 'video' | 'file' | 'other';
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
interface DamSelectedItemProps<TResult extends DamItem = DamItem> {
|
|
338
|
+
/** The item used for rendering this component. */
|
|
339
|
+
selectedItem: TResult;
|
|
340
|
+
/** Logo icon is used for the `editLink` if `editLink` is a string value, otherwise the icon is not used. */
|
|
341
|
+
logoIcon?: string | React__default.ComponentType<{
|
|
342
|
+
className?: string;
|
|
343
|
+
}>;
|
|
344
|
+
/** Callback that is invoked when the "Unlink" (deselect) button is clicked. */
|
|
345
|
+
onDeselect: (item: TResult) => void;
|
|
346
|
+
/** If `editLink` is a string value, an `<a>` element will be rendered for the `editLink` and
|
|
347
|
+
* the `onEditClosed` callback will be invoked when the tab opened by clicking the `<a>` element is closed. */
|
|
348
|
+
onEditClosed?: (item: TResult) => void;
|
|
349
|
+
/** Allows for customizing how item details, e.g. item preview, item metadata, are rendered. If not defined,
|
|
350
|
+
* item details will be rendered using the default (built-in) renderer.
|
|
351
|
+
*/
|
|
352
|
+
itemDetailsRendererComponent?: React__default.ComponentType<{
|
|
353
|
+
item: TResult;
|
|
354
|
+
}>;
|
|
355
|
+
}
|
|
356
|
+
declare function DamSelectedItem({ selectedItem, onDeselect, onEditClosed, logoIcon, itemDetailsRendererComponent, }: DamSelectedItemProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
357
|
+
|
|
358
|
+
declare const damSelectedItemContainer: _emotion_react.SerializedStyles;
|
|
359
|
+
declare const damSelectedItemInner: _emotion_react.SerializedStyles;
|
|
360
|
+
declare const damSelectedItemDetails: _emotion_react.SerializedStyles;
|
|
361
|
+
declare const damSelectedItemCopy: _emotion_react.SerializedStyles;
|
|
362
|
+
declare const damSelectedItemTitle: _emotion_react.SerializedStyles;
|
|
363
|
+
declare const damSelectedItemIcon: _emotion_react.SerializedStyles;
|
|
364
|
+
declare const damSelectedItemPopover: _emotion_react.SerializedStyles;
|
|
365
|
+
declare const damSelectedItemSmallText: _emotion_react.SerializedStyles;
|
|
366
|
+
declare const damSelectedItemPopoverLabel: _emotion_react.SerializedStyles;
|
|
367
|
+
declare const damSelectedItemLinkContainer: _emotion_react.SerializedStyles;
|
|
368
|
+
declare const damSelectedItemLinkBtn: _emotion_react.SerializedStyles;
|
|
369
|
+
declare const damSelectedItemMediaContainer: _emotion_react.SerializedStyles;
|
|
370
|
+
declare const damSelectedItemInfoBtn: _emotion_react.SerializedStyles;
|
|
371
|
+
declare const damSelectItemImage: _emotion_react.SerializedStyles;
|
|
372
|
+
|
|
373
|
+
type MinimalDynamicInput = Omit<DynamicInput, 'source'>;
|
|
374
|
+
type MinimalDynamicInputs = Record<string, MinimalDynamicInput>;
|
|
375
|
+
type DataResourceDynamicInputProviderProps = {
|
|
376
|
+
/** Explicitly provide dynamic input values. If not set, Mesh location will be used */
|
|
377
|
+
dynamicInputs?: MinimalDynamicInputs;
|
|
378
|
+
/** Child components of the provider. Variables-using components, such as InputVariables, can be used here. */
|
|
379
|
+
children: ReactNode;
|
|
380
|
+
};
|
|
381
|
+
/**
|
|
382
|
+
* Wrapper for data resource locations. Provides read-only access to dynamic inputs as if they were variables,
|
|
383
|
+
* using variables-aware components (i.e. InputVariables). This simplifies building dynamic-input-aware editors,
|
|
384
|
+
* where a data resource variable could be a static value or bound to a dynamic input from the route (project map).
|
|
385
|
+
*/
|
|
386
|
+
declare function DataResourceDynamicInputProvider(props: DataResourceDynamicInputProviderProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Provides convenient access to the current Uniform Mesh location via React hook.
|
|
390
|
+
* Intended to be used within <MeshApp />.
|
|
391
|
+
*
|
|
392
|
+
* There are three primary ways to invoke this hook:
|
|
393
|
+
* 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`
|
|
394
|
+
* const location = useMeshLocation();
|
|
395
|
+
* if (location.type === 'paramType') { // location is now known to be a paramType }
|
|
396
|
+
* 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.
|
|
397
|
+
* const location = useMeshLocation('settings');
|
|
398
|
+
* 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.
|
|
399
|
+
* const location = useMeshLocation<'paramType', MyParamTypeValueType>();
|
|
400
|
+
*
|
|
401
|
+
* You can also combine (2) and (3) to get both explicit value typing and assertion of the location.
|
|
402
|
+
*/
|
|
403
|
+
declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLocationValue = unknown, TLocationSetValue = TLocationValue>(expectedLocation?: TLocationType): Omit<Extract<_uniformdev_mesh_sdk.DataSourceLocation, {
|
|
404
|
+
type: TLocationType;
|
|
405
|
+
}> | Extract<_uniformdev_mesh_sdk.DataTypeLocation, {
|
|
406
|
+
type: TLocationType;
|
|
407
|
+
}> | Extract<_uniformdev_mesh_sdk.DataResourceLocation, {
|
|
408
|
+
type: TLocationType;
|
|
409
|
+
}> | Extract<_uniformdev_mesh_sdk.ParamTypeLocation<TLocationValue, unknown, TLocationSetValue, unknown>, {
|
|
410
|
+
type: TLocationType;
|
|
411
|
+
}> | Extract<_uniformdev_mesh_sdk.ParamTypeConfigLocation<TLocationValue, unknown>, {
|
|
412
|
+
type: TLocationType;
|
|
413
|
+
}> | Extract<_uniformdev_mesh_sdk.SettingsLocation<TLocationValue>, {
|
|
414
|
+
type: TLocationType;
|
|
415
|
+
}>, "setValue"> & {
|
|
416
|
+
setValue: SetLocationValueDispatch<(Extract<_uniformdev_mesh_sdk.DataSourceLocation, {
|
|
417
|
+
type: TLocationType;
|
|
418
|
+
}> | Extract<_uniformdev_mesh_sdk.DataTypeLocation, {
|
|
419
|
+
type: TLocationType;
|
|
420
|
+
}> | Extract<_uniformdev_mesh_sdk.DataResourceLocation, {
|
|
421
|
+
type: TLocationType;
|
|
422
|
+
}> | Extract<_uniformdev_mesh_sdk.ParamTypeLocation<TLocationValue, unknown, TLocationSetValue, unknown>, {
|
|
423
|
+
type: TLocationType;
|
|
424
|
+
}> | Extract<_uniformdev_mesh_sdk.ParamTypeConfigLocation<TLocationValue, unknown>, {
|
|
425
|
+
type: TLocationType;
|
|
426
|
+
}> | Extract<_uniformdev_mesh_sdk.SettingsLocation<TLocationValue>, {
|
|
427
|
+
type: TLocationType;
|
|
428
|
+
}>)["value"], Parameters<(Extract<_uniformdev_mesh_sdk.DataSourceLocation, {
|
|
429
|
+
type: TLocationType;
|
|
430
|
+
}> | Extract<_uniformdev_mesh_sdk.DataTypeLocation, {
|
|
431
|
+
type: TLocationType;
|
|
432
|
+
}> | Extract<_uniformdev_mesh_sdk.DataResourceLocation, {
|
|
433
|
+
type: TLocationType;
|
|
434
|
+
}> | Extract<_uniformdev_mesh_sdk.ParamTypeLocation<TLocationValue, unknown, TLocationSetValue, unknown>, {
|
|
435
|
+
type: TLocationType;
|
|
436
|
+
}> | Extract<_uniformdev_mesh_sdk.ParamTypeConfigLocation<TLocationValue, unknown>, {
|
|
437
|
+
type: TLocationType;
|
|
438
|
+
}> | Extract<_uniformdev_mesh_sdk.SettingsLocation<TLocationValue>, {
|
|
439
|
+
type: TLocationType;
|
|
440
|
+
}>)["setValue"]>[0]>;
|
|
441
|
+
};
|
|
442
|
+
type SetLocationValueDispatch<TValue, TSetValue = TValue> = (dispatch: SetLocationValueFunction<TValue, TSetValue>) => Promise<void> | void;
|
|
443
|
+
type SetLocationValueFunction<TValue, TSetValue> = (previousValue: TValue) => DispatchResult<TSetValue>;
|
|
444
|
+
type DispatchResult<TSetValue> = {
|
|
445
|
+
options?: SetValueOptions;
|
|
446
|
+
newValue: TSetValue;
|
|
447
|
+
};
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* Updates the Lexical editor state automatically when a controlled value changes, effectively
|
|
451
|
+
* turning the Lexical editor into a controlled component.
|
|
452
|
+
*
|
|
453
|
+
* DO NOT USE THIS when actually editing with Lexical as it will cause performance problems.
|
|
454
|
+
* This is intended to be used:
|
|
455
|
+
* * To simplify a read-only "preview" editor, where the user can't edit the value
|
|
456
|
+
* * To sync an external state with the Lexical editor state under certain conditions (i.e. composer mounted, but editor hidden)
|
|
457
|
+
*/
|
|
458
|
+
declare function ControlledValuePlugin({ enabled, value, extraDependencies, }: {
|
|
459
|
+
/** Whether to enable the controlled value plugin. Defaults to false. The value is only controlled when set to true. */
|
|
460
|
+
enabled: boolean;
|
|
461
|
+
value: string | undefined | SerializedEditorState<SerializedLexicalNode>;
|
|
462
|
+
extraDependencies?: unknown[];
|
|
463
|
+
}): JSX.Element | null;
|
|
464
|
+
|
|
465
|
+
type SerializedVariableNode = Spread<{
|
|
466
|
+
reference: string;
|
|
467
|
+
type: 'variable';
|
|
468
|
+
version: 1;
|
|
469
|
+
}, SerializedLexicalNode>;
|
|
470
|
+
type VariableNodeState = {
|
|
471
|
+
/** Display name to show on the variable */
|
|
472
|
+
displayName: string;
|
|
473
|
+
/**
|
|
474
|
+
* Whether the variable reference is currently pointing to a known variable in the variables context
|
|
475
|
+
* Note that this is ignored if `isFresh` is true, which is set for the result of edits or insertions
|
|
476
|
+
* made after the editor has mounted (which we know are good and don't validate to prevent flicker or false errors)
|
|
477
|
+
*/
|
|
478
|
+
referenceIsValid: boolean;
|
|
479
|
+
/**
|
|
480
|
+
* Whether the variable node has been inserted or edited during this editing session
|
|
481
|
+
* Fresh nodes are always considered "valid" because they are the result of a user action
|
|
482
|
+
*/
|
|
483
|
+
isFresh: boolean;
|
|
484
|
+
/** Whether clicking the node has an effect (dispatching an edit event) */
|
|
485
|
+
hasClickEvent: boolean | undefined;
|
|
486
|
+
/** Tooltip of the node on hove */
|
|
487
|
+
tooltip: string | undefined;
|
|
488
|
+
};
|
|
489
|
+
/** Renders a variable reference node within a Lexical editor */
|
|
490
|
+
declare class VariableNode extends DecoratorNode<JSX.Element> {
|
|
491
|
+
reference: Readonly<string>;
|
|
492
|
+
private __state;
|
|
493
|
+
static getType(): string;
|
|
494
|
+
static clone(node: VariableNode): VariableNode;
|
|
495
|
+
/** Imports the node from serialized JSON (i.e. the data provided to the editor's initial state) */
|
|
496
|
+
static importJSON(serializedNode: SerializedVariableNode): VariableNode;
|
|
497
|
+
constructor(reference: Readonly<string>, state: VariableNodeState, key?: NodeKey);
|
|
498
|
+
/** Gets the node's current state */
|
|
499
|
+
getState(): VariableNodeState;
|
|
500
|
+
/**
|
|
501
|
+
* Updates the node's variables state so it knows its current validity, display name, etc
|
|
502
|
+
* The plugin updates this whenever the variables prop changes.
|
|
503
|
+
*/
|
|
504
|
+
setState(state: VariableNodeState): void;
|
|
505
|
+
/**
|
|
506
|
+
* Serializes the node to JSON for editor initial state
|
|
507
|
+
*/
|
|
508
|
+
exportJSON(): {
|
|
509
|
+
reference: string;
|
|
510
|
+
type: string;
|
|
511
|
+
version: number;
|
|
512
|
+
};
|
|
513
|
+
/**
|
|
514
|
+
* Copy variable to clipboard in a format we will read back if pasted
|
|
515
|
+
* (albeit it won't get the fancy chip-node)
|
|
516
|
+
*/
|
|
517
|
+
getTextContent(): string;
|
|
518
|
+
/** Creates the DOM wrapper that hosts the node */
|
|
519
|
+
createDOM(): HTMLSpanElement;
|
|
520
|
+
updateDOM(): boolean;
|
|
521
|
+
/**
|
|
522
|
+
* Render the variable node using React.
|
|
523
|
+
* NOTE: this is effectively an island of React, and you may not call hooks,
|
|
524
|
+
* rely on Context, etc in this renderer.
|
|
525
|
+
*/
|
|
526
|
+
decorate(editor: LexicalEditor): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
527
|
+
/** Enables keyboard navigation to hop over the node to previous text */
|
|
528
|
+
isIsolated(): boolean;
|
|
529
|
+
}
|
|
530
|
+
declare function $createVariableNode(variableReference: string, state: VariableNodeState): VariableNode;
|
|
531
|
+
declare function $isVariableNode(node: LexicalNode | null | undefined): node is VariableNode;
|
|
532
|
+
|
|
533
|
+
type MeshDataVariableDefinition = Omit<DataVariableDefinition, 'default'> & {
|
|
534
|
+
/** When used in code, variables may have non-string defaults */
|
|
535
|
+
default: unknown;
|
|
536
|
+
/**
|
|
537
|
+
* If true the variable will not be shown in variables listings and menus, but can still be resolved
|
|
538
|
+
* Useful for variables that are defined by their presence in a value, and disappear when deleted from the value,
|
|
539
|
+
* like bindings.
|
|
540
|
+
*/
|
|
541
|
+
ephemeral?: boolean;
|
|
542
|
+
/**
|
|
543
|
+
* Prevents editing the variable if set to true. If the variable context is set to read only,
|
|
544
|
+
* this is ignored and is always effectively true.
|
|
545
|
+
*/
|
|
546
|
+
readOnly?: boolean;
|
|
547
|
+
/**
|
|
548
|
+
* Tooltip for the variable when rendered in content UI.
|
|
549
|
+
* If not passed, defaults to helpText.
|
|
550
|
+
*/
|
|
551
|
+
tooltip?: string;
|
|
552
|
+
};
|
|
553
|
+
type DataVariableDefinitionWithName = {
|
|
554
|
+
name: string;
|
|
555
|
+
} & MeshDataVariableDefinition;
|
|
556
|
+
/**
|
|
557
|
+
* Converts variable definitions stored in a map into a flat list,
|
|
558
|
+
* respecting their `order` property if set, and sorting by display name otherwise.
|
|
559
|
+
*/
|
|
560
|
+
declare function variablesToList(variables: Record<string, MeshDataVariableDefinition> | undefined): Array<DataVariableDefinitionWithName>;
|
|
561
|
+
|
|
562
|
+
type VariableSourceGroup = {
|
|
563
|
+
name: string | undefined;
|
|
564
|
+
variables: Array<DataVariableDefinitionWithName>;
|
|
565
|
+
};
|
|
566
|
+
/**
|
|
567
|
+
* Groups variable definitions by their `source` property, and sorts the groups using `variablesToList`.
|
|
568
|
+
* Returns a flat list of groups and variables. Groups are sorted alphabetically.
|
|
569
|
+
*/
|
|
570
|
+
declare function variablesToGroupedList(variables: Record<string, MeshDataVariableDefinition> | undefined): Array<VariableSourceGroup>;
|
|
571
|
+
|
|
572
|
+
type EditVariableCommandArguments = {
|
|
573
|
+
/** Lexical node key that is being edited */
|
|
574
|
+
sourceKey: string | undefined;
|
|
575
|
+
/** The variable reference to edit */
|
|
576
|
+
reference: string;
|
|
577
|
+
};
|
|
578
|
+
type InsertVariableCommandArguments = {
|
|
579
|
+
reference: string;
|
|
580
|
+
/**
|
|
581
|
+
* Optionally pass in display name if you have it
|
|
582
|
+
* avoids a flash of the reference name
|
|
583
|
+
*/
|
|
584
|
+
initialDisplayName?: string;
|
|
585
|
+
/**
|
|
586
|
+
* If specified, the lexical node with this key is overwritten by the insert.
|
|
587
|
+
* If unspecified, the current selection is overwritten, or inserted to if a single location.
|
|
588
|
+
*/
|
|
589
|
+
targetKey: string | undefined;
|
|
590
|
+
};
|
|
591
|
+
/** Opens the variable editor for an existing variable node */
|
|
592
|
+
declare const EDIT_VARIABLE_COMMAND: lexical.LexicalCommand<EditVariableCommandArguments>;
|
|
593
|
+
/** Inserts a new variable node at the current selection, or replacing a specific node key */
|
|
594
|
+
declare const INSERT_VARIABLE_COMMAND: lexical.LexicalCommand<InsertVariableCommandArguments>;
|
|
595
|
+
type VariablesPluginProps<TEditorContext = unknown> = {
|
|
596
|
+
/** Disables adding variable references via autocomplete. Any existing variables will be rendered as variables. */
|
|
597
|
+
disableVariables?: boolean;
|
|
598
|
+
/** Enables 'add variable' option in autocomplete */
|
|
599
|
+
showAddVariableMenuOption?: boolean | string;
|
|
600
|
+
/** Enables clicking a variable reference to edit the variable */
|
|
601
|
+
enableEditingVariables?: boolean;
|
|
602
|
+
/** Computes the editor context when a variable is added or edited from this composer */
|
|
603
|
+
getEditorContext?: () => TEditorContext;
|
|
604
|
+
};
|
|
605
|
+
type UseVariablesMenuInput = Pick<VariablesPluginProps, 'showAddVariableMenuOption' | 'enableEditingVariables'>;
|
|
606
|
+
type OnVariableSelectInput = {
|
|
607
|
+
value: string;
|
|
608
|
+
queryString?: string;
|
|
609
|
+
nodeToReplace?: LexicalNode;
|
|
610
|
+
editor: LexicalEditor;
|
|
611
|
+
};
|
|
612
|
+
type UseVariablesMenu = (input: UseVariablesMenuInput) => {
|
|
613
|
+
groupedVariables: VariableSourceGroup[];
|
|
614
|
+
menuOptions: MenuOption[];
|
|
615
|
+
onSelect: (input: OnVariableSelectInput) => void;
|
|
616
|
+
};
|
|
617
|
+
/** Hook to use the lexical variables typeahead/dropdown menu */
|
|
618
|
+
declare const useVariablesMenu: UseVariablesMenu;
|
|
619
|
+
/**
|
|
620
|
+
* Enables variables auto-complete and reference management to a Lexical editor.
|
|
621
|
+
* Must also activate the VariableNode node to make this work.
|
|
622
|
+
*/
|
|
623
|
+
declare function VariablesPlugin<TEditorContext = unknown>({ disableVariables, showAddVariableMenuOption, enableEditingVariables, getEditorContext, }: VariablesPluginProps<TEditorContext>): JSX.Element | null;
|
|
624
|
+
|
|
625
|
+
type PasteTransformerPluginProps = {
|
|
626
|
+
/**
|
|
627
|
+
* Transforms pasted contents before inserting them.
|
|
628
|
+
* Return undefined to execute default paste behaviour, or a string to set the paste's contents.
|
|
629
|
+
*/
|
|
630
|
+
transformPaste?: (pastedText: string) => string | undefined;
|
|
631
|
+
};
|
|
632
|
+
|
|
633
|
+
type UseInputVariablesStateProps<TEditorContext = unknown> = {
|
|
634
|
+
/**
|
|
635
|
+
* Sets the value of the input
|
|
636
|
+
* NOTE: this is NOT reactive after mount
|
|
637
|
+
*/
|
|
638
|
+
value: string | undefined;
|
|
639
|
+
/** Callback to receive changes to the value of the variables input */
|
|
640
|
+
onChange: (newValue: string | undefined) => void;
|
|
641
|
+
/**
|
|
642
|
+
* The value to set the field to when it's "reset" from a variables-input to a custom component.
|
|
643
|
+
* Defaults to undefined.
|
|
644
|
+
*/
|
|
645
|
+
valueToResetTo?: string | undefined;
|
|
646
|
+
/** Disables using variables in the input */
|
|
647
|
+
disableVariables?: boolean;
|
|
648
|
+
/**
|
|
649
|
+
* Enables adding variables from the menu. If a string is passed,
|
|
650
|
+
* the option is enabled and the string is used as the menu label.
|
|
651
|
+
*/
|
|
652
|
+
showAddVariableMenuOption?: boolean | string;
|
|
653
|
+
/**
|
|
654
|
+
* When no variables are referenced in the value, and this prop is provided,
|
|
655
|
+
* the variables-injection input will be replaced with this component.
|
|
656
|
+
*
|
|
657
|
+
* NOTE: When this prop is provided, the and a variable is inserted, any existing value
|
|
658
|
+
* in the input will be replaced with the variable reference. Once in variables-mode, additional
|
|
659
|
+
* insertions are inserted at the current selection (or end) of the variables value.
|
|
660
|
+
*/
|
|
661
|
+
inputWhenNoVariables?: JSX.Element;
|
|
662
|
+
/** Computes the editor context when a variable is added or edited from this composer */
|
|
663
|
+
getEditorContext?: () => TEditorContext;
|
|
664
|
+
};
|
|
665
|
+
|
|
666
|
+
type InputVariablesProps<TEditorContext = unknown> = {
|
|
667
|
+
/** Sets a HTML ID for the variables input and label */
|
|
668
|
+
id?: string;
|
|
669
|
+
/** Enables a label for the input */
|
|
670
|
+
label?: string;
|
|
671
|
+
/** sets the input aria-label value. */
|
|
672
|
+
'aria-label'?: string;
|
|
673
|
+
/**
|
|
674
|
+
* Turns off the 'Reset' menu option that is added when:
|
|
675
|
+
* - inputWhenNoVariables is passed in
|
|
676
|
+
* - variables are, or have have been bound to
|
|
677
|
+
*
|
|
678
|
+
* The reset button returns the editor to the inputWithNoVariables state
|
|
679
|
+
*
|
|
680
|
+
* @deprecated this is ignored if passed, computation is now automatic
|
|
681
|
+
*/
|
|
682
|
+
disableReset?: boolean;
|
|
683
|
+
/** Enables mutliple lines in the input (\n in the value) */
|
|
684
|
+
multiLine?: boolean;
|
|
685
|
+
/** Disables the inline variable selection menu when rendering a variables input */
|
|
686
|
+
disableInlineMenu?: boolean;
|
|
687
|
+
/**
|
|
688
|
+
* Enables clicking a variable reference to edit the variable
|
|
689
|
+
* Note: automatically disabled if `disabled` or `disableVariables` is set
|
|
690
|
+
*/
|
|
691
|
+
enableEditingVariables?: boolean;
|
|
692
|
+
/** (optional) sets and shows the the error message value */
|
|
693
|
+
errorMessage?: string;
|
|
694
|
+
/** (optional) sets and shows the the warning message value */
|
|
695
|
+
warningMessage?: string;
|
|
696
|
+
/** (optional) sets and shows the the info message value */
|
|
697
|
+
infoMessage?: string;
|
|
698
|
+
/** (optional) sets caption text value */
|
|
699
|
+
caption?: string;
|
|
700
|
+
/** Disables editing the value of the input, editing variables, and adding variables */
|
|
701
|
+
disabled?: boolean;
|
|
702
|
+
/** Sets the test ID of the input */
|
|
703
|
+
'data-test-id'?: string;
|
|
704
|
+
/**
|
|
705
|
+
* Optional ref to get a handle to the variables editor.
|
|
706
|
+
* This can be useful for situations such as:
|
|
707
|
+
* * Once initially set, `value` prop is no longer reactive and the editor owns its state. The ref can be used to set the editor state after load.
|
|
708
|
+
* * Performing other custom mutations to the variables editor, such as inserting text from a button click.
|
|
709
|
+
*/
|
|
710
|
+
editorRef?: MutableRefObject<LexicalEditor | null>;
|
|
711
|
+
} & PasteTransformerPluginProps & UseInputVariablesStateProps<TEditorContext>;
|
|
712
|
+
/**
|
|
713
|
+
* An input box that enables insertion of 'variables', provided by VariablesProvider,
|
|
714
|
+
* into its value.
|
|
715
|
+
*/
|
|
716
|
+
declare function InputVariables<TEditorContext = unknown>(props: InputVariablesProps<TEditorContext>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
717
|
+
|
|
718
|
+
type ParameterConnectionIndicatorProps = {
|
|
719
|
+
disabled?: boolean;
|
|
720
|
+
value: unknown;
|
|
721
|
+
children: ReactNode;
|
|
722
|
+
menuOptions: ReactNode;
|
|
723
|
+
};
|
|
724
|
+
/**
|
|
725
|
+
* An input box that enables insertion of 'variables', provided by VariablesProvider,
|
|
726
|
+
* into its value. Designed specifically for use in the Canvas Parameter Editor.
|
|
727
|
+
*/
|
|
728
|
+
declare function ParameterConnectionIndicator({ children, value, menuOptions, disabled, }: ParameterConnectionIndicatorProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
729
|
+
|
|
730
|
+
type ParameterOrSingleVariableProps<TEditorContext = unknown> = {
|
|
731
|
+
disabled?: boolean;
|
|
732
|
+
inputWhenNoVariables: JSX.Element;
|
|
733
|
+
enableEditingVariables?: boolean;
|
|
734
|
+
} & Omit<UseInputVariablesStateProps<TEditorContext>, 'inputWhenNoVariables'>;
|
|
735
|
+
/**
|
|
736
|
+
* A parameter which can be one of a custom parameter editor (`inputWhenNoVariables`),
|
|
737
|
+
* or one single variable value (not multiple). Use for parameters which can only have one variable value,
|
|
738
|
+
* possibly because they bind to objects or arrays.
|
|
739
|
+
* Designed visually for use in the Canvas Parameter Editor.
|
|
740
|
+
*/
|
|
741
|
+
declare function ParameterOrSingleVariable<TEditorContext = unknown>(props: ParameterOrSingleVariableProps<TEditorContext>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
742
|
+
|
|
743
|
+
type ParameterVariablesProps<TEditorContext = unknown> = {
|
|
744
|
+
/** sets the input aria-label value. */
|
|
745
|
+
'aria-label'?: string;
|
|
746
|
+
/** Sets the test ID of the input */
|
|
747
|
+
'data-test-id'?: string;
|
|
748
|
+
/**
|
|
749
|
+
* Enables mutliple lines in the input (\n in the value).
|
|
750
|
+
* If a number is passed, the height of the editor is set to that number of lines and overflow scrolls.
|
|
751
|
+
* If a boolean true is passed, the editor auto-sizes to the content.
|
|
752
|
+
*/
|
|
753
|
+
multiLine?: boolean | number;
|
|
754
|
+
/** Disables editing the value of the input, editing variables, and adding variables */
|
|
755
|
+
disabled?: boolean;
|
|
756
|
+
/**
|
|
757
|
+
* Optional ref to get a handle to the variables editor.
|
|
758
|
+
* This can be useful for situations such as:
|
|
759
|
+
* * Once initially set, `value` prop is no longer reactive and the editor owns its state. The ref can be used to set the editor state after load.
|
|
760
|
+
* * Performing other custom mutations to the variables editor, such as inserting text from a button click.
|
|
761
|
+
*/
|
|
762
|
+
editorRef?: MutableRefObject<LexicalEditor | null>;
|
|
763
|
+
} & UseInputVariablesStateProps<TEditorContext>;
|
|
764
|
+
/**
|
|
765
|
+
* An input box that enables insertion of 'variables', provided by VariablesProvider,
|
|
766
|
+
* into its value. Designed visually for use in the Canvas Parameter Editor.
|
|
767
|
+
*/
|
|
768
|
+
declare function ParameterVariables<TEditorContext = unknown>(props: ParameterVariablesProps<TEditorContext>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
769
|
+
|
|
770
|
+
type VariableEditorProps<TEditorContext = unknown> = {
|
|
771
|
+
variable: string;
|
|
772
|
+
onSubmit: (values: DataVariableDefinitionWithName) => void | Promise<void>;
|
|
773
|
+
/** Disables the tip about Mesh integrations. Intended for use when this is placed on a custom Mesh integration to edit variables. */
|
|
774
|
+
disableMeshTip?: boolean;
|
|
775
|
+
onCancel: () => void;
|
|
776
|
+
context: TEditorContext | undefined;
|
|
777
|
+
};
|
|
778
|
+
declare function VariableEditor({ variable, onSubmit, onCancel, disableMeshTip }: VariableEditorProps<any>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
779
|
+
|
|
780
|
+
type VariablesProviderProps<TEditVariableContext = unknown> = React$1.PropsWithChildren<{
|
|
781
|
+
/**
|
|
782
|
+
* Signals that components in this variables context are not intended to allow mutation
|
|
783
|
+
* of the variable values (i.e. editing, adding, or deleting variable definitions).
|
|
784
|
+
*
|
|
785
|
+
* Dispatching updates is still accepted, but will be ignored.
|
|
786
|
+
*/
|
|
787
|
+
readOnly?: boolean;
|
|
788
|
+
/** Variable values to load into the context */
|
|
789
|
+
value: Record<string, MeshDataVariableDefinition>;
|
|
790
|
+
/** Function to handle mutations to the variable values (optional when readOnly is true) */
|
|
791
|
+
onChange?: (newValue: Record<string, MeshDataVariableDefinition>) => void;
|
|
792
|
+
/**
|
|
793
|
+
* Provide a component to handle editing a variable definition (e.g. a modal wrapper)
|
|
794
|
+
* If not passed, the editor will be rendered inline, with potentially strange results.
|
|
795
|
+
*/
|
|
796
|
+
editVariableComponent?: React$1.ComponentType<VariableEditorProps<TEditVariableContext>>;
|
|
797
|
+
}>;
|
|
798
|
+
type VariablesAction<TEditVariableContext> = {
|
|
799
|
+
type: 'edit';
|
|
800
|
+
variable: string;
|
|
801
|
+
/** Context that will be passed in a prop to the variables context editing component */
|
|
802
|
+
context?: TEditVariableContext;
|
|
803
|
+
} | {
|
|
804
|
+
type: 'remove';
|
|
805
|
+
variable: string;
|
|
806
|
+
} | {
|
|
807
|
+
type: 'set';
|
|
808
|
+
variable: DataVariableDefinitionWithName;
|
|
809
|
+
openEditor?: boolean;
|
|
810
|
+
/** Context that will be passed in a prop to the variables context editing component. Only has an effect when openEditor = true */
|
|
811
|
+
context?: TEditVariableContext;
|
|
812
|
+
} | {
|
|
813
|
+
type: 'reorder';
|
|
814
|
+
result: Record<string, DataVariableDefinitionWithName>;
|
|
815
|
+
} | {
|
|
816
|
+
type: 'cancelEdit';
|
|
817
|
+
};
|
|
818
|
+
type VariablesUpdateEvent = {
|
|
819
|
+
name: string;
|
|
820
|
+
latestValue: Record<string, MeshDataVariableDefinition>;
|
|
821
|
+
};
|
|
822
|
+
type VariablesEvents = {
|
|
823
|
+
update: VariablesUpdateEvent;
|
|
824
|
+
};
|
|
825
|
+
type VariablesContext<TEditVariableContext> = {
|
|
826
|
+
/**
|
|
827
|
+
* Signals that components in this variables context are not intended to allow mutation
|
|
828
|
+
* of the variable values (i.e. editing, adding, or deleting variable definitions).
|
|
829
|
+
*
|
|
830
|
+
* Dispatching updates is still accepted, but will be ignored.
|
|
831
|
+
*/
|
|
832
|
+
readOnly?: boolean;
|
|
833
|
+
/** Dispatch update events to the variables */
|
|
834
|
+
dispatch: (event: VariablesAction<TEditVariableContext>) => void;
|
|
835
|
+
/** The current variables value */
|
|
836
|
+
variables: Readonly<Record<string, MeshDataVariableDefinition>>;
|
|
837
|
+
/** Whether the context is editing a variable value currently */
|
|
838
|
+
isEditing: boolean;
|
|
839
|
+
/** Add event handles (don't forget to unhook) */
|
|
840
|
+
events: Emitter<VariablesEvents>;
|
|
841
|
+
/** Whether the context is backed by a provider, or is just a readonly fake */
|
|
842
|
+
canDispatch: boolean;
|
|
843
|
+
/**
|
|
844
|
+
* A flattened version of `variables` that is a plain key-value object.
|
|
845
|
+
* Used when binding the variables to a value.
|
|
846
|
+
*/
|
|
847
|
+
flatVariables: Readonly<Record<string, unknown>>;
|
|
848
|
+
};
|
|
849
|
+
declare function VariablesProvider<TEditComponentContext = never>({ value, onChange, editVariableComponent, readOnly, children, }: VariablesProviderProps<TEditComponentContext>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
850
|
+
declare function useVariables<TEditComponentContext = unknown>(returnEmptyWithoutProvider?: boolean): VariablesContext<TEditComponentContext>;
|
|
851
|
+
|
|
852
|
+
declare function useOnVariableUpdated(fn: (event: VariablesUpdateEvent) => void, disabled?: boolean): void;
|
|
853
|
+
|
|
854
|
+
/** Converts a connected data map entry to a VariablesProvider-format variable */
|
|
855
|
+
declare function convertConnectedDataToVariable(bindExpression: string, value: unknown): MeshDataVariableDefinition;
|
|
856
|
+
|
|
857
|
+
declare function deserializeVariablesEditorState(serialized: string | undefined): string;
|
|
858
|
+
|
|
859
|
+
declare function prettifyBindExpression(bindExpression: string): string;
|
|
860
|
+
|
|
861
|
+
/**
|
|
862
|
+
* Serializes a Lexical variables-editor state (as a Lexical AST) to a Uniform-variable-reference formatted string
|
|
863
|
+
* Note: if no content is in the editor state, undefined will be returned.
|
|
864
|
+
*/
|
|
865
|
+
declare function serializeVariablesEditorState(editorState: EditorState): string | undefined;
|
|
866
|
+
|
|
867
|
+
declare function variableDefaultTextValue(defaultValue: unknown): string;
|
|
868
|
+
|
|
869
|
+
/**
|
|
870
|
+
* Expected prefix for variable expressions
|
|
871
|
+
* @deprecated
|
|
872
|
+
*/
|
|
873
|
+
declare const variablePrefix = "${";
|
|
874
|
+
/**
|
|
875
|
+
* Expected suffix for variable expressions
|
|
876
|
+
* @deprecated
|
|
877
|
+
*/
|
|
878
|
+
declare const variableSuffix = "}";
|
|
879
|
+
|
|
880
|
+
declare function VariablesList(): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
881
|
+
|
|
882
|
+
type DataResourceVariablesListProps = {
|
|
883
|
+
/**
|
|
884
|
+
* Overrides rendering of a variable based on the `type` property it has set on it.
|
|
885
|
+
* If this is not passed, all variables are rendered using TextVariableRenderer.
|
|
886
|
+
*/
|
|
887
|
+
typeRenderers?: Record<string, ComponentType<DataResourceVariableRendererProps> | undefined>;
|
|
888
|
+
/**
|
|
889
|
+
* Callback when the state changes in the data resource variables.
|
|
890
|
+
* Can be sent directly to `useMeshLocation`'s `setValue` or intercepted for validation
|
|
891
|
+
* by `createLocationValidator`.
|
|
892
|
+
*/
|
|
893
|
+
setVariables: SetLocationValueDispatch<DataResourceVariables>;
|
|
894
|
+
/**
|
|
895
|
+
* Component that is rendered if no variables are set on the data resource.
|
|
896
|
+
* Defaults to a callout stating that no settings are required.
|
|
897
|
+
*/
|
|
898
|
+
noVariables?: ComponentType;
|
|
899
|
+
};
|
|
900
|
+
/**
|
|
901
|
+
* Renders a list of Data Type-provided variables that can be set on a Data Resource.
|
|
902
|
+
* Intended to provide a solid base for data resource editors that need to edit a list of variables.
|
|
903
|
+
* Using the optional `type` attribute of variables, one can use custom components to render different
|
|
904
|
+
* variables using this component, enabling flexibility for more than just text inputs.
|
|
905
|
+
*/
|
|
906
|
+
declare function DataResourceVariablesList(props: DataResourceVariablesListProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
907
|
+
/**
|
|
908
|
+
* Renders a list of Data Type-provided variables that can be set on a Data Resource.
|
|
909
|
+
*
|
|
910
|
+
* This is a version of DataResourceVariablesList that does not use any Mesh context data.
|
|
911
|
+
* For most uses you will want to use DataResourceVariablesList instead.
|
|
912
|
+
*/
|
|
913
|
+
declare function DataResourceVariablesListExplicit({ setVariables, noVariables: NoVariablesComponent, typeRenderers, dataType, dynamicInputs, value, }: DataResourceVariablesListProps & {
|
|
914
|
+
value: DataResourceVariables;
|
|
915
|
+
dataType: DataType;
|
|
916
|
+
dynamicInputs: DynamicInputs;
|
|
917
|
+
}): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
918
|
+
type DataResourceVariableRendererProps = {
|
|
919
|
+
/** Current value of the variable on the data resource */
|
|
920
|
+
value: string | undefined;
|
|
921
|
+
/** Updates the value of the variable on the data resource */
|
|
922
|
+
setValue: (newValue: string | undefined) => void;
|
|
923
|
+
/** The definition of the data variable */
|
|
924
|
+
definition: DataVariableDefinitionWithName;
|
|
925
|
+
};
|
|
926
|
+
/** Default data resource variable renderer, uses a text input that supports dynamic input binding */
|
|
927
|
+
declare function TextVariableRenderer({ definition, value, setValue }: DataResourceVariableRendererProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
928
|
+
|
|
929
|
+
type DataSourceEditorProps = PropsWithChildren<{
|
|
930
|
+
/**
|
|
931
|
+
* Callback when the state changes in the request or variables contexts.
|
|
932
|
+
* Can be sent directly to `useMeshLocation`'s `setValue` or intercepted for validation
|
|
933
|
+
* by `createLocationValidator`.
|
|
934
|
+
*/
|
|
935
|
+
onChange: SetLocationValueDispatch<DataSourceLocationValue>;
|
|
936
|
+
} & Pick<VariablesProviderProps, 'editVariableComponent'>>;
|
|
937
|
+
/**
|
|
938
|
+
* Wrapper for editing a data source using Uniform Mesh SDK components that rely on `useRequest()`
|
|
939
|
+
* or `useVariables()`, or custom components that use the same hooks.
|
|
940
|
+
*/
|
|
941
|
+
declare function DataSourceEditor({ onChange, children, editVariableComponent }: DataSourceEditorProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
942
|
+
|
|
943
|
+
type DataTypeEditorProps = PropsWithChildren<{
|
|
944
|
+
/**
|
|
945
|
+
* Callback when the state changes in the request or variables contexts.
|
|
946
|
+
* Can be sent directly to `useMeshLocation`'s `setValue` or intercepted for validation
|
|
947
|
+
* by `createLocationValidator`.
|
|
948
|
+
*/
|
|
949
|
+
onChange: SetLocationValueDispatch<DataTypeLocationValue>;
|
|
950
|
+
} & Pick<VariablesProviderProps, 'editVariableComponent'>>;
|
|
951
|
+
/**
|
|
952
|
+
* Wrapper for editing a data type using Uniform Mesh SDK components that rely on `useRequest()`
|
|
953
|
+
* or `useVariables()`, or custom components that use the same hooks.
|
|
954
|
+
*/
|
|
955
|
+
declare function DataTypeEditor({ onChange, children, editVariableComponent }: DataTypeEditorProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
956
|
+
|
|
957
|
+
type MeshAppProps = {
|
|
958
|
+
loadingComponent?: React__default.ComponentType;
|
|
959
|
+
errorComponent?: React__default.ComponentType<{
|
|
960
|
+
error: Error;
|
|
961
|
+
}>;
|
|
962
|
+
};
|
|
963
|
+
declare const MeshApp: React__default.FC<React__default.PropsWithChildren<MeshAppProps>>;
|
|
964
|
+
|
|
965
|
+
type DataRefreshButtonProps = HTMLAttributes<HTMLButtonElement> & {
|
|
966
|
+
/** sets the button text */
|
|
967
|
+
buttonText: string;
|
|
968
|
+
/** shows or hides the loading indicator when retrieving data */
|
|
969
|
+
isLoading: boolean;
|
|
970
|
+
/** sets the onClick function */
|
|
971
|
+
onRefreshData: () => void;
|
|
972
|
+
};
|
|
973
|
+
/**
|
|
974
|
+
* @description The data refresh button is a UI component to indicate to users a request for data is taking place
|
|
975
|
+
* @example <DataRefreshButton buttonText="my button" isLoading /> */
|
|
976
|
+
declare const DataRefreshButton: ({ buttonText, isLoading, onRefreshData, ...props }: DataRefreshButtonProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
977
|
+
|
|
978
|
+
type ObjectSearchContainerProps = {
|
|
979
|
+
/**
|
|
980
|
+
* Adds a label to the search container.
|
|
981
|
+
*/
|
|
982
|
+
label?: string;
|
|
983
|
+
/**
|
|
984
|
+
* Enables a dynamic input connect button to connect a dynamic input to the selected result ID
|
|
985
|
+
* Prerequisites:
|
|
986
|
+
* - label must be set
|
|
987
|
+
* - wrapped in DataResourceDynamicInputProvider
|
|
988
|
+
*/
|
|
989
|
+
enableDynamicInputToResultId?: boolean;
|
|
990
|
+
/** a child node that places components within the search location */
|
|
991
|
+
searchFilters: ReactNode;
|
|
992
|
+
/** a child node that places components within a scrollable list location */
|
|
993
|
+
resultList?: ReactNode;
|
|
994
|
+
/** allows any child element */
|
|
995
|
+
children?: ReactNode;
|
|
996
|
+
};
|
|
997
|
+
/**
|
|
998
|
+
* @description Object search container is an opinionated layout for search parameters and retrieved results
|
|
999
|
+
* @example <ObjectSearchContainer searchFilters={<>your component</>} resultList={<>your result list component<>} onSave={yourSaveAction} onCancel={yourCancelAction} /> */
|
|
1000
|
+
declare const ObjectSearchContainer: ({ label, enableDynamicInputToResultId, searchFilters, resultList, children, }: ObjectSearchContainerProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1001
|
+
|
|
1002
|
+
type ObjectSearchFilterProps = {
|
|
1003
|
+
/** shows or hides the required content type select option */
|
|
1004
|
+
requireContentType?: boolean;
|
|
1005
|
+
/** sets the text for the required content type select option
|
|
1006
|
+
* @default 'All content types'
|
|
1007
|
+
*/
|
|
1008
|
+
typeSelectorAllTypesOptionText?: string;
|
|
1009
|
+
/** sets the select input value label text
|
|
1010
|
+
* @default 'Content Type Select'
|
|
1011
|
+
*/
|
|
1012
|
+
selectLabel?: string;
|
|
1013
|
+
/** sets the select input options */
|
|
1014
|
+
selectOptions: Array<{
|
|
1015
|
+
id: string;
|
|
1016
|
+
name?: string;
|
|
1017
|
+
label: string;
|
|
1018
|
+
}>;
|
|
1019
|
+
/** sets the search input name value
|
|
1020
|
+
* @default 'searchText'
|
|
1021
|
+
*/
|
|
1022
|
+
searchInputName?: string;
|
|
1023
|
+
/** sets the search input placeholder text
|
|
1024
|
+
* @default 'Enter keyword to narrow your results'
|
|
1025
|
+
*/
|
|
1026
|
+
searchInputPlaceholderText?: string;
|
|
1027
|
+
};
|
|
1028
|
+
/**
|
|
1029
|
+
* @description Object search filter is an opinionated filter that has pre-defined query and setQuery functions
|
|
1030
|
+
* that can be extended with custom fuctions
|
|
1031
|
+
* @example <ObjectSearchFilter selectOptions={[{ id: 'id value', name: 'name value'}]} /> */
|
|
1032
|
+
declare const ObjectSearchFilter: ({ requireContentType, typeSelectorAllTypesOptionText, searchInputName, searchInputPlaceholderText, selectLabel, selectOptions, }: ObjectSearchFilterProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1033
|
+
|
|
1034
|
+
type ObjectSearchFilterContainerProps = {
|
|
1035
|
+
/**
|
|
1036
|
+
* sets the title for the container
|
|
1037
|
+
* @deprecated we recommend setting the label on ObjectSearchContainer instead
|
|
1038
|
+
*/
|
|
1039
|
+
label?: string;
|
|
1040
|
+
/** sets child components in an opinionated layout */
|
|
1041
|
+
children?: React.ReactNode;
|
|
1042
|
+
};
|
|
1043
|
+
/**
|
|
1044
|
+
* @description an opinionated layout for search filters
|
|
1045
|
+
* @example <ObjectSearchFilterContainer label="my label"><input type="text" aria-label="my input" /></ObjectSearchFilterContainer>
|
|
1046
|
+
*/
|
|
1047
|
+
declare const ObjectSearchFilterContainer: ({ label, children }: ObjectSearchFilterContainerProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1048
|
+
|
|
1049
|
+
type SearchQueryProps<TExtraFilters = unknown> = {
|
|
1050
|
+
/** sets the content type in the search context */
|
|
1051
|
+
contentType?: string;
|
|
1052
|
+
/** sets the keyword search in the search context */
|
|
1053
|
+
keyword?: string;
|
|
1054
|
+
} & TExtraFilters;
|
|
1055
|
+
type SelectedItemProps<TExtraProps = unknown> = {
|
|
1056
|
+
/** sets the id value */
|
|
1057
|
+
id: string;
|
|
1058
|
+
/** sets the title value */
|
|
1059
|
+
title: string;
|
|
1060
|
+
/**
|
|
1061
|
+
* sets the name value, sometimes used for products
|
|
1062
|
+
* @deprecated use title instead
|
|
1063
|
+
*/
|
|
1064
|
+
name?: string;
|
|
1065
|
+
/**
|
|
1066
|
+
* sets the subtitle value
|
|
1067
|
+
* @deprecated this is unused
|
|
1068
|
+
*/
|
|
1069
|
+
subtitle?: string;
|
|
1070
|
+
/** sets the content type value */
|
|
1071
|
+
contentType?: string | string[];
|
|
1072
|
+
/** sets the created date value using TimeAgo to transform the date */
|
|
1073
|
+
createdAt?: TDate;
|
|
1074
|
+
/** sets the image src */
|
|
1075
|
+
imageUrl?: string;
|
|
1076
|
+
/** sets the link icon */
|
|
1077
|
+
editLinkIcon?: string | React.ComponentType<{
|
|
1078
|
+
className?: string;
|
|
1079
|
+
}>;
|
|
1080
|
+
/** sets the link href value to an external source */
|
|
1081
|
+
editLink?: string;
|
|
1082
|
+
/** sets the published date value using TimeAgo to transform the date */
|
|
1083
|
+
publishedAt?: TDate;
|
|
1084
|
+
/** sets the publish status */
|
|
1085
|
+
publishStatus?: {
|
|
1086
|
+
/** sets the text value of the publish badge */
|
|
1087
|
+
text: string;
|
|
1088
|
+
/** sets the theme value of the publish badge
|
|
1089
|
+
* @default 'unimportant'
|
|
1090
|
+
*/
|
|
1091
|
+
theme?: BadgeThemeProps;
|
|
1092
|
+
};
|
|
1093
|
+
/** sets any additional meta data */
|
|
1094
|
+
metadata?: Record<string, string>;
|
|
1095
|
+
/** allows for child react elements to be nested in the popover */
|
|
1096
|
+
popoverData?: ReactNode;
|
|
1097
|
+
/** disable or enable drag and drop functionality */
|
|
1098
|
+
disableDnD?: boolean;
|
|
1099
|
+
} & TExtraProps;
|
|
1100
|
+
type ItemListProps<TListItemExtraProps = unknown> = {
|
|
1101
|
+
items?: Array<SelectedItemProps<TListItemExtraProps>>;
|
|
1102
|
+
};
|
|
1103
|
+
type ObjectSearchContextProps<TExtraFilters = unknown, TExtraItemProps = unknown> = {
|
|
1104
|
+
/** function that updates / sets the search query state */
|
|
1105
|
+
onSetQuery: (value: SearchQueryProps<TExtraFilters>) => void;
|
|
1106
|
+
/** current search query state */
|
|
1107
|
+
query: SearchQueryProps<TExtraFilters>;
|
|
1108
|
+
/**
|
|
1109
|
+
* When dynamic inputs are used, this is the query with any dynamic input values expanded
|
|
1110
|
+
* This is the value you'd want to send to a query endpoint to fetch; `query` will possibly
|
|
1111
|
+
* have dynamic input values that haven't been expanded yet.
|
|
1112
|
+
*/
|
|
1113
|
+
boundQuery: SearchQueryProps<TExtraFilters>;
|
|
1114
|
+
/** function that sets the selected items to state */
|
|
1115
|
+
onSelectItem: (selectedResult: SelectedItemProps<TExtraItemProps> | Array<SelectedItemProps<TExtraItemProps>>) => void;
|
|
1116
|
+
/** function that clears all selected items from state */
|
|
1117
|
+
onRemoveAllSelectedItems: () => void;
|
|
1118
|
+
/** current selected items in state */
|
|
1119
|
+
selectedListItems: Array<SelectedItemProps<TExtraItemProps>>;
|
|
1120
|
+
/** current list of results in state */
|
|
1121
|
+
list: ItemListProps<TExtraItemProps>;
|
|
1122
|
+
/** function that sets the list of items to state */
|
|
1123
|
+
onSetList: (value: ItemListProps) => void;
|
|
1124
|
+
};
|
|
1125
|
+
type ObjectSearchProviderProps = {
|
|
1126
|
+
children: ReactNode;
|
|
1127
|
+
currentlySelectedItems?: Array<SelectedItemProps>;
|
|
1128
|
+
};
|
|
1129
|
+
declare const ObjectSearchProvider: ({ currentlySelectedItems, children }: ObjectSearchProviderProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1130
|
+
declare function useObjectSearchContext<TExtraSearchFilters = unknown, TExtraItemProps = unknown>(): ObjectSearchContextProps<TExtraSearchFilters, TExtraItemProps>;
|
|
1131
|
+
|
|
1132
|
+
type ObjectSearchListItemProps = SelectedItemProps & {
|
|
1133
|
+
/** sets the content type value, this is normally used for subtitles e.g. Kitchens */
|
|
1134
|
+
contentType?: string | string[];
|
|
1135
|
+
/** sets image parameters */
|
|
1136
|
+
image?: {
|
|
1137
|
+
/** sets the src valuue */
|
|
1138
|
+
src: string;
|
|
1139
|
+
/** sets the alt text value */
|
|
1140
|
+
alt: string;
|
|
1141
|
+
/** set the width attribute of the image
|
|
1142
|
+
* if both width and height are set the image loading attribute is set to `lazy`
|
|
1143
|
+
*/
|
|
1144
|
+
width?: number;
|
|
1145
|
+
/** set the height attribute of the image
|
|
1146
|
+
* if both width and height are set the image loading attribute is set to `lazy`
|
|
1147
|
+
*/
|
|
1148
|
+
height?: number;
|
|
1149
|
+
};
|
|
1150
|
+
/** sets the function call on the role="button" wrapping element */
|
|
1151
|
+
onSelect?: (data?: Record<string, unknown>) => void;
|
|
1152
|
+
/** allows child components within the popover data */
|
|
1153
|
+
popoverData?: React$1.ReactNode;
|
|
1154
|
+
/** allows authors to add any child component that is not controlled by Uniform */
|
|
1155
|
+
children?: React$1.ReactNode;
|
|
1156
|
+
/** sets whether multiple entries can be added to the results list context
|
|
1157
|
+
* @default false
|
|
1158
|
+
*/
|
|
1159
|
+
isMulti?: boolean;
|
|
1160
|
+
/** sets disabled state to the interactive element */
|
|
1161
|
+
disabled?: boolean;
|
|
1162
|
+
};
|
|
1163
|
+
/**
|
|
1164
|
+
* @description entry search list item is an opinionated UI component best used for initial retrieved results
|
|
1165
|
+
* @example <ObjectSearchListItem id="my-result-item" title="title" popoverData={<p>some data info</p>}><div>example of uncontrolled content</div></ObjectSearchListItem> */
|
|
1166
|
+
declare const ObjectSearchListItem: ({ id, title, contentType, image, popoverData, onSelect, isMulti, disabled, children, }: ObjectSearchListItemProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1167
|
+
/**
|
|
1168
|
+
* An opinionated loading skeleton component best used with ObjectSearchListItem
|
|
1169
|
+
* @example <ObjectSearchListItemLoadingSkeleton />
|
|
1170
|
+
*/
|
|
1171
|
+
declare const ObjectSearchListItemLoadingSkeleton: () => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1172
|
+
|
|
1173
|
+
type ObjectSearchResultItemProps = SelectedItemProps & {
|
|
1174
|
+
/** sets additional remove functionality onto of default removal */
|
|
1175
|
+
onRemove?: () => void;
|
|
1176
|
+
/** sets whether to show or hide the remove button
|
|
1177
|
+
* @default false
|
|
1178
|
+
*/
|
|
1179
|
+
hideRemoveButton?: boolean;
|
|
1180
|
+
/** sets user defined child nodes that are uncontrolled by Uniform */
|
|
1181
|
+
children?: ReactNode;
|
|
1182
|
+
/** disable or enable drag and drop functionality
|
|
1183
|
+
* @default false
|
|
1184
|
+
*/
|
|
1185
|
+
disableDnD?: boolean;
|
|
1186
|
+
};
|
|
1187
|
+
/**
|
|
1188
|
+
* @description An opinionated result item, best used for selected results
|
|
1189
|
+
* @example <ObjectSearchResultItem id="my-result" title="title" />
|
|
1190
|
+
*/
|
|
1191
|
+
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;
|
|
1192
|
+
|
|
1193
|
+
type ObjectSearchResultItemButtonProps<THtml extends HTMLAttributes<HTMLElement> = HTMLAttributes<HTMLButtonElement>> = {
|
|
1194
|
+
/** sets the button or link text value */
|
|
1195
|
+
text: string;
|
|
1196
|
+
/** sets the button or link icon */
|
|
1197
|
+
icon?: string | React.ComponentType<{
|
|
1198
|
+
className?: string;
|
|
1199
|
+
}>;
|
|
1200
|
+
} & THtml;
|
|
1201
|
+
/**
|
|
1202
|
+
* @description An opinionated button component best used within the ObjectSearchResultItem component
|
|
1203
|
+
* @example <ObjectSearchResultItemButton text="button text" icon="/my-image.png" onClick={() => myFunction()} />
|
|
1204
|
+
*/
|
|
1205
|
+
declare const ObjectSearchResultItemButton: ({ text, icon, ...props }: ObjectSearchResultItemButtonProps<HTMLAttributes<HTMLButtonElement>>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1206
|
+
/**
|
|
1207
|
+
* @description An opinionated link component styled the same of the ObjectSearchResultItemButton component,
|
|
1208
|
+
* that automatically sets the target and rel attributes. Best used within the ObjectSearchResultItem component
|
|
1209
|
+
* @example <LinkButton text="link text" icon="/my-image.png" />
|
|
1210
|
+
*/
|
|
1211
|
+
declare const LinkButton: ({ text, icon, ...props }: ObjectSearchResultItemButtonProps<Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'target' | 'rel'>>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1212
|
+
|
|
1213
|
+
type ObjectSearchResultListProps<TRenderComponent extends SelectedItemProps = SelectedItemProps> = {
|
|
1214
|
+
/** sets the result label value
|
|
1215
|
+
* @default 'Selected'
|
|
1216
|
+
*/
|
|
1217
|
+
resultLabelText?: string;
|
|
1218
|
+
/** sets the on remove button click action */
|
|
1219
|
+
onRemoveAllSelected?: () => void;
|
|
1220
|
+
/** sets the remove button text
|
|
1221
|
+
* @default 'Remove all'
|
|
1222
|
+
*/
|
|
1223
|
+
removeButtonText?: string;
|
|
1224
|
+
/** sets whether to show or hide the remove button
|
|
1225
|
+
* @default false
|
|
1226
|
+
*/
|
|
1227
|
+
hideRemoveButton?: boolean;
|
|
1228
|
+
/** allows additional buttons to be added to the result title group */
|
|
1229
|
+
additionalButtons?: React.ReactNode;
|
|
1230
|
+
/** allows placing child components within the result list area */
|
|
1231
|
+
renderResultComponent?: (value: TRenderComponent) => React.ReactNode;
|
|
1232
|
+
/** disable or enable drag and drop functionality
|
|
1233
|
+
* @default false
|
|
1234
|
+
*/
|
|
1235
|
+
disableDnD?: boolean;
|
|
1236
|
+
/** sets the draggable id value */
|
|
1237
|
+
multiSelectId?: string;
|
|
1238
|
+
/** Rendered when nothing is selected */
|
|
1239
|
+
whenNothingSelected?: React.ReactNode;
|
|
1240
|
+
};
|
|
1241
|
+
/**
|
|
1242
|
+
* @description An opinionated result list UI component that has built in drag and drop functionality and removal of all selected items from context.
|
|
1243
|
+
* The result item component defaults to <ObjectSearchResultItem {...props} />, however this can be overridden with any other UI component and still
|
|
1244
|
+
* maintain drag and drop functionality
|
|
1245
|
+
* @example <ObjectSearchResultList id="my-id" title="title" renderResultComponent={(values) => <CustomComponent {...values} />} />
|
|
1246
|
+
*/
|
|
1247
|
+
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;
|
|
1248
|
+
|
|
1249
|
+
type QueryFilterSearchProps = {
|
|
1250
|
+
/** sets the count value */
|
|
1251
|
+
count: number | string;
|
|
1252
|
+
/** sets the sortBy filter value */
|
|
1253
|
+
sortBy: string;
|
|
1254
|
+
/** sets the sortOrder filter value */
|
|
1255
|
+
sortOrder: string;
|
|
1256
|
+
};
|
|
1257
|
+
type QuertFilterSelectionOptionProps = Array<{
|
|
1258
|
+
id: string;
|
|
1259
|
+
name: string;
|
|
1260
|
+
label: string;
|
|
1261
|
+
}>;
|
|
1262
|
+
type QueryFilterProps<TSelectOptions extends QuertFilterSelectionOptionProps = QuertFilterSelectionOptionProps> = {
|
|
1263
|
+
/** sets the query filter title
|
|
1264
|
+
* @default 'Configure Query'
|
|
1265
|
+
*/
|
|
1266
|
+
queryFilterTitle?: string;
|
|
1267
|
+
/** sets the content type all selected options label
|
|
1268
|
+
* @default 'All content types'
|
|
1269
|
+
*/
|
|
1270
|
+
typeSelectorAllTypesOptionText?: string;
|
|
1271
|
+
/** sets the content type label value
|
|
1272
|
+
* @default 'Filter by content type'
|
|
1273
|
+
*/
|
|
1274
|
+
contentTypeLabel?: string;
|
|
1275
|
+
/** sets the content type select options */
|
|
1276
|
+
contentTypeOptions: TSelectOptions;
|
|
1277
|
+
/** sets whether the content type filter is required */
|
|
1278
|
+
requireContentType?: boolean;
|
|
1279
|
+
/** sets the count label value
|
|
1280
|
+
* @default 'Count'
|
|
1281
|
+
*/
|
|
1282
|
+
countLabel?: string;
|
|
1283
|
+
/** sets the count value or items to show
|
|
1284
|
+
* @default 5
|
|
1285
|
+
*/
|
|
1286
|
+
countValue?: number;
|
|
1287
|
+
/** sets the sort label text
|
|
1288
|
+
* @default 'Sort'
|
|
1289
|
+
*/
|
|
1290
|
+
sortLabel?: string;
|
|
1291
|
+
/** sets the sort select options value */
|
|
1292
|
+
sortOptions: TSelectOptions;
|
|
1293
|
+
/** sets the sort order lable value
|
|
1294
|
+
* @default 'Sort Order'
|
|
1295
|
+
*/
|
|
1296
|
+
sortOrderLabel?: string;
|
|
1297
|
+
/** sets the sort order select options value */
|
|
1298
|
+
sortOrderOptions: TSelectOptions;
|
|
1299
|
+
/** sets the search input name value
|
|
1300
|
+
* @default 'searchText'
|
|
1301
|
+
*/
|
|
1302
|
+
searchInputName?: string;
|
|
1303
|
+
/** sets the search input placeholder text
|
|
1304
|
+
* @default 'Enter keyword to narrow your results'
|
|
1305
|
+
*/
|
|
1306
|
+
searchInputPlaceholderText?: string;
|
|
1307
|
+
/** sets the label for the search input
|
|
1308
|
+
* @default 'Query'
|
|
1309
|
+
*/
|
|
1310
|
+
searchInputLabel?: string;
|
|
1311
|
+
/** allows for additional child components, for example more input components */
|
|
1312
|
+
children?: ReactNode;
|
|
1313
|
+
};
|
|
1314
|
+
/**
|
|
1315
|
+
* @description An opinionated multi query filter UI component, best used for querying product data or more complex scenarios
|
|
1316
|
+
* @example <QueryFilter contentTypeOptions={[{ id: 'id', name: 'name' }]} sortOptions={[{ id: 'id', name: 'name' }]} sortOrderOptions={[{ id: 'id', name: 'name' }]} />
|
|
1317
|
+
*/
|
|
1318
|
+
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;
|
|
1319
|
+
|
|
1320
|
+
type ParamTypeDynamicDataProviderProps = {
|
|
1321
|
+
/** Child components of the provider. Variables-using components, such as ParameterVariables, can be used here. */
|
|
1322
|
+
children: ReactNode;
|
|
1323
|
+
};
|
|
1324
|
+
/** Context to tell the binding UI what types are allowed for the current binding expression */
|
|
1325
|
+
type ParameterConnectOptions = {
|
|
1326
|
+
/**
|
|
1327
|
+
* Which JSON primitive types can be connected to this parameter.
|
|
1328
|
+
* Note that if the only value of the parameter is a complex data element connection (object or array), then the connected data will be the literal value, not a string.
|
|
1329
|
+
*/
|
|
1330
|
+
connectsTo: BindableTypes[];
|
|
1331
|
+
};
|
|
1332
|
+
/**
|
|
1333
|
+
* Wrapper for data resource locations. Provides read-only access to dynamic inputs as if they were variables,
|
|
1334
|
+
* using variables-aware components (i.e. InputVariables). This simplifies building dynamic-input-aware editors,
|
|
1335
|
+
* where a data resource variable could be a static value or bound to a dynamic input from the route (project map).
|
|
1336
|
+
*/
|
|
1337
|
+
declare function ParamTypeDynamicDataProvider(props: ParamTypeDynamicDataProviderProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1338
|
+
|
|
1339
|
+
/** Editor component to let you write a request body for POST requests */
|
|
1340
|
+
declare function RequestBody(): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1341
|
+
|
|
1342
|
+
/** Editor component to manage HTTP headers on a request */
|
|
1343
|
+
declare function RequestHeaders({ disableVariables }: Pick<InputVariablesProps, 'disableVariables'>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1344
|
+
|
|
1345
|
+
/** Dropdown to pick a HTTP method for a request */
|
|
1346
|
+
declare function RequestMethodSelect(props: Omit<InputSelectProps, 'value' | 'onChange' | 'options'>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1347
|
+
|
|
1348
|
+
type RequestParametersProps = Pick<InputVariablesProps, 'disableVariables'>;
|
|
1349
|
+
/** Component to manage query parameters on a request */
|
|
1350
|
+
declare function RequestParameters({ disableVariables }: Pick<InputVariablesProps, 'disableVariables'>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1351
|
+
|
|
1352
|
+
type RequestParameter = {
|
|
1353
|
+
key: string;
|
|
1354
|
+
value: string;
|
|
1355
|
+
};
|
|
1356
|
+
type BaseRequestData = {
|
|
1357
|
+
baseUrl: string;
|
|
1358
|
+
headers?: Array<RequestParameter>;
|
|
1359
|
+
parameters?: Array<RequestParameter>;
|
|
1360
|
+
};
|
|
1361
|
+
type RequestData = {
|
|
1362
|
+
relativeUrl: string;
|
|
1363
|
+
headers: Array<RequestParameter>;
|
|
1364
|
+
parameters: Array<RequestParameter>;
|
|
1365
|
+
baseRequest?: BaseRequestData;
|
|
1366
|
+
method?: string;
|
|
1367
|
+
body?: string;
|
|
1368
|
+
};
|
|
1369
|
+
type RequestProviderProps = React$1.PropsWithChildren<{
|
|
1370
|
+
value: RequestData;
|
|
1371
|
+
onChange: (delegate: (oldValue: RequestData) => RequestData) => void;
|
|
1372
|
+
}>;
|
|
1373
|
+
type RequestAction = {
|
|
1374
|
+
type: 'setRelativeUrl';
|
|
1375
|
+
relativeUrl: string;
|
|
1376
|
+
} | {
|
|
1377
|
+
type: 'updateHeader';
|
|
1378
|
+
header: RequestParameter;
|
|
1379
|
+
index?: number;
|
|
1380
|
+
} | {
|
|
1381
|
+
type: 'removeHeader';
|
|
1382
|
+
index: number;
|
|
1383
|
+
} | {
|
|
1384
|
+
type: 'updateParameter';
|
|
1385
|
+
parameter: RequestParameter;
|
|
1386
|
+
index?: number;
|
|
1387
|
+
} | {
|
|
1388
|
+
type: 'removeParameter';
|
|
1389
|
+
index: number;
|
|
1390
|
+
} | {
|
|
1391
|
+
type: 'setMethod';
|
|
1392
|
+
method: string;
|
|
1393
|
+
} | {
|
|
1394
|
+
type: 'setBody';
|
|
1395
|
+
body: string;
|
|
1396
|
+
contentType: string;
|
|
1397
|
+
};
|
|
1398
|
+
type RequestContext = {
|
|
1399
|
+
dispatch: (event: RequestAction) => void;
|
|
1400
|
+
request: Readonly<RequestData>;
|
|
1401
|
+
};
|
|
1402
|
+
/** Provides a mutable HTTP request object context. Components such as RequestBody and RequestUrl use this context to render. */
|
|
1403
|
+
declare function RequestProvider({ value, onChange, children }: RequestProviderProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1404
|
+
declare function useRequest(): RequestContext;
|
|
1405
|
+
|
|
1406
|
+
type RequestTypeContainerProps = React$1.HTMLAttributes<HTMLDivElement> & {
|
|
1407
|
+
/**sets the background color of the container
|
|
1408
|
+
* @default 'transparent'
|
|
1409
|
+
*/
|
|
1410
|
+
bgColor?: 'transparent' | 'var(--gray-100)';
|
|
1411
|
+
children: React$1.ReactNode;
|
|
1412
|
+
};
|
|
1413
|
+
/**
|
|
1414
|
+
* @description a container to layout content in a 2 column grid format = 12ch 1fr
|
|
1415
|
+
* @example <RequestTypeContainer bgColor="var(--gray-100)">
|
|
1416
|
+
* <label>Name <input type="text" /></label>
|
|
1417
|
+
* <label>Name <input type="text" /></label>
|
|
1418
|
+
* </div> */
|
|
1419
|
+
declare const RequestTypeContainer: ({ bgColor, children, ...props }: RequestTypeContainerProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1420
|
+
|
|
1421
|
+
/**
|
|
1422
|
+
* Displays the current full URL of the request, including the base URL if one is set
|
|
1423
|
+
*/
|
|
1424
|
+
declare function RequestUrl(): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1425
|
+
|
|
1426
|
+
/**
|
|
1427
|
+
* Editor to modify the current URL of the request
|
|
1428
|
+
* Note: entering query string parameters automatically converts them and syncs the request state with them
|
|
1429
|
+
*/
|
|
1430
|
+
declare function RequestUrlInput(props: Omit<InputVariablesProps, 'value' | 'onChange'> & Pick<InputVariablesProps, 'showAddVariableMenuOption' | 'enableEditingVariables'>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1431
|
+
|
|
1432
|
+
declare function urlEncodeRequestUrl(url: string, varValues?: Record<string, MeshDataVariableDefinition>): string;
|
|
1433
|
+
declare function urlEncodeRequestParameter(parameter: RequestParameter, varValues?: Record<string, MeshDataVariableDefinition>): RequestParameter;
|
|
1434
|
+
|
|
1435
|
+
/**
|
|
1436
|
+
* Hook to make it simple to read and write a specific request header by name,
|
|
1437
|
+
* instead of supporting multiple values in an array like native dispatch.
|
|
1438
|
+
*
|
|
1439
|
+
* NOTE: if multiple values are added for the named header, this hook will bind to the FIRST
|
|
1440
|
+
* instance of the header and leave the other values alone.
|
|
1441
|
+
*/
|
|
1442
|
+
declare function useRequestHeader(headerName: string): {
|
|
1443
|
+
value: string;
|
|
1444
|
+
update: (value: string) => void;
|
|
1445
|
+
};
|
|
1446
|
+
|
|
1447
|
+
/**
|
|
1448
|
+
* Hook to make it simple to read and write a specific request query string parameter by name,
|
|
1449
|
+
* instead of supporting multiple values in an array like native dispatch.
|
|
1450
|
+
*
|
|
1451
|
+
* NOTE: if multiple values are added for the named parameter, this hook will bind to the FIRST
|
|
1452
|
+
* instance of the parameter and leave the other values alone.
|
|
1453
|
+
*/
|
|
1454
|
+
declare function useRequestParameter(paramName: string): {
|
|
1455
|
+
value: string;
|
|
1456
|
+
update: (value: string) => void;
|
|
1457
|
+
};
|
|
1458
|
+
|
|
1459
|
+
/** Converts connected data map into VariablesProvider-format variables */
|
|
1460
|
+
declare function useConnectedDataAsVariables(connectedData: Record<string, unknown> | undefined): Record<string, MeshDataVariableDefinition>;
|
|
1461
|
+
|
|
1462
|
+
/** Converts dynamic inputs into VariablesProvider-format variables */
|
|
1463
|
+
declare function useDynamicInputsAsVariables(dynamicInputs: MinimalDynamicInputs): Record<string, MeshDataVariableDefinition>;
|
|
1464
|
+
|
|
1465
|
+
/**
|
|
1466
|
+
* Provides convenient access to the current Uniform Mesh SDK instance via React hook.
|
|
1467
|
+
* Intended to be used within <MeshApp />.
|
|
1468
|
+
*/
|
|
1469
|
+
declare function useUniformMeshSdk(): _uniformdev_mesh_sdk.UniformMeshSDK;
|
|
1470
|
+
|
|
1471
|
+
/**
|
|
1472
|
+
* Creates a validation interceptor between useMeshLocation's setValue function and your code.
|
|
1473
|
+
* You can use this utility to write cleaner validation logic for your Mesh Location UIs.
|
|
1474
|
+
* @param setValue The location's raw setValue function
|
|
1475
|
+
* @param validate A function to validate the new location's value.
|
|
1476
|
+
* @returns An equivalent to the setValue function that intercepts sets, performs validation, and emits the result with the new value.
|
|
1477
|
+
*/
|
|
1478
|
+
declare function createLocationValidator<TSetValue>(setValue: SetLocationValueDispatch<TSetValue>, validate: (newValue: TSetValue, currentResult: SetValueOptions | undefined) => SetValueOptions): SetLocationValueDispatch<TSetValue>;
|
|
1479
|
+
|
|
1480
|
+
export { $createVariableNode, $isVariableNode, BaseRequestData, Brand, ControlledValuePlugin, DamItem, DamSelectedItem, DamSelectedItemProps, DataRefreshButton, DataRefreshButtonProps, DataResourceDynamicInputProvider, DataResourceDynamicInputProviderProps, DataResourceVariableRendererProps, DataResourceVariablesList, DataResourceVariablesListExplicit, DataResourceVariablesListProps, DataSourceEditor, DataSourceEditorProps, DataTypeEditor, DataTypeEditorProps, DataVariableDefinitionWithName, DefaultSearchRow, DefaultSelectedItem, DispatchResult, EDIT_VARIABLE_COMMAND, EditVariableCommandArguments, EntrySearch, EntrySearchContentType, EntrySearchProps, EntrySearchQueryOptions, EntrySearchResult, EntrySearchRowProps, EntrySearchSelectedItemProps, GetProductOptions, GetProductsOptions, INSERT_VARIABLE_COMMAND, index as Icons, InputVariables, InputVariablesProps, InsertVariableCommandArguments, ItemListProps, LinkButton, MeshApp, MeshAppProps, MeshDataVariableDefinition, MinimalDynamicInput, MinimalDynamicInputs, NoResultsProps, ObjectSearchContainer, ObjectSearchContainerProps, ObjectSearchContextProps, ObjectSearchFilter, ObjectSearchFilterContainer, ObjectSearchFilterContainerProps, ObjectSearchFilterProps, ObjectSearchListItem, ObjectSearchListItemLoadingSkeleton, ObjectSearchListItemProps, ObjectSearchProvider, ObjectSearchProviderProps, ObjectSearchResultItem, ObjectSearchResultItemButton, ObjectSearchResultItemButtonProps, ObjectSearchResultItemProps, ObjectSearchResultList, ObjectSearchResultListProps, ParamTypeDynamicDataProvider, ParamTypeDynamicDataProviderProps, ParameterConnectOptions, ParameterConnectionIndicator, ParameterConnectionIndicatorProps, ParameterOrSingleVariable, ParameterOrSingleVariableProps, ParameterVariables, ParameterVariablesProps, 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, SerializedVariableNode, SetLocationValueDispatch, SetLocationValueFunction, TextVariableRenderer, UseVariablesMenu, UseVariablesMenuInput, VariableEditor, VariableEditorProps, VariableNode, VariableNodeState, VariableSourceGroup, VariablesAction, VariablesContext, VariablesEvents, VariablesList, VariablesPlugin, VariablesPluginProps, VariablesProvider, VariablesProviderProps, VariablesUpdateEvent, badgeIcon, convertConnectedDataToVariable, createLocationValidator, damSelectItemImage, damSelectedItemContainer, damSelectedItemCopy, damSelectedItemDetails, damSelectedItemIcon, damSelectedItemInfoBtn, damSelectedItemInner, damSelectedItemLinkBtn, damSelectedItemLinkContainer, damSelectedItemMediaContainer, damSelectedItemPopover, damSelectedItemPopoverLabel, damSelectedItemSmallText, damSelectedItemTitle, deserializeVariablesEditorState, draggableContainer, draggableIcon, draggableIconOffset, draggableIconWrapper, entrySearchBtn, entrySearchConfig, entrySearchConfigHidden, entrySearchLoadMoreBtn, entrySearchResultList, entrySearchSelectIcon, entrySearchSelectImg, entrySearchSelectInput, entrySearchSelectOption, entrySearchWrapper, prettifyBindExpression, 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, serializeVariablesEditorState, urlEncodeRequestParameter, urlEncodeRequestUrl, useConnectedDataAsVariables, useDynamicInputsAsVariables, useMeshLocation, useObjectSearchContext, useOnVariableUpdated, useProductQueryContext, useProductSearchContext, useRequest, useRequestHeader, useRequestParameter, useUniformMeshSdk, useVariables, useVariablesMenu, variableDefaultTextValue, variablePrefix, variableSuffix, variablesToGroupedList, variablesToList };
|