@uniformdev/mesh-sdk-react 19.35.3-alpha.82 → 19.36.1-alpha.7
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 +55 -372
- package/dist/index.d.ts +55 -372
- package/dist/index.esm.js +2541 -1859
- package/dist/index.js +2552 -1898
- package/dist/index.mjs +2541 -1859
- package/package.json +4 -7
package/dist/index.d.mts
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import * as _emotion_react_types_jsx_namespace from '@emotion/react/types/jsx-namespace';
|
|
2
2
|
import * as React$1 from 'react';
|
|
3
|
-
import React__default, { SVGProps,
|
|
3
|
+
import React__default, { SVGProps, PropsWithChildren, ComponentType, HTMLAttributes, ReactNode, AnchorHTMLAttributes } from 'react';
|
|
4
4
|
import { TDate } from 'timeago.js';
|
|
5
5
|
import * as _emotion_react from '@emotion/react';
|
|
6
6
|
import * as _uniformdev_mesh_sdk from '@uniformdev/mesh-sdk';
|
|
7
|
-
import { DynamicInput, MeshLocation, SetValueOptions, DynamicInputs, DataSourceLocationValue, DataTypeLocationValue
|
|
7
|
+
import { DynamicInput, MeshLocation, SetValueOptions, DynamicInputs, DataSourceLocationValue, DataTypeLocationValue } from '@uniformdev/mesh-sdk';
|
|
8
8
|
export * from '@uniformdev/mesh-sdk';
|
|
9
9
|
import { DataVariableDefinition, DataResourceVariables, DataType } from '@uniformdev/canvas';
|
|
10
10
|
import { Emitter } from 'mitt';
|
|
11
11
|
import { BadgeThemeProps, InputSelectProps } from '@uniformdev/design-system';
|
|
12
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
13
|
|
|
17
14
|
declare const SvgCaution: (props: SVGProps<SVGSVGElement>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
18
15
|
|
|
@@ -372,18 +369,16 @@ declare const damSelectItemImage: _emotion_react.SerializedStyles;
|
|
|
372
369
|
|
|
373
370
|
type MinimalDynamicInput = Omit<DynamicInput, 'source'>;
|
|
374
371
|
type MinimalDynamicInputs = Record<string, MinimalDynamicInput>;
|
|
375
|
-
type DataResourceDynamicInputProviderProps = {
|
|
372
|
+
type DataResourceDynamicInputProviderProps = PropsWithChildren<{
|
|
376
373
|
/** Explicitly provide dynamic input values. If not set, Mesh location will be used */
|
|
377
374
|
dynamicInputs?: MinimalDynamicInputs;
|
|
378
|
-
|
|
379
|
-
children: ReactNode;
|
|
380
|
-
};
|
|
375
|
+
}>;
|
|
381
376
|
/**
|
|
382
377
|
* Wrapper for data resource locations. Provides read-only access to dynamic inputs as if they were variables,
|
|
383
378
|
* using variables-aware components (i.e. InputVariables). This simplifies building dynamic-input-aware editors,
|
|
384
379
|
* where a data resource variable could be a static value or bound to a dynamic input from the route (project map).
|
|
385
380
|
*/
|
|
386
|
-
declare function DataResourceDynamicInputProvider(
|
|
381
|
+
declare function DataResourceDynamicInputProvider({ children, dynamicInputs, }: DataResourceDynamicInputProviderProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
387
382
|
|
|
388
383
|
/**
|
|
389
384
|
* Provides convenient access to the current Uniform Mesh location via React hook.
|
|
@@ -446,182 +441,6 @@ type DispatchResult<TSetValue> = {
|
|
|
446
441
|
newValue: TSetValue;
|
|
447
442
|
};
|
|
448
443
|
|
|
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
444
|
type PasteTransformerPluginProps = {
|
|
626
445
|
/**
|
|
627
446
|
* Transforms pasted contents before inserting them.
|
|
@@ -630,46 +449,23 @@ type PasteTransformerPluginProps = {
|
|
|
630
449
|
transformPaste?: (pastedText: string) => string | undefined;
|
|
631
450
|
};
|
|
632
451
|
|
|
633
|
-
type
|
|
634
|
-
|
|
635
|
-
|
|
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;
|
|
452
|
+
type InputToken = {
|
|
453
|
+
name: string;
|
|
454
|
+
value: string;
|
|
664
455
|
};
|
|
665
|
-
|
|
666
|
-
type InputVariablesProps<TEditorContext = unknown> = {
|
|
456
|
+
type InputVariablesProps = {
|
|
667
457
|
/** Sets a HTML ID for the variables input and label */
|
|
668
458
|
id?: string;
|
|
669
459
|
/** Enables a label for the input */
|
|
670
460
|
label?: string;
|
|
671
461
|
/** sets the input aria-label value. */
|
|
672
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;
|
|
673
469
|
/**
|
|
674
470
|
* Turns off the 'Reset' menu option that is added when:
|
|
675
471
|
* - inputWhenNoVariables is passed in
|
|
@@ -677,18 +473,20 @@ type InputVariablesProps<TEditorContext = unknown> = {
|
|
|
677
473
|
*
|
|
678
474
|
* The reset button returns the editor to the inputWithNoVariables state
|
|
679
475
|
*
|
|
680
|
-
* @deprecated
|
|
476
|
+
* @deprecated not usually necessary to set this, it's automatic
|
|
681
477
|
*/
|
|
682
478
|
disableReset?: boolean;
|
|
683
|
-
/** Enables
|
|
684
|
-
|
|
479
|
+
/** Enables adding variables from the menu */
|
|
480
|
+
showAddVariableMenuOption?: boolean;
|
|
685
481
|
/** Disables the inline variable selection menu when rendering a variables input */
|
|
686
482
|
disableInlineMenu?: boolean;
|
|
483
|
+
/** Enables clicking a variable reference to edit the variable */
|
|
484
|
+
enableEditingVariables?: boolean;
|
|
687
485
|
/**
|
|
688
|
-
*
|
|
689
|
-
*
|
|
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.
|
|
690
488
|
*/
|
|
691
|
-
|
|
489
|
+
inputWhenNoVariables?: JSX.Element;
|
|
692
490
|
/** (optional) sets and shows the the error message value */
|
|
693
491
|
errorMessage?: string;
|
|
694
492
|
/** (optional) sets and shows the the warning message value */
|
|
@@ -697,87 +495,37 @@ type InputVariablesProps<TEditorContext = unknown> = {
|
|
|
697
495
|
infoMessage?: string;
|
|
698
496
|
/** (optional) sets caption text value */
|
|
699
497
|
caption?: string;
|
|
700
|
-
/** Disables editing the value of the input, editing variables, and adding variables */
|
|
701
|
-
disabled?: boolean;
|
|
702
498
|
/** Sets the test ID of the input */
|
|
703
499
|
'data-test-id'?: string;
|
|
704
|
-
|
|
705
|
-
|
|
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;
|
|
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;
|
|
717
502
|
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
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;
|
|
503
|
+
/** Expected prefix for variable expressions */
|
|
504
|
+
declare const variablePrefix = "${";
|
|
505
|
+
/** Expected suffix for variable expressions */
|
|
506
|
+
declare const variableSuffix = "}";
|
|
742
507
|
|
|
743
|
-
type
|
|
744
|
-
|
|
745
|
-
|
|
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>;
|
|
508
|
+
type DataVariableDefinitionWithName = {
|
|
509
|
+
name: string;
|
|
510
|
+
} & DataVariableDefinition;
|
|
764
511
|
/**
|
|
765
|
-
*
|
|
766
|
-
*
|
|
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.
|
|
767
514
|
*/
|
|
768
|
-
declare function
|
|
515
|
+
declare function variablesToList(variables: Record<string, DataVariableDefinition> | undefined): Array<DataVariableDefinitionWithName>;
|
|
769
516
|
|
|
770
|
-
type VariableEditorProps
|
|
517
|
+
type VariableEditorProps = {
|
|
771
518
|
variable: string;
|
|
772
519
|
onSubmit: (values: DataVariableDefinitionWithName) => void | Promise<void>;
|
|
773
520
|
/** Disables the tip about Mesh integrations. Intended for use when this is placed on a custom Mesh integration to edit variables. */
|
|
774
521
|
disableMeshTip?: boolean;
|
|
775
522
|
onCancel: () => void;
|
|
776
|
-
context: TEditorContext | undefined;
|
|
777
523
|
};
|
|
778
|
-
declare function VariableEditor({ variable, onSubmit, onCancel, disableMeshTip }: VariableEditorProps
|
|
524
|
+
declare function VariableEditor({ variable, onSubmit, onCancel, disableMeshTip }: VariableEditorProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
779
525
|
|
|
780
|
-
|
|
526
|
+
declare function VariablesList(): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
527
|
+
|
|
528
|
+
type VariablesProviderProps = React$1.PropsWithChildren<{
|
|
781
529
|
/**
|
|
782
530
|
* Signals that components in this variables context are not intended to allow mutation
|
|
783
531
|
* of the variable values (i.e. editing, adding, or deleting variable definitions).
|
|
@@ -786,20 +534,18 @@ type VariablesProviderProps<TEditVariableContext = unknown> = React$1.PropsWithC
|
|
|
786
534
|
*/
|
|
787
535
|
readOnly?: boolean;
|
|
788
536
|
/** Variable values to load into the context */
|
|
789
|
-
value: Record<string,
|
|
537
|
+
value: Record<string, DataVariableDefinition>;
|
|
790
538
|
/** Function to handle mutations to the variable values (optional when readOnly is true) */
|
|
791
|
-
onChange?: (newValue: Record<string,
|
|
539
|
+
onChange?: (newValue: Record<string, DataVariableDefinition>) => void;
|
|
792
540
|
/**
|
|
793
541
|
* Provide a component to handle editing a variable definition (e.g. a modal wrapper)
|
|
794
542
|
* If not passed, the editor will be rendered inline, with potentially strange results.
|
|
795
543
|
*/
|
|
796
|
-
editVariableComponent?: React$1.ComponentType<VariableEditorProps
|
|
544
|
+
editVariableComponent?: React$1.ComponentType<VariableEditorProps>;
|
|
797
545
|
}>;
|
|
798
|
-
type VariablesAction
|
|
546
|
+
type VariablesAction = {
|
|
799
547
|
type: 'edit';
|
|
800
548
|
variable: string;
|
|
801
|
-
/** Context that will be passed in a prop to the variables context editing component */
|
|
802
|
-
context?: TEditVariableContext;
|
|
803
549
|
} | {
|
|
804
550
|
type: 'remove';
|
|
805
551
|
variable: string;
|
|
@@ -807,22 +553,14 @@ type VariablesAction<TEditVariableContext> = {
|
|
|
807
553
|
type: 'set';
|
|
808
554
|
variable: DataVariableDefinitionWithName;
|
|
809
555
|
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
556
|
} | {
|
|
813
557
|
type: 'reorder';
|
|
814
558
|
result: Record<string, DataVariableDefinitionWithName>;
|
|
815
|
-
} | {
|
|
816
|
-
type: 'cancelEdit';
|
|
817
|
-
};
|
|
818
|
-
type VariablesUpdateEvent = {
|
|
819
|
-
name: string;
|
|
820
|
-
latestValue: Record<string, MeshDataVariableDefinition>;
|
|
821
559
|
};
|
|
822
560
|
type VariablesEvents = {
|
|
823
|
-
update:
|
|
561
|
+
update: string;
|
|
824
562
|
};
|
|
825
|
-
type VariablesContext
|
|
563
|
+
type VariablesContext = {
|
|
826
564
|
/**
|
|
827
565
|
* Signals that components in this variables context are not intended to allow mutation
|
|
828
566
|
* of the variable values (i.e. editing, adding, or deleting variable definitions).
|
|
@@ -831,9 +569,9 @@ type VariablesContext<TEditVariableContext> = {
|
|
|
831
569
|
*/
|
|
832
570
|
readOnly?: boolean;
|
|
833
571
|
/** Dispatch update events to the variables */
|
|
834
|
-
dispatch: (event: VariablesAction
|
|
572
|
+
dispatch: (event: VariablesAction) => void;
|
|
835
573
|
/** The current variables value */
|
|
836
|
-
variables: Readonly<Record<string,
|
|
574
|
+
variables: Readonly<Record<string, DataVariableDefinition>>;
|
|
837
575
|
/** Whether the context is editing a variable value currently */
|
|
838
576
|
isEditing: boolean;
|
|
839
577
|
/** Add event handles (don't forget to unhook) */
|
|
@@ -844,40 +582,10 @@ type VariablesContext<TEditVariableContext> = {
|
|
|
844
582
|
* A flattened version of `variables` that is a plain key-value object.
|
|
845
583
|
* Used when binding the variables to a value.
|
|
846
584
|
*/
|
|
847
|
-
flatVariables: Readonly<Record<string,
|
|
585
|
+
flatVariables: Readonly<Record<string, string>>;
|
|
848
586
|
};
|
|
849
|
-
declare function VariablesProvider
|
|
850
|
-
declare function useVariables
|
|
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;
|
|
587
|
+
declare function VariablesProvider({ value, onChange, editVariableComponent, readOnly, children, }: VariablesProviderProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
588
|
+
declare function useVariables(returnEmptyWithoutProvider?: boolean): VariablesContext;
|
|
881
589
|
|
|
882
590
|
type DataResourceVariablesListProps = {
|
|
883
591
|
/**
|
|
@@ -1317,25 +1025,6 @@ type QueryFilterProps<TSelectOptions extends QuertFilterSelectionOptionProps = Q
|
|
|
1317
1025
|
*/
|
|
1318
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;
|
|
1319
1027
|
|
|
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
1028
|
/** Editor component to let you write a request body for POST requests */
|
|
1340
1029
|
declare function RequestBody(): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1341
1030
|
|
|
@@ -1427,10 +1116,10 @@ declare function RequestUrl(): _emotion_react_types_jsx_namespace.EmotionJSX.Ele
|
|
|
1427
1116
|
* Editor to modify the current URL of the request
|
|
1428
1117
|
* Note: entering query string parameters automatically converts them and syncs the request state with them
|
|
1429
1118
|
*/
|
|
1430
|
-
declare function RequestUrlInput(props: Omit<InputVariablesProps, 'value' | 'onChange'>
|
|
1119
|
+
declare function RequestUrlInput(props: Omit<InputVariablesProps, 'value' | 'onChange'>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1431
1120
|
|
|
1432
|
-
declare function urlEncodeRequestUrl(url: string, varValues?: Record<string,
|
|
1433
|
-
declare function urlEncodeRequestParameter(parameter: RequestParameter, varValues?: Record<string,
|
|
1121
|
+
declare function urlEncodeRequestUrl(url: string, varValues?: Record<string, DataVariableDefinition>): string;
|
|
1122
|
+
declare function urlEncodeRequestParameter(parameter: RequestParameter, varValues?: Record<string, DataVariableDefinition>): RequestParameter;
|
|
1434
1123
|
|
|
1435
1124
|
/**
|
|
1436
1125
|
* Hook to make it simple to read and write a specific request header by name,
|
|
@@ -1456,12 +1145,6 @@ declare function useRequestParameter(paramName: string): {
|
|
|
1456
1145
|
update: (value: string) => void;
|
|
1457
1146
|
};
|
|
1458
1147
|
|
|
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
1148
|
/**
|
|
1466
1149
|
* Provides convenient access to the current Uniform Mesh SDK instance via React hook.
|
|
1467
1150
|
* Intended to be used within <MeshApp />.
|
|
@@ -1477,4 +1160,4 @@ declare function useUniformMeshSdk(): _uniformdev_mesh_sdk.UniformMeshSDK;
|
|
|
1477
1160
|
*/
|
|
1478
1161
|
declare function createLocationValidator<TSetValue>(setValue: SetLocationValueDispatch<TSetValue>, validate: (newValue: TSetValue, currentResult: SetValueOptions | undefined) => SetValueOptions): SetLocationValueDispatch<TSetValue>;
|
|
1479
1162
|
|
|
1480
|
-
export {
|
|
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 };
|