@uniformdev/mesh-sdk-react 20.35.0 → 20.35.1-alpha.188
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 +18 -7
- package/dist/index.d.ts +18 -7
- package/dist/index.esm.js +107 -80
- package/dist/index.js +109 -82
- package/dist/index.mjs +107 -80
- package/package.json +21 -22
package/dist/index.d.mts
CHANGED
|
@@ -8,7 +8,7 @@ import { DataVariableDefinition, DataResourceVariables, DataType, DataSourceVari
|
|
|
8
8
|
import { Emitter } from 'mitt';
|
|
9
9
|
import { TDate } from 'timeago.js';
|
|
10
10
|
import * as lexical from 'lexical';
|
|
11
|
-
import { SerializedEditorState, SerializedLexicalNode, Spread, DecoratorNode, NodeKey, LexicalNode, LexicalEditor, EditorState, SerializedRootNode } from 'lexical';
|
|
11
|
+
import { SerializedEditorState, SerializedLexicalNode, Spread, DecoratorNode, NodeKey, DOMConversionMap, LexicalNode, LexicalEditor, EditorState, SerializedRootNode } from 'lexical';
|
|
12
12
|
import { Interpolation, Theme, SerializedStyles } from '@emotion/react';
|
|
13
13
|
import { InputSelectProps, IconType } from '@uniformdev/design-system';
|
|
14
14
|
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, utilityColors } from '@uniformdev/design-system';
|
|
@@ -186,7 +186,7 @@ declare function ControlledValuePlugin({ enabled, value, extraDependencies, }: {
|
|
|
186
186
|
enabled: boolean;
|
|
187
187
|
value: string | undefined | SerializedEditorState<SerializedLexicalNode>;
|
|
188
188
|
extraDependencies?: unknown[];
|
|
189
|
-
}):
|
|
189
|
+
}): ReactNode | null;
|
|
190
190
|
|
|
191
191
|
type SerializedVariableNode = Spread<{
|
|
192
192
|
reference: string;
|
|
@@ -217,9 +217,9 @@ type VariableNodeState = {
|
|
|
217
217
|
isLoading: boolean;
|
|
218
218
|
};
|
|
219
219
|
/** Renders a variable reference node within a Lexical editor */
|
|
220
|
-
declare class VariableNode extends DecoratorNode<
|
|
220
|
+
declare class VariableNode extends DecoratorNode<ReactNode> {
|
|
221
221
|
reference: Readonly<string>;
|
|
222
|
-
private
|
|
222
|
+
private __variableState;
|
|
223
223
|
static getType(): string;
|
|
224
224
|
static clone(node: VariableNode): VariableNode;
|
|
225
225
|
/** Imports the node from serialized JSON (i.e. the data provided to the editor's initial state) */
|
|
@@ -248,6 +248,7 @@ declare class VariableNode extends DecoratorNode<JSX.Element> {
|
|
|
248
248
|
/** Creates the DOM wrapper that hosts the node */
|
|
249
249
|
createDOM(): HTMLSpanElement;
|
|
250
250
|
updateDOM(): boolean;
|
|
251
|
+
static importDOM(): DOMConversionMap | null;
|
|
251
252
|
/**
|
|
252
253
|
* Render the variable node using React.
|
|
253
254
|
* NOTE: this is effectively an island of React, and you may not call hooks,
|
|
@@ -415,6 +416,11 @@ type VariablesPluginProps<TEditorContext = unknown> = {
|
|
|
415
416
|
filterVariable?: SelectVariableMenuProps<TEditorContext>['filterVariable'];
|
|
416
417
|
/** If true, the whole value of the editor is replaced when a variable is inserted */
|
|
417
418
|
replaceValueOnVariableInsert: boolean;
|
|
419
|
+
/**
|
|
420
|
+
* Disables display names for variables; the variable's (prettified) name is used instead even if a DN exists
|
|
421
|
+
* Use this to render dynamic tokens as paths instead of bound values.
|
|
422
|
+
*/
|
|
423
|
+
disableVariableDisplayNames?: boolean;
|
|
418
424
|
};
|
|
419
425
|
type UseVariablesMenuInput<TEditorContext> = Pick<VariablesPluginProps<TEditorContext>, 'showAddVariableMenuOption' | 'enableEditingVariables' | 'filterVariable' | 'getEditorContext'>;
|
|
420
426
|
type OnVariableSelectInput = {
|
|
@@ -435,7 +441,7 @@ declare function useVariablesMenu<TEditorContext>({ showAddVariableMenuOption, e
|
|
|
435
441
|
* Enables variables auto-complete and reference management to a Lexical editor.
|
|
436
442
|
* Must also activate the VariableNode node to make this work.
|
|
437
443
|
*/
|
|
438
|
-
declare function VariablesPlugin<TEditorContext = unknown>({ disableVariables, showAddVariableMenuOption, enableEditingVariables, getEditorContext, replaceValueOnVariableInsert, filterVariable, }: VariablesPluginProps<TEditorContext>):
|
|
444
|
+
declare function VariablesPlugin<TEditorContext = unknown>({ disableVariables, showAddVariableMenuOption, enableEditingVariables, getEditorContext, replaceValueOnVariableInsert, filterVariable, disableVariableDisplayNames, }: VariablesPluginProps<TEditorContext>): ReactNode | null;
|
|
439
445
|
|
|
440
446
|
type PasteTransformerPluginProps = {
|
|
441
447
|
/**
|
|
@@ -475,7 +481,7 @@ type UseInputVariablesStateProps<TEditorContext = unknown> = {
|
|
|
475
481
|
* in the input will be replaced with the variable reference. Once in variables-mode, additional
|
|
476
482
|
* insertions are inserted at the current selection (or end) of the variables value.
|
|
477
483
|
*/
|
|
478
|
-
inputWhenNoVariables?:
|
|
484
|
+
inputWhenNoVariables?: ReactNode;
|
|
479
485
|
/** Computes the editor context when a variable is added or edited from this composer */
|
|
480
486
|
getEditorContext?: () => TEditorContext;
|
|
481
487
|
/** Filters available variables in menus and auto-completes */
|
|
@@ -552,6 +558,11 @@ type InputVariablesProps<TEditorContext = unknown> = {
|
|
|
552
558
|
* any existing value on insert a new dynamic token.
|
|
553
559
|
*/
|
|
554
560
|
singleTokenMode?: boolean;
|
|
561
|
+
/**
|
|
562
|
+
* Disables display names for variables; the variable's (prettified) name is used instead even if a DN exists
|
|
563
|
+
* Use this to render dynamic tokens as paths instead of bound values.
|
|
564
|
+
*/
|
|
565
|
+
disableVariableDisplayNames?: boolean;
|
|
555
566
|
} & PasteTransformerPluginProps & UseInputVariablesStateProps<TEditorContext>;
|
|
556
567
|
/**
|
|
557
568
|
* An input box that enables insertion of 'variables', provided by VariablesProvider,
|
|
@@ -588,7 +599,7 @@ declare function ParameterConnectionIndicator({ children, value, menuOptions, di
|
|
|
588
599
|
|
|
589
600
|
type ParameterOrSingleVariableProps<TEditorContext = unknown> = {
|
|
590
601
|
disabled?: boolean;
|
|
591
|
-
inputWhenNoVariables:
|
|
602
|
+
inputWhenNoVariables: ReactNode;
|
|
592
603
|
enableEditingVariables?: boolean;
|
|
593
604
|
/**
|
|
594
605
|
* Optional ref to get a handle to the variables editor.
|
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { DataVariableDefinition, DataResourceVariables, DataType, DataSourceVari
|
|
|
8
8
|
import { Emitter } from 'mitt';
|
|
9
9
|
import { TDate } from 'timeago.js';
|
|
10
10
|
import * as lexical from 'lexical';
|
|
11
|
-
import { SerializedEditorState, SerializedLexicalNode, Spread, DecoratorNode, NodeKey, LexicalNode, LexicalEditor, EditorState, SerializedRootNode } from 'lexical';
|
|
11
|
+
import { SerializedEditorState, SerializedLexicalNode, Spread, DecoratorNode, NodeKey, DOMConversionMap, LexicalNode, LexicalEditor, EditorState, SerializedRootNode } from 'lexical';
|
|
12
12
|
import { Interpolation, Theme, SerializedStyles } from '@emotion/react';
|
|
13
13
|
import { InputSelectProps, IconType } from '@uniformdev/design-system';
|
|
14
14
|
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, utilityColors } from '@uniformdev/design-system';
|
|
@@ -186,7 +186,7 @@ declare function ControlledValuePlugin({ enabled, value, extraDependencies, }: {
|
|
|
186
186
|
enabled: boolean;
|
|
187
187
|
value: string | undefined | SerializedEditorState<SerializedLexicalNode>;
|
|
188
188
|
extraDependencies?: unknown[];
|
|
189
|
-
}):
|
|
189
|
+
}): ReactNode | null;
|
|
190
190
|
|
|
191
191
|
type SerializedVariableNode = Spread<{
|
|
192
192
|
reference: string;
|
|
@@ -217,9 +217,9 @@ type VariableNodeState = {
|
|
|
217
217
|
isLoading: boolean;
|
|
218
218
|
};
|
|
219
219
|
/** Renders a variable reference node within a Lexical editor */
|
|
220
|
-
declare class VariableNode extends DecoratorNode<
|
|
220
|
+
declare class VariableNode extends DecoratorNode<ReactNode> {
|
|
221
221
|
reference: Readonly<string>;
|
|
222
|
-
private
|
|
222
|
+
private __variableState;
|
|
223
223
|
static getType(): string;
|
|
224
224
|
static clone(node: VariableNode): VariableNode;
|
|
225
225
|
/** Imports the node from serialized JSON (i.e. the data provided to the editor's initial state) */
|
|
@@ -248,6 +248,7 @@ declare class VariableNode extends DecoratorNode<JSX.Element> {
|
|
|
248
248
|
/** Creates the DOM wrapper that hosts the node */
|
|
249
249
|
createDOM(): HTMLSpanElement;
|
|
250
250
|
updateDOM(): boolean;
|
|
251
|
+
static importDOM(): DOMConversionMap | null;
|
|
251
252
|
/**
|
|
252
253
|
* Render the variable node using React.
|
|
253
254
|
* NOTE: this is effectively an island of React, and you may not call hooks,
|
|
@@ -415,6 +416,11 @@ type VariablesPluginProps<TEditorContext = unknown> = {
|
|
|
415
416
|
filterVariable?: SelectVariableMenuProps<TEditorContext>['filterVariable'];
|
|
416
417
|
/** If true, the whole value of the editor is replaced when a variable is inserted */
|
|
417
418
|
replaceValueOnVariableInsert: boolean;
|
|
419
|
+
/**
|
|
420
|
+
* Disables display names for variables; the variable's (prettified) name is used instead even if a DN exists
|
|
421
|
+
* Use this to render dynamic tokens as paths instead of bound values.
|
|
422
|
+
*/
|
|
423
|
+
disableVariableDisplayNames?: boolean;
|
|
418
424
|
};
|
|
419
425
|
type UseVariablesMenuInput<TEditorContext> = Pick<VariablesPluginProps<TEditorContext>, 'showAddVariableMenuOption' | 'enableEditingVariables' | 'filterVariable' | 'getEditorContext'>;
|
|
420
426
|
type OnVariableSelectInput = {
|
|
@@ -435,7 +441,7 @@ declare function useVariablesMenu<TEditorContext>({ showAddVariableMenuOption, e
|
|
|
435
441
|
* Enables variables auto-complete and reference management to a Lexical editor.
|
|
436
442
|
* Must also activate the VariableNode node to make this work.
|
|
437
443
|
*/
|
|
438
|
-
declare function VariablesPlugin<TEditorContext = unknown>({ disableVariables, showAddVariableMenuOption, enableEditingVariables, getEditorContext, replaceValueOnVariableInsert, filterVariable, }: VariablesPluginProps<TEditorContext>):
|
|
444
|
+
declare function VariablesPlugin<TEditorContext = unknown>({ disableVariables, showAddVariableMenuOption, enableEditingVariables, getEditorContext, replaceValueOnVariableInsert, filterVariable, disableVariableDisplayNames, }: VariablesPluginProps<TEditorContext>): ReactNode | null;
|
|
439
445
|
|
|
440
446
|
type PasteTransformerPluginProps = {
|
|
441
447
|
/**
|
|
@@ -475,7 +481,7 @@ type UseInputVariablesStateProps<TEditorContext = unknown> = {
|
|
|
475
481
|
* in the input will be replaced with the variable reference. Once in variables-mode, additional
|
|
476
482
|
* insertions are inserted at the current selection (or end) of the variables value.
|
|
477
483
|
*/
|
|
478
|
-
inputWhenNoVariables?:
|
|
484
|
+
inputWhenNoVariables?: ReactNode;
|
|
479
485
|
/** Computes the editor context when a variable is added or edited from this composer */
|
|
480
486
|
getEditorContext?: () => TEditorContext;
|
|
481
487
|
/** Filters available variables in menus and auto-completes */
|
|
@@ -552,6 +558,11 @@ type InputVariablesProps<TEditorContext = unknown> = {
|
|
|
552
558
|
* any existing value on insert a new dynamic token.
|
|
553
559
|
*/
|
|
554
560
|
singleTokenMode?: boolean;
|
|
561
|
+
/**
|
|
562
|
+
* Disables display names for variables; the variable's (prettified) name is used instead even if a DN exists
|
|
563
|
+
* Use this to render dynamic tokens as paths instead of bound values.
|
|
564
|
+
*/
|
|
565
|
+
disableVariableDisplayNames?: boolean;
|
|
555
566
|
} & PasteTransformerPluginProps & UseInputVariablesStateProps<TEditorContext>;
|
|
556
567
|
/**
|
|
557
568
|
* An input box that enables insertion of 'variables', provided by VariablesProvider,
|
|
@@ -588,7 +599,7 @@ declare function ParameterConnectionIndicator({ children, value, menuOptions, di
|
|
|
588
599
|
|
|
589
600
|
type ParameterOrSingleVariableProps<TEditorContext = unknown> = {
|
|
590
601
|
disabled?: boolean;
|
|
591
|
-
inputWhenNoVariables:
|
|
602
|
+
inputWhenNoVariables: ReactNode;
|
|
592
603
|
enableEditingVariables?: boolean;
|
|
593
604
|
/**
|
|
594
605
|
* Optional ref to get a handle to the variables editor.
|