@uniformdev/mesh-sdk-react 20.31.1-alpha.0 → 20.31.1-alpha.184
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 +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.esm.js +41 -10
- package/dist/index.js +44 -16
- package/dist/index.mjs +41 -10
- package/package.json +8 -8
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';
|
|
@@ -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,
|
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';
|
|
@@ -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,
|
package/dist/index.esm.js
CHANGED
|
@@ -774,7 +774,7 @@ import { zodResolver } from "@hookform/resolvers/zod";
|
|
|
774
774
|
import { Button, Callout, HorizontalRhythm, Input, useShortcut } from "@uniformdev/design-system";
|
|
775
775
|
import { useLayoutEffect, useRef as useRef2 } from "react";
|
|
776
776
|
import { useForm } from "react-hook-form";
|
|
777
|
-
import
|
|
777
|
+
import * as z from "zod";
|
|
778
778
|
|
|
779
779
|
// src/components/Variables/styles/VariableEditor.styles.ts
|
|
780
780
|
import { css as css2 } from "@emotion/react";
|
|
@@ -1616,6 +1616,14 @@ var VariableNode = class _VariableNode extends DecoratorNode {
|
|
|
1616
1616
|
updateDOM() {
|
|
1617
1617
|
return false;
|
|
1618
1618
|
}
|
|
1619
|
+
static importDOM() {
|
|
1620
|
+
return {
|
|
1621
|
+
binding: () => ({
|
|
1622
|
+
conversion: $convertBindingElement,
|
|
1623
|
+
priority: 0
|
|
1624
|
+
})
|
|
1625
|
+
};
|
|
1626
|
+
}
|
|
1619
1627
|
/**
|
|
1620
1628
|
* Render the variable node using React.
|
|
1621
1629
|
* NOTE: this is effectively an island of React, and you may not call hooks,
|
|
@@ -1625,6 +1633,21 @@ var VariableNode = class _VariableNode extends DecoratorNode {
|
|
|
1625
1633
|
return /* @__PURE__ */ jsx22(VariableNodeComponent, { state: this.__state, reference: this.reference, nodeKey: this.__key });
|
|
1626
1634
|
}
|
|
1627
1635
|
};
|
|
1636
|
+
function $convertBindingElement(domNode) {
|
|
1637
|
+
const element = domNode;
|
|
1638
|
+
const reference = element.textContent.replace(variablePrefix, "").replace(variableSuffix, "");
|
|
1639
|
+
const node = $createVariableNode(reference, {
|
|
1640
|
+
displayName: prettifyBindExpression(reference),
|
|
1641
|
+
hasClickEvent: true,
|
|
1642
|
+
referenceIsValid: true,
|
|
1643
|
+
tooltip: void 0,
|
|
1644
|
+
isFresh: true,
|
|
1645
|
+
isLoading: false
|
|
1646
|
+
});
|
|
1647
|
+
return {
|
|
1648
|
+
node
|
|
1649
|
+
};
|
|
1650
|
+
}
|
|
1628
1651
|
function $createVariableNode(variableReference, state) {
|
|
1629
1652
|
return new VariableNode(variableReference, state);
|
|
1630
1653
|
}
|
|
@@ -1945,6 +1968,7 @@ var input2 = css5`
|
|
|
1945
1968
|
&:disabled,
|
|
1946
1969
|
&:disabled::placeholder,
|
|
1947
1970
|
&:disabled:hover {
|
|
1971
|
+
border-color: var(--gray-200);
|
|
1948
1972
|
border-radius: var(--rounded-sm);
|
|
1949
1973
|
cursor: not-allowed;
|
|
1950
1974
|
color: var(--gray-400);
|
|
@@ -1954,6 +1978,7 @@ var input2 = css5`
|
|
|
1954
1978
|
&[contenteditable='false'] {
|
|
1955
1979
|
cursor: not-allowed;
|
|
1956
1980
|
color: var(--gray-400);
|
|
1981
|
+
border-color: var(--gray-200);
|
|
1957
1982
|
}
|
|
1958
1983
|
|
|
1959
1984
|
> p {
|
|
@@ -2947,6 +2972,8 @@ var variableValue = css9`
|
|
|
2947
2972
|
|
|
2948
2973
|
// src/components/Variables/VariablesList.tsx
|
|
2949
2974
|
import { Fragment as Fragment8, jsx as jsx33, jsxs as jsxs16 } from "@emotion/react/jsx-runtime";
|
|
2975
|
+
var DroppableHack = Droppable;
|
|
2976
|
+
var DraggableHack = Draggable;
|
|
2950
2977
|
function VariablesList() {
|
|
2951
2978
|
const { variables, dispatch, readOnly } = useVariables();
|
|
2952
2979
|
const sorted = variablesToList(variables).filter((variable) => !variable.system);
|
|
@@ -2968,7 +2995,7 @@ function VariablesList() {
|
|
|
2968
2995
|
}
|
|
2969
2996
|
};
|
|
2970
2997
|
return /* @__PURE__ */ jsxs16(Fragment8, { children: [
|
|
2971
|
-
/* @__PURE__ */ jsx33(DragDropContext, { onDragEnd: (res) => onDragEnd(res), children: /* @__PURE__ */ jsx33(
|
|
2998
|
+
/* @__PURE__ */ jsx33(DragDropContext, { onDragEnd: (res) => onDragEnd(res), children: /* @__PURE__ */ jsx33(DroppableHack, { droppableId: "variables-table", children: (provided) => /* @__PURE__ */ jsxs16(Table, { ...provided.droppableProps, ref: provided.innerRef, children: [
|
|
2972
2999
|
/* @__PURE__ */ jsx33(TableHead, { children: /* @__PURE__ */ jsxs16(TableRow, { children: [
|
|
2973
3000
|
/* @__PURE__ */ jsx33(TableCellHead, { children: "Name" }),
|
|
2974
3001
|
/* @__PURE__ */ jsx33(TableCellHead, { children: "Default Value" }),
|
|
@@ -2979,7 +3006,7 @@ function VariablesList() {
|
|
|
2979
3006
|
const text = displayName != null ? displayName : name2;
|
|
2980
3007
|
const textValue = variableDefaultTextValue(defaultValue);
|
|
2981
3008
|
return /* @__PURE__ */ jsx33(
|
|
2982
|
-
|
|
3009
|
+
DraggableHack,
|
|
2983
3010
|
{
|
|
2984
3011
|
draggableId: name2,
|
|
2985
3012
|
index,
|
|
@@ -3594,8 +3621,8 @@ function urlEncodeRequestParameter(parameter, varValues) {
|
|
|
3594
3621
|
value: decodeVariablesInUrlEncodedString(encodeURIComponent(parameter.value), varValues)
|
|
3595
3622
|
};
|
|
3596
3623
|
}
|
|
3597
|
-
function decodeVariablesInUrlEncodedString(
|
|
3598
|
-
return
|
|
3624
|
+
function decodeVariablesInUrlEncodedString(string2, varValues) {
|
|
3625
|
+
return string2.replace(/(\$|%24)%7B(.*?)%7D/g, (_all, _money, body) => {
|
|
3599
3626
|
var _a;
|
|
3600
3627
|
const varName = decodeURIComponent(body);
|
|
3601
3628
|
return ((_a = varValues == null ? void 0 : varValues[varName]) == null ? void 0 : _a.default) ? variableDefaultTextValue(varValues[varName].default) : `\${${varName}}`;
|
|
@@ -4202,7 +4229,7 @@ var ObjectSearchListItem = ({
|
|
|
4202
4229
|
),
|
|
4203
4230
|
/* @__PURE__ */ jsxs23("div", { css: ObjectListItemInfoContainer, children: [
|
|
4204
4231
|
selected ? /* @__PURE__ */ jsx49(Chip, { text: "selected", size: "xs" }) : null,
|
|
4205
|
-
!popoverData ? null : /* @__PURE__ */ jsx49(Popover, { ariaLabel: title, buttonText: `See ${title} details`,
|
|
4232
|
+
!popoverData ? null : /* @__PURE__ */ jsx49(Popover, { ariaLabel: title, buttonText: `See ${title} details`, children: popoverData })
|
|
4206
4233
|
] }),
|
|
4207
4234
|
!children ? null : /* @__PURE__ */ jsx49("div", { css: ObjectListItemUnControlledContent, children })
|
|
4208
4235
|
]
|
|
@@ -4232,7 +4259,6 @@ var ObjectSearchContainer = ({
|
|
|
4232
4259
|
role: "list",
|
|
4233
4260
|
css: css16`
|
|
4234
4261
|
> div {
|
|
4235
|
-
transition: max-height var(--duration-slow) var(--timing-ease-out);
|
|
4236
4262
|
max-height: ${selectedListItems.length === 0 ? "50vh" : "184px"};
|
|
4237
4263
|
}
|
|
4238
4264
|
`,
|
|
@@ -4627,7 +4653,10 @@ function legacyThemeMapper(theme) {
|
|
|
4627
4653
|
|
|
4628
4654
|
// src/components/ObjectSearch/ObjectSearchResultList.tsx
|
|
4629
4655
|
import { Button as Button4, Counter } from "@uniformdev/design-system";
|
|
4630
|
-
import {
|
|
4656
|
+
import {
|
|
4657
|
+
Draggable as Draggable2,
|
|
4658
|
+
Droppable as Droppable2
|
|
4659
|
+
} from "react-beautiful-dnd";
|
|
4631
4660
|
|
|
4632
4661
|
// src/components/ObjectSearch/styles/ObjectSearchResultList.styles.ts
|
|
4633
4662
|
import { css as css20 } from "@emotion/react";
|
|
@@ -4656,6 +4685,8 @@ var ObjectSearchResultListTitle = css20`
|
|
|
4656
4685
|
|
|
4657
4686
|
// src/components/ObjectSearch/ObjectSearchResultList.tsx
|
|
4658
4687
|
import { Fragment as Fragment10, jsx as jsx56, jsxs as jsxs28 } from "@emotion/react/jsx-runtime";
|
|
4688
|
+
var DroppableHack2 = Droppable2;
|
|
4689
|
+
var DraggableHack2 = Draggable2;
|
|
4659
4690
|
function ObjectSearchResultList({
|
|
4660
4691
|
resultLabelText = "Selected",
|
|
4661
4692
|
removeButtonText = "Remove all",
|
|
@@ -4727,7 +4758,7 @@ function ObjectSearchResultList({
|
|
|
4727
4758
|
] })
|
|
4728
4759
|
] }),
|
|
4729
4760
|
!selectedListItems.length ? whenNothingSelected : /* @__PURE__ */ jsx56(DragDropContext, { onDragEnd: (res) => onDragEnd(res), children: /* @__PURE__ */ jsx56(
|
|
4730
|
-
|
|
4761
|
+
DroppableHack2,
|
|
4731
4762
|
{
|
|
4732
4763
|
droppableId: multiSelectId != null ? multiSelectId : "canvas-multi-select",
|
|
4733
4764
|
renderClone: getContainerForDnDReparenting ? getDraggableItem : void 0,
|
|
@@ -4735,7 +4766,7 @@ function ObjectSearchResultList({
|
|
|
4735
4766
|
children: (provided) => /* @__PURE__ */ jsxs28("div", { ...provided.droppableProps, ref: provided.innerRef, children: [
|
|
4736
4767
|
selectedListItems.map((item, i) => {
|
|
4737
4768
|
return /* @__PURE__ */ jsx56(
|
|
4738
|
-
|
|
4769
|
+
DraggableHack2,
|
|
4739
4770
|
{
|
|
4740
4771
|
draggableId: item.id,
|
|
4741
4772
|
index: i,
|
package/dist/index.js
CHANGED
|
@@ -920,7 +920,7 @@ var import_zod = require("@hookform/resolvers/zod");
|
|
|
920
920
|
var import_design_system4 = require("@uniformdev/design-system");
|
|
921
921
|
var import_react12 = require("react");
|
|
922
922
|
var import_react_hook_form = require("react-hook-form");
|
|
923
|
-
var
|
|
923
|
+
var z = __toESM(require("zod"));
|
|
924
924
|
|
|
925
925
|
// src/components/Variables/styles/VariableEditor.styles.ts
|
|
926
926
|
var import_react11 = require("@emotion/react");
|
|
@@ -932,13 +932,13 @@ var variablesFormContainer = import_react11.css`
|
|
|
932
932
|
|
|
933
933
|
// src/components/Variables/VariableEditor.tsx
|
|
934
934
|
var import_jsx_runtime18 = require("@emotion/react/jsx-runtime");
|
|
935
|
-
var schema =
|
|
936
|
-
name:
|
|
937
|
-
default:
|
|
938
|
-
displayName:
|
|
939
|
-
helpText:
|
|
940
|
-
order:
|
|
941
|
-
type:
|
|
935
|
+
var schema = z.object({
|
|
936
|
+
name: z.string().nonempty("Name can't be empty").regex(/^[^${}]+$/, "$, {, and } are reserved characters and cannot be used in a variable name"),
|
|
937
|
+
default: z.string(),
|
|
938
|
+
displayName: z.string().optional(),
|
|
939
|
+
helpText: z.string().optional(),
|
|
940
|
+
order: z.number().optional(),
|
|
941
|
+
type: z.string().optional()
|
|
942
942
|
});
|
|
943
943
|
function VariableEditor({
|
|
944
944
|
variable,
|
|
@@ -1762,6 +1762,14 @@ var VariableNode = class _VariableNode extends import_lexical5.DecoratorNode {
|
|
|
1762
1762
|
updateDOM() {
|
|
1763
1763
|
return false;
|
|
1764
1764
|
}
|
|
1765
|
+
static importDOM() {
|
|
1766
|
+
return {
|
|
1767
|
+
binding: () => ({
|
|
1768
|
+
conversion: $convertBindingElement,
|
|
1769
|
+
priority: 0
|
|
1770
|
+
})
|
|
1771
|
+
};
|
|
1772
|
+
}
|
|
1765
1773
|
/**
|
|
1766
1774
|
* Render the variable node using React.
|
|
1767
1775
|
* NOTE: this is effectively an island of React, and you may not call hooks,
|
|
@@ -1771,6 +1779,21 @@ var VariableNode = class _VariableNode extends import_lexical5.DecoratorNode {
|
|
|
1771
1779
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(VariableNodeComponent, { state: this.__state, reference: this.reference, nodeKey: this.__key });
|
|
1772
1780
|
}
|
|
1773
1781
|
};
|
|
1782
|
+
function $convertBindingElement(domNode) {
|
|
1783
|
+
const element = domNode;
|
|
1784
|
+
const reference = element.textContent.replace(variablePrefix, "").replace(variableSuffix, "");
|
|
1785
|
+
const node = $createVariableNode(reference, {
|
|
1786
|
+
displayName: prettifyBindExpression(reference),
|
|
1787
|
+
hasClickEvent: true,
|
|
1788
|
+
referenceIsValid: true,
|
|
1789
|
+
tooltip: void 0,
|
|
1790
|
+
isFresh: true,
|
|
1791
|
+
isLoading: false
|
|
1792
|
+
});
|
|
1793
|
+
return {
|
|
1794
|
+
node
|
|
1795
|
+
};
|
|
1796
|
+
}
|
|
1774
1797
|
function $createVariableNode(variableReference, state) {
|
|
1775
1798
|
return new VariableNode(variableReference, state);
|
|
1776
1799
|
}
|
|
@@ -2085,6 +2108,7 @@ var input2 = import_react19.css`
|
|
|
2085
2108
|
&:disabled,
|
|
2086
2109
|
&:disabled::placeholder,
|
|
2087
2110
|
&:disabled:hover {
|
|
2111
|
+
border-color: var(--gray-200);
|
|
2088
2112
|
border-radius: var(--rounded-sm);
|
|
2089
2113
|
cursor: not-allowed;
|
|
2090
2114
|
color: var(--gray-400);
|
|
@@ -2094,6 +2118,7 @@ var input2 = import_react19.css`
|
|
|
2094
2118
|
&[contenteditable='false'] {
|
|
2095
2119
|
cursor: not-allowed;
|
|
2096
2120
|
color: var(--gray-400);
|
|
2121
|
+
border-color: var(--gray-200);
|
|
2097
2122
|
}
|
|
2098
2123
|
|
|
2099
2124
|
> p {
|
|
@@ -3065,6 +3090,8 @@ var variableValue = import_react34.css`
|
|
|
3065
3090
|
|
|
3066
3091
|
// src/components/Variables/VariablesList.tsx
|
|
3067
3092
|
var import_jsx_runtime32 = require("@emotion/react/jsx-runtime");
|
|
3093
|
+
var DroppableHack = import_react_beautiful_dnd2.Droppable;
|
|
3094
|
+
var DraggableHack = import_react_beautiful_dnd2.Draggable;
|
|
3068
3095
|
function VariablesList() {
|
|
3069
3096
|
const { variables, dispatch, readOnly } = useVariables();
|
|
3070
3097
|
const sorted = variablesToList(variables).filter((variable) => !variable.system);
|
|
@@ -3086,7 +3113,7 @@ function VariablesList() {
|
|
|
3086
3113
|
}
|
|
3087
3114
|
};
|
|
3088
3115
|
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
3089
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(DragDropContext, { onDragEnd: (res) => onDragEnd(res), children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3116
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(DragDropContext, { onDragEnd: (res) => onDragEnd(res), children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(DroppableHack, { droppableId: "variables-table", children: (provided) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_design_system13.Table, { ...provided.droppableProps, ref: provided.innerRef, children: [
|
|
3090
3117
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system13.TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_design_system13.TableRow, { children: [
|
|
3091
3118
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system13.TableCellHead, { children: "Name" }),
|
|
3092
3119
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system13.TableCellHead, { children: "Default Value" }),
|
|
@@ -3097,7 +3124,7 @@ function VariablesList() {
|
|
|
3097
3124
|
const text = displayName != null ? displayName : name2;
|
|
3098
3125
|
const textValue = variableDefaultTextValue(defaultValue);
|
|
3099
3126
|
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3100
|
-
|
|
3127
|
+
DraggableHack,
|
|
3101
3128
|
{
|
|
3102
3129
|
draggableId: name2,
|
|
3103
3130
|
index,
|
|
@@ -3692,8 +3719,8 @@ function urlEncodeRequestParameter(parameter, varValues) {
|
|
|
3692
3719
|
value: decodeVariablesInUrlEncodedString(encodeURIComponent(parameter.value), varValues)
|
|
3693
3720
|
};
|
|
3694
3721
|
}
|
|
3695
|
-
function decodeVariablesInUrlEncodedString(
|
|
3696
|
-
return
|
|
3722
|
+
function decodeVariablesInUrlEncodedString(string2, varValues) {
|
|
3723
|
+
return string2.replace(/(\$|%24)%7B(.*?)%7D/g, (_all, _money, body) => {
|
|
3697
3724
|
var _a;
|
|
3698
3725
|
const varName = decodeURIComponent(body);
|
|
3699
3726
|
return ((_a = varValues == null ? void 0 : varValues[varName]) == null ? void 0 : _a.default) ? variableDefaultTextValue(varValues[varName].default) : `\${${varName}}`;
|
|
@@ -4293,7 +4320,7 @@ var ObjectSearchListItem = ({
|
|
|
4293
4320
|
),
|
|
4294
4321
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { css: ObjectListItemInfoContainer, children: [
|
|
4295
4322
|
selected ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_design_system22.Chip, { text: "selected", size: "xs" }) : null,
|
|
4296
|
-
!popoverData ? null : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_design_system22.Popover, { ariaLabel: title, buttonText: `See ${title} details`,
|
|
4323
|
+
!popoverData ? null : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_design_system22.Popover, { ariaLabel: title, buttonText: `See ${title} details`, children: popoverData })
|
|
4297
4324
|
] }),
|
|
4298
4325
|
!children ? null : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { css: ObjectListItemUnControlledContent, children })
|
|
4299
4326
|
]
|
|
@@ -4323,7 +4350,6 @@ var ObjectSearchContainer = ({
|
|
|
4323
4350
|
role: "list",
|
|
4324
4351
|
css: import_react45.css`
|
|
4325
4352
|
> div {
|
|
4326
|
-
transition: max-height var(--duration-slow) var(--timing-ease-out);
|
|
4327
4353
|
max-height: ${selectedListItems.length === 0 ? "50vh" : "184px"};
|
|
4328
4354
|
}
|
|
4329
4355
|
`,
|
|
@@ -4747,6 +4773,8 @@ var ObjectSearchResultListTitle = import_react50.css`
|
|
|
4747
4773
|
|
|
4748
4774
|
// src/components/ObjectSearch/ObjectSearchResultList.tsx
|
|
4749
4775
|
var import_jsx_runtime55 = require("@emotion/react/jsx-runtime");
|
|
4776
|
+
var DroppableHack2 = import_react_beautiful_dnd3.Droppable;
|
|
4777
|
+
var DraggableHack2 = import_react_beautiful_dnd3.Draggable;
|
|
4750
4778
|
function ObjectSearchResultList({
|
|
4751
4779
|
resultLabelText = "Selected",
|
|
4752
4780
|
removeButtonText = "Remove all",
|
|
@@ -4818,7 +4846,7 @@ function ObjectSearchResultList({
|
|
|
4818
4846
|
] })
|
|
4819
4847
|
] }),
|
|
4820
4848
|
!selectedListItems.length ? whenNothingSelected : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(DragDropContext, { onDragEnd: (res) => onDragEnd(res), children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
4821
|
-
|
|
4849
|
+
DroppableHack2,
|
|
4822
4850
|
{
|
|
4823
4851
|
droppableId: multiSelectId != null ? multiSelectId : "canvas-multi-select",
|
|
4824
4852
|
renderClone: getContainerForDnDReparenting ? getDraggableItem : void 0,
|
|
@@ -4826,7 +4854,7 @@ function ObjectSearchResultList({
|
|
|
4826
4854
|
children: (provided) => /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { ...provided.droppableProps, ref: provided.innerRef, children: [
|
|
4827
4855
|
selectedListItems.map((item, i) => {
|
|
4828
4856
|
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
4829
|
-
|
|
4857
|
+
DraggableHack2,
|
|
4830
4858
|
{
|
|
4831
4859
|
draggableId: item.id,
|
|
4832
4860
|
index: i,
|
package/dist/index.mjs
CHANGED
|
@@ -774,7 +774,7 @@ import { zodResolver } from "@hookform/resolvers/zod";
|
|
|
774
774
|
import { Button, Callout, HorizontalRhythm, Input, useShortcut } from "@uniformdev/design-system";
|
|
775
775
|
import { useLayoutEffect, useRef as useRef2 } from "react";
|
|
776
776
|
import { useForm } from "react-hook-form";
|
|
777
|
-
import
|
|
777
|
+
import * as z from "zod";
|
|
778
778
|
|
|
779
779
|
// src/components/Variables/styles/VariableEditor.styles.ts
|
|
780
780
|
import { css as css2 } from "@emotion/react";
|
|
@@ -1616,6 +1616,14 @@ var VariableNode = class _VariableNode extends DecoratorNode {
|
|
|
1616
1616
|
updateDOM() {
|
|
1617
1617
|
return false;
|
|
1618
1618
|
}
|
|
1619
|
+
static importDOM() {
|
|
1620
|
+
return {
|
|
1621
|
+
binding: () => ({
|
|
1622
|
+
conversion: $convertBindingElement,
|
|
1623
|
+
priority: 0
|
|
1624
|
+
})
|
|
1625
|
+
};
|
|
1626
|
+
}
|
|
1619
1627
|
/**
|
|
1620
1628
|
* Render the variable node using React.
|
|
1621
1629
|
* NOTE: this is effectively an island of React, and you may not call hooks,
|
|
@@ -1625,6 +1633,21 @@ var VariableNode = class _VariableNode extends DecoratorNode {
|
|
|
1625
1633
|
return /* @__PURE__ */ jsx22(VariableNodeComponent, { state: this.__state, reference: this.reference, nodeKey: this.__key });
|
|
1626
1634
|
}
|
|
1627
1635
|
};
|
|
1636
|
+
function $convertBindingElement(domNode) {
|
|
1637
|
+
const element = domNode;
|
|
1638
|
+
const reference = element.textContent.replace(variablePrefix, "").replace(variableSuffix, "");
|
|
1639
|
+
const node = $createVariableNode(reference, {
|
|
1640
|
+
displayName: prettifyBindExpression(reference),
|
|
1641
|
+
hasClickEvent: true,
|
|
1642
|
+
referenceIsValid: true,
|
|
1643
|
+
tooltip: void 0,
|
|
1644
|
+
isFresh: true,
|
|
1645
|
+
isLoading: false
|
|
1646
|
+
});
|
|
1647
|
+
return {
|
|
1648
|
+
node
|
|
1649
|
+
};
|
|
1650
|
+
}
|
|
1628
1651
|
function $createVariableNode(variableReference, state) {
|
|
1629
1652
|
return new VariableNode(variableReference, state);
|
|
1630
1653
|
}
|
|
@@ -1945,6 +1968,7 @@ var input2 = css5`
|
|
|
1945
1968
|
&:disabled,
|
|
1946
1969
|
&:disabled::placeholder,
|
|
1947
1970
|
&:disabled:hover {
|
|
1971
|
+
border-color: var(--gray-200);
|
|
1948
1972
|
border-radius: var(--rounded-sm);
|
|
1949
1973
|
cursor: not-allowed;
|
|
1950
1974
|
color: var(--gray-400);
|
|
@@ -1954,6 +1978,7 @@ var input2 = css5`
|
|
|
1954
1978
|
&[contenteditable='false'] {
|
|
1955
1979
|
cursor: not-allowed;
|
|
1956
1980
|
color: var(--gray-400);
|
|
1981
|
+
border-color: var(--gray-200);
|
|
1957
1982
|
}
|
|
1958
1983
|
|
|
1959
1984
|
> p {
|
|
@@ -2947,6 +2972,8 @@ var variableValue = css9`
|
|
|
2947
2972
|
|
|
2948
2973
|
// src/components/Variables/VariablesList.tsx
|
|
2949
2974
|
import { Fragment as Fragment8, jsx as jsx33, jsxs as jsxs16 } from "@emotion/react/jsx-runtime";
|
|
2975
|
+
var DroppableHack = Droppable;
|
|
2976
|
+
var DraggableHack = Draggable;
|
|
2950
2977
|
function VariablesList() {
|
|
2951
2978
|
const { variables, dispatch, readOnly } = useVariables();
|
|
2952
2979
|
const sorted = variablesToList(variables).filter((variable) => !variable.system);
|
|
@@ -2968,7 +2995,7 @@ function VariablesList() {
|
|
|
2968
2995
|
}
|
|
2969
2996
|
};
|
|
2970
2997
|
return /* @__PURE__ */ jsxs16(Fragment8, { children: [
|
|
2971
|
-
/* @__PURE__ */ jsx33(DragDropContext, { onDragEnd: (res) => onDragEnd(res), children: /* @__PURE__ */ jsx33(
|
|
2998
|
+
/* @__PURE__ */ jsx33(DragDropContext, { onDragEnd: (res) => onDragEnd(res), children: /* @__PURE__ */ jsx33(DroppableHack, { droppableId: "variables-table", children: (provided) => /* @__PURE__ */ jsxs16(Table, { ...provided.droppableProps, ref: provided.innerRef, children: [
|
|
2972
2999
|
/* @__PURE__ */ jsx33(TableHead, { children: /* @__PURE__ */ jsxs16(TableRow, { children: [
|
|
2973
3000
|
/* @__PURE__ */ jsx33(TableCellHead, { children: "Name" }),
|
|
2974
3001
|
/* @__PURE__ */ jsx33(TableCellHead, { children: "Default Value" }),
|
|
@@ -2979,7 +3006,7 @@ function VariablesList() {
|
|
|
2979
3006
|
const text = displayName != null ? displayName : name2;
|
|
2980
3007
|
const textValue = variableDefaultTextValue(defaultValue);
|
|
2981
3008
|
return /* @__PURE__ */ jsx33(
|
|
2982
|
-
|
|
3009
|
+
DraggableHack,
|
|
2983
3010
|
{
|
|
2984
3011
|
draggableId: name2,
|
|
2985
3012
|
index,
|
|
@@ -3594,8 +3621,8 @@ function urlEncodeRequestParameter(parameter, varValues) {
|
|
|
3594
3621
|
value: decodeVariablesInUrlEncodedString(encodeURIComponent(parameter.value), varValues)
|
|
3595
3622
|
};
|
|
3596
3623
|
}
|
|
3597
|
-
function decodeVariablesInUrlEncodedString(
|
|
3598
|
-
return
|
|
3624
|
+
function decodeVariablesInUrlEncodedString(string2, varValues) {
|
|
3625
|
+
return string2.replace(/(\$|%24)%7B(.*?)%7D/g, (_all, _money, body) => {
|
|
3599
3626
|
var _a;
|
|
3600
3627
|
const varName = decodeURIComponent(body);
|
|
3601
3628
|
return ((_a = varValues == null ? void 0 : varValues[varName]) == null ? void 0 : _a.default) ? variableDefaultTextValue(varValues[varName].default) : `\${${varName}}`;
|
|
@@ -4202,7 +4229,7 @@ var ObjectSearchListItem = ({
|
|
|
4202
4229
|
),
|
|
4203
4230
|
/* @__PURE__ */ jsxs23("div", { css: ObjectListItemInfoContainer, children: [
|
|
4204
4231
|
selected ? /* @__PURE__ */ jsx49(Chip, { text: "selected", size: "xs" }) : null,
|
|
4205
|
-
!popoverData ? null : /* @__PURE__ */ jsx49(Popover, { ariaLabel: title, buttonText: `See ${title} details`,
|
|
4232
|
+
!popoverData ? null : /* @__PURE__ */ jsx49(Popover, { ariaLabel: title, buttonText: `See ${title} details`, children: popoverData })
|
|
4206
4233
|
] }),
|
|
4207
4234
|
!children ? null : /* @__PURE__ */ jsx49("div", { css: ObjectListItemUnControlledContent, children })
|
|
4208
4235
|
]
|
|
@@ -4232,7 +4259,6 @@ var ObjectSearchContainer = ({
|
|
|
4232
4259
|
role: "list",
|
|
4233
4260
|
css: css16`
|
|
4234
4261
|
> div {
|
|
4235
|
-
transition: max-height var(--duration-slow) var(--timing-ease-out);
|
|
4236
4262
|
max-height: ${selectedListItems.length === 0 ? "50vh" : "184px"};
|
|
4237
4263
|
}
|
|
4238
4264
|
`,
|
|
@@ -4627,7 +4653,10 @@ function legacyThemeMapper(theme) {
|
|
|
4627
4653
|
|
|
4628
4654
|
// src/components/ObjectSearch/ObjectSearchResultList.tsx
|
|
4629
4655
|
import { Button as Button4, Counter } from "@uniformdev/design-system";
|
|
4630
|
-
import {
|
|
4656
|
+
import {
|
|
4657
|
+
Draggable as Draggable2,
|
|
4658
|
+
Droppable as Droppable2
|
|
4659
|
+
} from "react-beautiful-dnd";
|
|
4631
4660
|
|
|
4632
4661
|
// src/components/ObjectSearch/styles/ObjectSearchResultList.styles.ts
|
|
4633
4662
|
import { css as css20 } from "@emotion/react";
|
|
@@ -4656,6 +4685,8 @@ var ObjectSearchResultListTitle = css20`
|
|
|
4656
4685
|
|
|
4657
4686
|
// src/components/ObjectSearch/ObjectSearchResultList.tsx
|
|
4658
4687
|
import { Fragment as Fragment10, jsx as jsx56, jsxs as jsxs28 } from "@emotion/react/jsx-runtime";
|
|
4688
|
+
var DroppableHack2 = Droppable2;
|
|
4689
|
+
var DraggableHack2 = Draggable2;
|
|
4659
4690
|
function ObjectSearchResultList({
|
|
4660
4691
|
resultLabelText = "Selected",
|
|
4661
4692
|
removeButtonText = "Remove all",
|
|
@@ -4727,7 +4758,7 @@ function ObjectSearchResultList({
|
|
|
4727
4758
|
] })
|
|
4728
4759
|
] }),
|
|
4729
4760
|
!selectedListItems.length ? whenNothingSelected : /* @__PURE__ */ jsx56(DragDropContext, { onDragEnd: (res) => onDragEnd(res), children: /* @__PURE__ */ jsx56(
|
|
4730
|
-
|
|
4761
|
+
DroppableHack2,
|
|
4731
4762
|
{
|
|
4732
4763
|
droppableId: multiSelectId != null ? multiSelectId : "canvas-multi-select",
|
|
4733
4764
|
renderClone: getContainerForDnDReparenting ? getDraggableItem : void 0,
|
|
@@ -4735,7 +4766,7 @@ function ObjectSearchResultList({
|
|
|
4735
4766
|
children: (provided) => /* @__PURE__ */ jsxs28("div", { ...provided.droppableProps, ref: provided.innerRef, children: [
|
|
4736
4767
|
selectedListItems.map((item, i) => {
|
|
4737
4768
|
return /* @__PURE__ */ jsx56(
|
|
4738
|
-
|
|
4769
|
+
DraggableHack2,
|
|
4739
4770
|
{
|
|
4740
4771
|
draggableId: item.id,
|
|
4741
4772
|
index: i,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/mesh-sdk-react",
|
|
3
|
-
"version": "20.31.1-alpha.
|
|
3
|
+
"version": "20.31.1-alpha.184+835e8acbd8",
|
|
4
4
|
"description": "Uniform Mesh Framework SDK for React",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"@lexical/selection": "0.25.0",
|
|
51
51
|
"@lexical/utils": "0.25.0",
|
|
52
52
|
"@react-icons/all-files": "https://github.com/react-icons/react-icons/releases/download/v5.5.0/react-icons-all-files-5.5.0.tgz",
|
|
53
|
-
"@uniformdev/canvas": "20.31.1-alpha.
|
|
54
|
-
"@uniformdev/design-system": "20.31.1-alpha.
|
|
55
|
-
"@uniformdev/mesh-sdk": "20.31.1-alpha.
|
|
56
|
-
"@uniformdev/richtext": "20.31.1-alpha.
|
|
53
|
+
"@uniformdev/canvas": "20.31.1-alpha.184+835e8acbd8",
|
|
54
|
+
"@uniformdev/design-system": "20.31.1-alpha.184+835e8acbd8",
|
|
55
|
+
"@uniformdev/mesh-sdk": "20.31.1-alpha.184+835e8acbd8",
|
|
56
|
+
"@uniformdev/richtext": "20.31.1-alpha.184+835e8acbd8",
|
|
57
57
|
"dequal": "^2.0.3",
|
|
58
58
|
"lexical": "0.25.0",
|
|
59
59
|
"mitt": "3.0.1",
|
|
@@ -73,9 +73,9 @@
|
|
|
73
73
|
"@emotion/react": "11.13.5",
|
|
74
74
|
"@storybook/react": "8.3.3",
|
|
75
75
|
"@svgr/cli": "6.5.1",
|
|
76
|
-
"@types/react": "18.3.
|
|
76
|
+
"@types/react": "18.3.24",
|
|
77
77
|
"@types/react-beautiful-dnd": "13.1.8",
|
|
78
|
-
"@types/react-dom": "18.3.
|
|
78
|
+
"@types/react-dom": "18.3.7",
|
|
79
79
|
"@types/uuid": "9.0.4",
|
|
80
80
|
"react": "18.3.1",
|
|
81
81
|
"react-dom": "18.3.1"
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"publishConfig": {
|
|
87
87
|
"access": "public"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "835e8acbd8a6c86466d265ed931634e9838f023f"
|
|
90
90
|
}
|