@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.esm.js
CHANGED
|
@@ -471,14 +471,14 @@ function deserializeVariablesEditorState(serialized) {
|
|
|
471
471
|
children: [
|
|
472
472
|
{
|
|
473
473
|
children: result,
|
|
474
|
-
direction:
|
|
474
|
+
direction: null,
|
|
475
475
|
format: "",
|
|
476
476
|
indent: 0,
|
|
477
477
|
type: "paragraph",
|
|
478
478
|
version: 1
|
|
479
479
|
}
|
|
480
480
|
],
|
|
481
|
-
direction:
|
|
481
|
+
direction: null,
|
|
482
482
|
format: "",
|
|
483
483
|
indent: 0,
|
|
484
484
|
type: "root",
|
|
@@ -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 * as z from "zod";
|
|
777
|
+
import * as z from "zod/v3";
|
|
778
778
|
|
|
779
779
|
// src/components/Variables/styles/VariableEditor.styles.ts
|
|
780
780
|
import { css as css2 } from "@emotion/react";
|
|
@@ -1146,18 +1146,17 @@ var DISCONNECT_VARIABLE_COMMAND = createCommand(
|
|
|
1146
1146
|
"uniform:disconnect-variable"
|
|
1147
1147
|
);
|
|
1148
1148
|
var INSERT_VARIABLE_COMMAND = createCommand("uniform:insert-variable");
|
|
1149
|
-
var
|
|
1150
|
-
var LENGTH_LIMIT = 20;
|
|
1151
|
-
var DollarSignVariablesRegex = new RegExp(`(^.*)(${TRIGGER}(.{0,${LENGTH_LIMIT}}))$`);
|
|
1149
|
+
var DollarSignVariablesRegex = /(^.*)(\$\$(.{0,20}))$/;
|
|
1152
1150
|
function getPossibleQueryMatch(text) {
|
|
1153
1151
|
const match = DollarSignVariablesRegex.exec(text);
|
|
1154
1152
|
if (match !== null) {
|
|
1155
1153
|
const maybeLeadingWhitespace = match[1];
|
|
1156
1154
|
const matchingString = match[3];
|
|
1155
|
+
const replaceableString = match[2];
|
|
1157
1156
|
return {
|
|
1158
1157
|
leadOffset: match.index + maybeLeadingWhitespace.length,
|
|
1159
1158
|
matchingString,
|
|
1160
|
-
replaceableString
|
|
1159
|
+
replaceableString
|
|
1161
1160
|
};
|
|
1162
1161
|
}
|
|
1163
1162
|
return null;
|
|
@@ -1244,7 +1243,8 @@ function VariablesPlugin({
|
|
|
1244
1243
|
enableEditingVariables,
|
|
1245
1244
|
getEditorContext,
|
|
1246
1245
|
replaceValueOnVariableInsert,
|
|
1247
|
-
filterVariable
|
|
1246
|
+
filterVariable,
|
|
1247
|
+
disableVariableDisplayNames
|
|
1248
1248
|
}) {
|
|
1249
1249
|
const [editor] = useLexicalComposerContext2();
|
|
1250
1250
|
const { variables, dispatch, isEditing, canDispatch, readOnly, knownUndefinedValues, isLoading } = useVariables(true);
|
|
@@ -1276,7 +1276,10 @@ function VariablesPlugin({
|
|
|
1276
1276
|
filteredGroupedVariables: groupedVariables.map((group) => ({
|
|
1277
1277
|
name: group.name,
|
|
1278
1278
|
variables: group.variables.filter(
|
|
1279
|
-
(option) =>
|
|
1279
|
+
(option) => {
|
|
1280
|
+
var _a;
|
|
1281
|
+
return option.name === ADD_VARIABLE_OPTION || option.name.toLowerCase().includes(query) || ((_a = option.displayName) == null ? void 0 : _a.toLowerCase().includes(query));
|
|
1282
|
+
}
|
|
1280
1283
|
)
|
|
1281
1284
|
})).filter((group) => group.variables.length > 0),
|
|
1282
1285
|
filteredMenuOptions: menuOptions.filter(
|
|
@@ -1322,9 +1325,10 @@ function VariablesPlugin({
|
|
|
1322
1325
|
});
|
|
1323
1326
|
return;
|
|
1324
1327
|
}
|
|
1328
|
+
const initialDisplayName = disableVariableDisplayNames ? prettifyBindExpression(result.selectedVariable.name) : result.selectedVariable.displayName;
|
|
1325
1329
|
editor.dispatchCommand(INSERT_VARIABLE_COMMAND, {
|
|
1326
1330
|
variable: result.selectedVariable.name,
|
|
1327
|
-
initialDisplayName
|
|
1331
|
+
initialDisplayName,
|
|
1328
1332
|
targetKey: sourceKey,
|
|
1329
1333
|
overwriteExistingValue: replaceValueOnVariableInsert
|
|
1330
1334
|
});
|
|
@@ -1372,9 +1376,10 @@ function VariablesPlugin({
|
|
|
1372
1376
|
if (result.canceled) {
|
|
1373
1377
|
return;
|
|
1374
1378
|
}
|
|
1379
|
+
const initialDisplayName = disableVariableDisplayNames ? prettifyBindExpression(result.selectedVariable.name) : result.selectedVariable.displayName;
|
|
1375
1380
|
editor.dispatchCommand(INSERT_VARIABLE_COMMAND, {
|
|
1376
1381
|
variable: result.selectedVariable.name,
|
|
1377
|
-
initialDisplayName
|
|
1382
|
+
initialDisplayName,
|
|
1378
1383
|
targetKey: void 0,
|
|
1379
1384
|
overwriteExistingValue: replaceValueOnVariableInsert
|
|
1380
1385
|
});
|
|
@@ -1393,8 +1398,9 @@ function VariablesPlugin({
|
|
|
1393
1398
|
var _a, _b;
|
|
1394
1399
|
if (!disableVariables) {
|
|
1395
1400
|
const targetVariable = variablesRef.current.variables[reference];
|
|
1401
|
+
const displayName = disableVariableDisplayNames ? prettifyBindExpression(reference) : initialDisplayName != null ? initialDisplayName : (targetVariable == null ? void 0 : targetVariable.displayName) || prettifyBindExpression(reference);
|
|
1396
1402
|
const variableNode = $createVariableNode(reference, {
|
|
1397
|
-
displayName
|
|
1403
|
+
displayName,
|
|
1398
1404
|
hasClickEvent: canEditVariable(reference, targetVariable),
|
|
1399
1405
|
referenceIsValid: true,
|
|
1400
1406
|
tooltip: (_a = targetVariable == null ? void 0 : targetVariable.tooltip) != null ? _a : targetVariable == null ? void 0 : targetVariable.helpText,
|
|
@@ -1431,7 +1437,8 @@ function VariablesPlugin({
|
|
|
1431
1437
|
readOnly,
|
|
1432
1438
|
getEditorContext,
|
|
1433
1439
|
editVariable,
|
|
1434
|
-
replaceValueOnVariableInsert
|
|
1440
|
+
replaceValueOnVariableInsert,
|
|
1441
|
+
disableVariableDisplayNames
|
|
1435
1442
|
]);
|
|
1436
1443
|
const updateExistingNodeIfChanged = useCallback2(
|
|
1437
1444
|
(variableNode) => {
|
|
@@ -1444,9 +1451,10 @@ function VariablesPlugin({
|
|
|
1444
1451
|
return;
|
|
1445
1452
|
}
|
|
1446
1453
|
const tooltip = (_d = (_c = (_b = (_a = targetVar == null ? void 0 : targetVar.tooltip) != null ? _a : targetVar == null ? void 0 : targetVar.helpText) != null ? _b : targetUndefinedVar == null ? void 0 : targetUndefinedVar.error) != null ? _c : targetUndefinedVar == null ? void 0 : targetUndefinedVar.warning) != null ? _d : targetUndefinedVar == null ? void 0 : targetUndefinedVar.info;
|
|
1454
|
+
const displayName = disableVariableDisplayNames ? prettifyBindExpression(variableNode.reference) : (targetVar == null ? void 0 : targetVar.displayName) || (targetUndefinedVar == null ? void 0 : targetUndefinedVar.displayName) || prettifyBindExpression(variableNode.reference);
|
|
1447
1455
|
const newState = {
|
|
1448
1456
|
...currentState,
|
|
1449
|
-
displayName
|
|
1457
|
+
displayName,
|
|
1450
1458
|
isLoading: isLoadingVariables && !targetVar && !(targetUndefinedVar == null ? void 0 : targetUndefinedVar.info),
|
|
1451
1459
|
hasClickEvent: canEditVariable(variableNode.reference, targetVar),
|
|
1452
1460
|
referenceIsValid: (targetUndefinedVar == null ? void 0 : targetUndefinedVar.error) ? false : (targetUndefinedVar == null ? void 0 : targetUndefinedVar.warning) ? "warning" : (targetUndefinedVar == null ? void 0 : targetUndefinedVar.info) ? "info" : isLoadingVariables ? true : Boolean(targetVar),
|
|
@@ -1457,7 +1465,7 @@ function VariablesPlugin({
|
|
|
1457
1465
|
variableNode.setState(newState);
|
|
1458
1466
|
}
|
|
1459
1467
|
},
|
|
1460
|
-
[canEditVariable]
|
|
1468
|
+
[canEditVariable, disableVariableDisplayNames]
|
|
1461
1469
|
);
|
|
1462
1470
|
useEffect4(() => {
|
|
1463
1471
|
let selection;
|
|
@@ -1562,13 +1570,13 @@ var VariableNode = class _VariableNode extends DecoratorNode {
|
|
|
1562
1570
|
constructor(reference, state, key) {
|
|
1563
1571
|
super(key);
|
|
1564
1572
|
this.reference = reference;
|
|
1565
|
-
this.
|
|
1573
|
+
this.__variableState = state;
|
|
1566
1574
|
}
|
|
1567
1575
|
static getType() {
|
|
1568
1576
|
return "variable";
|
|
1569
1577
|
}
|
|
1570
1578
|
static clone(node) {
|
|
1571
|
-
return new _VariableNode(node.reference, { ...node.
|
|
1579
|
+
return new _VariableNode(node.reference, { ...node.__variableState }, node.__key);
|
|
1572
1580
|
}
|
|
1573
1581
|
/** Imports the node from serialized JSON (i.e. the data provided to the editor's initial state) */
|
|
1574
1582
|
static importJSON(serializedNode) {
|
|
@@ -1583,14 +1591,14 @@ var VariableNode = class _VariableNode extends DecoratorNode {
|
|
|
1583
1591
|
}
|
|
1584
1592
|
/** Gets the node's current state */
|
|
1585
1593
|
getState() {
|
|
1586
|
-
return this.getLatest().
|
|
1594
|
+
return this.getLatest().__variableState;
|
|
1587
1595
|
}
|
|
1588
1596
|
/**
|
|
1589
1597
|
* Updates the node's variables state so it knows its current validity, display name, etc
|
|
1590
1598
|
* The plugin updates this whenever the variables prop changes.
|
|
1591
1599
|
*/
|
|
1592
1600
|
setState(state) {
|
|
1593
|
-
this.getWritable().
|
|
1601
|
+
this.getWritable().__variableState = state;
|
|
1594
1602
|
}
|
|
1595
1603
|
/**
|
|
1596
1604
|
* Serializes the node to JSON for editor initial state
|
|
@@ -1616,15 +1624,38 @@ var VariableNode = class _VariableNode extends DecoratorNode {
|
|
|
1616
1624
|
updateDOM() {
|
|
1617
1625
|
return false;
|
|
1618
1626
|
}
|
|
1627
|
+
static importDOM() {
|
|
1628
|
+
return {
|
|
1629
|
+
binding: () => ({
|
|
1630
|
+
conversion: $convertBindingElement,
|
|
1631
|
+
priority: 0
|
|
1632
|
+
})
|
|
1633
|
+
};
|
|
1634
|
+
}
|
|
1619
1635
|
/**
|
|
1620
1636
|
* Render the variable node using React.
|
|
1621
1637
|
* NOTE: this is effectively an island of React, and you may not call hooks,
|
|
1622
1638
|
* rely on Context, etc in this renderer.
|
|
1623
1639
|
*/
|
|
1624
1640
|
decorate() {
|
|
1625
|
-
return /* @__PURE__ */ jsx22(VariableNodeComponent, { state: this.
|
|
1641
|
+
return /* @__PURE__ */ jsx22(VariableNodeComponent, { state: this.__variableState, reference: this.reference, nodeKey: this.__key });
|
|
1626
1642
|
}
|
|
1627
1643
|
};
|
|
1644
|
+
function $convertBindingElement(domNode) {
|
|
1645
|
+
const element = domNode;
|
|
1646
|
+
const reference = element.textContent.replace(variablePrefix, "").replace(variableSuffix, "");
|
|
1647
|
+
const node = $createVariableNode(reference, {
|
|
1648
|
+
displayName: prettifyBindExpression(reference),
|
|
1649
|
+
hasClickEvent: true,
|
|
1650
|
+
referenceIsValid: true,
|
|
1651
|
+
tooltip: void 0,
|
|
1652
|
+
isFresh: true,
|
|
1653
|
+
isLoading: false
|
|
1654
|
+
});
|
|
1655
|
+
return {
|
|
1656
|
+
node
|
|
1657
|
+
};
|
|
1658
|
+
}
|
|
1628
1659
|
function $createVariableNode(variableReference, state) {
|
|
1629
1660
|
return new VariableNode(variableReference, state);
|
|
1630
1661
|
}
|
|
@@ -1879,27 +1910,40 @@ var placeholderCompact = css4`
|
|
|
1879
1910
|
import { css as css5 } from "@emotion/react";
|
|
1880
1911
|
import { scrollbarStyles } from "@uniformdev/design-system";
|
|
1881
1912
|
var variableBindButton = css5`
|
|
1882
|
-
|
|
1883
|
-
|
|
1913
|
+
--hover-color: var(--accent-dark-hover);
|
|
1914
|
+
--active-color: var(--accent-dark-active);
|
|
1915
|
+
border: 1px solid transparent;
|
|
1884
1916
|
border-radius: var(--rounded-base);
|
|
1885
1917
|
background: none;
|
|
1918
|
+
color: var(--gray-300);
|
|
1886
1919
|
display: flex;
|
|
1887
|
-
|
|
1888
|
-
|
|
1920
|
+
align-items: center;
|
|
1921
|
+
justify-content: center;
|
|
1922
|
+
max-width: fit-content;
|
|
1923
|
+
padding: 0.125rem;
|
|
1889
1924
|
transition:
|
|
1925
|
+
border-color var(--duration-fast) var(--timing-ease-out),
|
|
1890
1926
|
background var(--duration-fast) var(--timing-ease-out),
|
|
1891
|
-
color var(--duration-fast) var(--timing-ease-out)
|
|
1892
|
-
|
|
1927
|
+
color var(--duration-fast) var(--timing-ease-out),
|
|
1928
|
+
box-shadow var(--duration-fast) var(--timing-ease-out);
|
|
1893
1929
|
|
|
1894
|
-
&:hover,
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
color: var(--
|
|
1930
|
+
&:hover:not([aria-disabled='true']),
|
|
1931
|
+
&:focus:not([aria-disabled='true']),
|
|
1932
|
+
&:focus-within:not([aria-disabled='true']) {
|
|
1933
|
+
color: var(--gray-500);
|
|
1934
|
+
border-color: var(--hover-color);
|
|
1935
|
+
}
|
|
1936
|
+
|
|
1937
|
+
&:active:not([aria-disabled='true']),
|
|
1938
|
+
&[aria-pressed='true']:not([aria-disabled='true']) {
|
|
1939
|
+
color: var(--active-color);
|
|
1898
1940
|
}
|
|
1899
1941
|
|
|
1900
1942
|
&[aria-disabled='true'] {
|
|
1901
1943
|
background: none;
|
|
1902
1944
|
color: currentColor;
|
|
1945
|
+
opacity: var(--opacity-50);
|
|
1946
|
+
cursor: default;
|
|
1903
1947
|
}
|
|
1904
1948
|
|
|
1905
1949
|
// fixes menu resizing issue within iframes
|
|
@@ -1945,6 +1989,7 @@ var input2 = css5`
|
|
|
1945
1989
|
&:disabled,
|
|
1946
1990
|
&:disabled::placeholder,
|
|
1947
1991
|
&:disabled:hover {
|
|
1992
|
+
border-color: var(--gray-200);
|
|
1948
1993
|
border-radius: var(--rounded-sm);
|
|
1949
1994
|
cursor: not-allowed;
|
|
1950
1995
|
color: var(--gray-400);
|
|
@@ -1954,6 +1999,7 @@ var input2 = css5`
|
|
|
1954
1999
|
&[contenteditable='false'] {
|
|
1955
2000
|
cursor: not-allowed;
|
|
1956
2001
|
color: var(--gray-400);
|
|
2002
|
+
border-color: var(--gray-200);
|
|
1957
2003
|
}
|
|
1958
2004
|
|
|
1959
2005
|
> p {
|
|
@@ -1971,8 +2017,7 @@ var inputMultiLine = (lines) => css5`
|
|
|
1971
2017
|
|
|
1972
2018
|
// src/components/Variables/toolbox/InputVariablesProvider.tsx
|
|
1973
2019
|
import { hasReferencedVariables } from "@uniformdev/canvas";
|
|
1974
|
-
import
|
|
1975
|
-
import { useMemo as useMemo7 } from "react";
|
|
2020
|
+
import { useEffect as useEffect7, useMemo as useMemo7, useState as useState5 } from "react";
|
|
1976
2021
|
function useInputVariablesState({
|
|
1977
2022
|
value,
|
|
1978
2023
|
onChange,
|
|
@@ -1988,14 +2033,14 @@ function useInputVariablesState({
|
|
|
1988
2033
|
}) {
|
|
1989
2034
|
const { variables } = useVariables(true);
|
|
1990
2035
|
const variableReferenceCountInValue = hasReferencedVariables(value != null ? value : "");
|
|
1991
|
-
const [lastKnownId, setLastKnownId] =
|
|
1992
|
-
const [hadVariablesInValue, setHadVariablesInValue] =
|
|
1993
|
-
|
|
2036
|
+
const [lastKnownId, setLastKnownId] = useState5(id);
|
|
2037
|
+
const [hadVariablesInValue, setHadVariablesInValue] = useState5(variableReferenceCountInValue > 0);
|
|
2038
|
+
useEffect7(() => {
|
|
1994
2039
|
if (variableReferenceCountInValue) {
|
|
1995
2040
|
setHadVariablesInValue(true);
|
|
1996
2041
|
}
|
|
1997
2042
|
}, [variableReferenceCountInValue]);
|
|
1998
|
-
|
|
2043
|
+
useEffect7(() => {
|
|
1999
2044
|
if (id !== lastKnownId) {
|
|
2000
2045
|
setLastKnownId(id);
|
|
2001
2046
|
setHadVariablesInValue(variableReferenceCountInValue > 0);
|
|
@@ -2045,30 +2090,6 @@ var labelText = css6`
|
|
|
2045
2090
|
font-weight: var(--fw-regular);
|
|
2046
2091
|
margin: 0 0 var(--spacing-xs);
|
|
2047
2092
|
`;
|
|
2048
|
-
var variableBindButton2 = css6`
|
|
2049
|
-
align-items: center;
|
|
2050
|
-
border: none;
|
|
2051
|
-
border-radius: var(--rounded-base);
|
|
2052
|
-
background: none;
|
|
2053
|
-
display: flex;
|
|
2054
|
-
height: 1.2rem;
|
|
2055
|
-
padding: var(--spacing-2xs);
|
|
2056
|
-
transition:
|
|
2057
|
-
background var(--duration-fast) var(--timing-ease-out),
|
|
2058
|
-
color var(--duration-fast) var(--timing-ease-out);
|
|
2059
|
-
width: 1.2rem;
|
|
2060
|
-
|
|
2061
|
-
&:hover,
|
|
2062
|
-
&[aria-pressed='true']:not(:disabled) {
|
|
2063
|
-
background: var(--brand-secondary-3);
|
|
2064
|
-
color: var(--white);
|
|
2065
|
-
}
|
|
2066
|
-
|
|
2067
|
-
&[aria-disabled='true'] {
|
|
2068
|
-
background: none;
|
|
2069
|
-
color: currentColor;
|
|
2070
|
-
}
|
|
2071
|
-
`;
|
|
2072
2093
|
|
|
2073
2094
|
// src/components/Variables/toolbox/VariablesComposerVariableMenu.tsx
|
|
2074
2095
|
import { useLexicalComposerContext as useLexicalComposerContext6 } from "@lexical/react/LexicalComposerContext";
|
|
@@ -2115,7 +2136,7 @@ function SelectVariableMenu({
|
|
|
2115
2136
|
css: [menuBtn, buttonCss],
|
|
2116
2137
|
type: "button",
|
|
2117
2138
|
"data-testid": "insert-variable",
|
|
2118
|
-
children: /* @__PURE__ */ jsx23(CgUsbC, { size: "
|
|
2139
|
+
children: /* @__PURE__ */ jsx23(CgUsbC, { size: "1rem" })
|
|
2119
2140
|
}
|
|
2120
2141
|
),
|
|
2121
2142
|
children: [
|
|
@@ -2208,7 +2229,7 @@ function VariableField({
|
|
|
2208
2229
|
VariablesComposerVariableMenu,
|
|
2209
2230
|
{
|
|
2210
2231
|
...selectVariableMenuOptions,
|
|
2211
|
-
buttonCss: [
|
|
2232
|
+
buttonCss: [variableBindButton, selectVariableMenuOptions == null ? void 0 : selectVariableMenuOptions.buttonCss],
|
|
2212
2233
|
buttonProps: isActive ? { "aria-pressed": "true" } : void 0
|
|
2213
2234
|
}
|
|
2214
2235
|
) }) : null;
|
|
@@ -2279,8 +2300,8 @@ function VariablesComposer(props) {
|
|
|
2279
2300
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2280
2301
|
[]
|
|
2281
2302
|
);
|
|
2282
|
-
const editorState = useRef5();
|
|
2283
|
-
const updateTimeout = useRef5();
|
|
2303
|
+
const editorState = useRef5(void 0);
|
|
2304
|
+
const updateTimeout = useRef5(void 0);
|
|
2284
2305
|
if (typeof document === "undefined") return null;
|
|
2285
2306
|
return /* @__PURE__ */ jsxs10(LexicalComposer, { initialConfig: editorConfig, children: [
|
|
2286
2307
|
/* @__PURE__ */ jsx26(
|
|
@@ -2321,7 +2342,7 @@ import {
|
|
|
2321
2342
|
} from "@lexical/clipboard";
|
|
2322
2343
|
import { useLexicalComposerContext as useLexicalComposerContext9 } from "@lexical/react/LexicalComposerContext";
|
|
2323
2344
|
import { ContentEditable } from "@lexical/react/LexicalContentEditable";
|
|
2324
|
-
import LexicalErrorBoundary from "@lexical/react/LexicalErrorBoundary";
|
|
2345
|
+
import { LexicalErrorBoundary } from "@lexical/react/LexicalErrorBoundary";
|
|
2325
2346
|
import { HistoryPlugin } from "@lexical/react/LexicalHistoryPlugin";
|
|
2326
2347
|
import { PlainTextPlugin } from "@lexical/react/LexicalPlainTextPlugin";
|
|
2327
2348
|
import { mergeRegister as mergeRegister4, objectKlassEquals } from "@lexical/utils";
|
|
@@ -2460,7 +2481,8 @@ function InputVariables(props) {
|
|
|
2460
2481
|
styleVariant = "default",
|
|
2461
2482
|
renderMenuInPortal,
|
|
2462
2483
|
disableDismissEditorOnChange,
|
|
2463
|
-
singleTokenMode
|
|
2484
|
+
singleTokenMode,
|
|
2485
|
+
disableVariableDisplayNames
|
|
2464
2486
|
} = props;
|
|
2465
2487
|
const [finalId] = useState7(id != null ? id : () => v4());
|
|
2466
2488
|
const { dispatch, canDispatch, isEditing } = useVariables(true);
|
|
@@ -2496,6 +2518,7 @@ function InputVariables(props) {
|
|
|
2496
2518
|
portal: renderMenuInPortal,
|
|
2497
2519
|
replaceValueOnVariableInsert: useInputWithNoVariables,
|
|
2498
2520
|
useInputWhenNoVariables: useInputWithNoVariables,
|
|
2521
|
+
isActive: hadVariablesInValue,
|
|
2499
2522
|
children: /* @__PURE__ */ jsx28(
|
|
2500
2523
|
VariablesComposerInput,
|
|
2501
2524
|
{
|
|
@@ -2569,6 +2592,7 @@ function InputVariables(props) {
|
|
|
2569
2592
|
replaceValueOnVariableInsert: useInputWithNoVariables,
|
|
2570
2593
|
autoFocus,
|
|
2571
2594
|
filterVariable,
|
|
2595
|
+
disableVariableDisplayNames,
|
|
2572
2596
|
children: [
|
|
2573
2597
|
/* @__PURE__ */ jsx28(PasteTransformerPlugin, { transformPaste }),
|
|
2574
2598
|
/* @__PURE__ */ jsx28(ControlledValuePlugin, { value, enabled: singleTokenMode || useInputWithNoVariables }),
|
|
@@ -2583,6 +2607,7 @@ function InputVariablesOverlayMenu({
|
|
|
2583
2607
|
disabled,
|
|
2584
2608
|
useInputWhenNoVariables,
|
|
2585
2609
|
portal,
|
|
2610
|
+
isActive,
|
|
2586
2611
|
...props
|
|
2587
2612
|
}) {
|
|
2588
2613
|
if (disabled) {
|
|
@@ -2596,7 +2621,8 @@ function InputVariablesOverlayMenu({
|
|
|
2596
2621
|
...props,
|
|
2597
2622
|
portal,
|
|
2598
2623
|
tip: useInputWhenNoVariables ? void 0 : "Tip: access this list by typing $$",
|
|
2599
|
-
buttonCss: menuBtn2
|
|
2624
|
+
buttonCss: [menuBtn2, variableBindButton],
|
|
2625
|
+
buttonProps: isActive ? { "aria-pressed": "true" } : void 0
|
|
2600
2626
|
}
|
|
2601
2627
|
)
|
|
2602
2628
|
] });
|
|
@@ -2649,7 +2675,7 @@ function ParameterConnectionIndicator({
|
|
|
2649
2675
|
css: [menuBtn, variableBindButton],
|
|
2650
2676
|
type: "button",
|
|
2651
2677
|
"data-testid": "insert-variable",
|
|
2652
|
-
children: /* @__PURE__ */ jsx29(CgUsbC2, { size: "
|
|
2678
|
+
children: /* @__PURE__ */ jsx29(CgUsbC2, { size: "1rem" })
|
|
2653
2679
|
}
|
|
2654
2680
|
)
|
|
2655
2681
|
}
|
|
@@ -2869,6 +2895,7 @@ ${prettifyBindExpression(bindExpression)}`
|
|
|
2869
2895
|
|
|
2870
2896
|
// src/components/Variables/VariablesList.tsx
|
|
2871
2897
|
import { css as css10 } from "@emotion/react";
|
|
2898
|
+
import { Draggable, Droppable } from "@hello-pangea/dnd";
|
|
2872
2899
|
import { CgTrash } from "@react-icons/all-files/cg/CgTrash";
|
|
2873
2900
|
import {
|
|
2874
2901
|
AddListButton,
|
|
@@ -2881,11 +2908,10 @@ import {
|
|
|
2881
2908
|
TableHead,
|
|
2882
2909
|
TableRow
|
|
2883
2910
|
} from "@uniformdev/design-system";
|
|
2884
|
-
import { Draggable, Droppable } from "react-beautiful-dnd";
|
|
2885
2911
|
|
|
2886
2912
|
// src/components/DragDropContext.tsx
|
|
2913
|
+
import { DragDropContext as BaseDragDropContext } from "@hello-pangea/dnd";
|
|
2887
2914
|
import { useState as useState8 } from "react";
|
|
2888
|
-
import { DragDropContext as BaseDragDropContext } from "react-beautiful-dnd";
|
|
2889
2915
|
import { useDebounce } from "react-use";
|
|
2890
2916
|
import { jsx as jsx32 } from "@emotion/react/jsx-runtime";
|
|
2891
2917
|
function DragDropContext({ children, ...props }) {
|
|
@@ -3140,7 +3166,8 @@ function TextVariableRenderer({ definition, value, setValue }) {
|
|
|
3140
3166
|
value: value != null ? value : "",
|
|
3141
3167
|
caption: (_a = definition.helpText) != null ? _a : definition.default !== "" ? `Default value: ${definition.default}` : void 0,
|
|
3142
3168
|
onChange: setValue,
|
|
3143
|
-
"data-testid": "variable-input"
|
|
3169
|
+
"data-testid": "variable-input",
|
|
3170
|
+
disableInlineMenu: "by-label"
|
|
3144
3171
|
}
|
|
3145
3172
|
) });
|
|
3146
3173
|
}
|
|
@@ -3151,11 +3178,11 @@ import { InputSelect, JsonEditor } from "@uniformdev/design-system";
|
|
|
3151
3178
|
import { useState as useState9 } from "react";
|
|
3152
3179
|
|
|
3153
3180
|
// src/components/Request/RequestProvider.tsx
|
|
3154
|
-
import * as
|
|
3181
|
+
import * as React4 from "react";
|
|
3155
3182
|
import { jsx as jsx36 } from "@emotion/react/jsx-runtime";
|
|
3156
|
-
var RequestContext =
|
|
3183
|
+
var RequestContext = React4.createContext(null);
|
|
3157
3184
|
function RequestProvider({ value, onChange, children }) {
|
|
3158
|
-
const contextValue =
|
|
3185
|
+
const contextValue = React4.useMemo(() => {
|
|
3159
3186
|
return {
|
|
3160
3187
|
dispatch: (event) => {
|
|
3161
3188
|
if (event.type === "setRelativeUrl") {
|
|
@@ -3224,7 +3251,7 @@ function RequestProvider({ value, onChange, children }) {
|
|
|
3224
3251
|
return /* @__PURE__ */ jsx36(RequestContext.Provider, { value: contextValue, children });
|
|
3225
3252
|
}
|
|
3226
3253
|
function useRequest() {
|
|
3227
|
-
const context =
|
|
3254
|
+
const context = React4.useContext(RequestContext);
|
|
3228
3255
|
if (!context) {
|
|
3229
3256
|
throw new Error("No RequestProvider present");
|
|
3230
3257
|
}
|
|
@@ -4204,7 +4231,7 @@ var ObjectSearchListItem = ({
|
|
|
4204
4231
|
),
|
|
4205
4232
|
/* @__PURE__ */ jsxs23("div", { css: ObjectListItemInfoContainer, children: [
|
|
4206
4233
|
selected ? /* @__PURE__ */ jsx49(Chip, { text: "selected", size: "xs" }) : null,
|
|
4207
|
-
!popoverData ? null : /* @__PURE__ */ jsx49(Popover, { ariaLabel: title, buttonText: `See ${title} details`,
|
|
4234
|
+
!popoverData ? null : /* @__PURE__ */ jsx49(Popover, { ariaLabel: title, buttonText: `See ${title} details`, children: popoverData })
|
|
4208
4235
|
] }),
|
|
4209
4236
|
!children ? null : /* @__PURE__ */ jsx49("div", { css: ObjectListItemUnControlledContent, children })
|
|
4210
4237
|
]
|
|
@@ -4627,11 +4654,11 @@ function legacyThemeMapper(theme) {
|
|
|
4627
4654
|
}
|
|
4628
4655
|
|
|
4629
4656
|
// src/components/ObjectSearch/ObjectSearchResultList.tsx
|
|
4630
|
-
import { Button as Button4, Counter } from "@uniformdev/design-system";
|
|
4631
4657
|
import {
|
|
4632
4658
|
Draggable as Draggable2,
|
|
4633
4659
|
Droppable as Droppable2
|
|
4634
|
-
} from "
|
|
4660
|
+
} from "@hello-pangea/dnd";
|
|
4661
|
+
import { Button as Button4, Counter } from "@uniformdev/design-system";
|
|
4635
4662
|
|
|
4636
4663
|
// src/components/ObjectSearch/styles/ObjectSearchResultList.styles.ts
|
|
4637
4664
|
import { css as css20 } from "@emotion/react";
|
|
@@ -6751,7 +6778,7 @@ import { Icon as Icon5 } from "@uniformdev/design-system";
|
|
|
6751
6778
|
|
|
6752
6779
|
// src/components/SearchAndFilter/FilterMenu.tsx
|
|
6753
6780
|
import { HorizontalRhythm as HorizontalRhythm8, VerticalRhythm as VerticalRhythm6 } from "@uniformdev/design-system";
|
|
6754
|
-
import
|
|
6781
|
+
import React6, { useEffect as useEffect19 } from "react";
|
|
6755
6782
|
import { jsx as jsx76, jsxs as jsxs35 } from "@emotion/react/jsx-runtime";
|
|
6756
6783
|
var SearchAndFilterOptionsContainer2 = ({
|
|
6757
6784
|
buttonRow,
|
|
@@ -6783,7 +6810,7 @@ var FilterMenu = ({
|
|
|
6783
6810
|
resetButtonText = "reset"
|
|
6784
6811
|
}) => {
|
|
6785
6812
|
const { filterVisibility, setFilterVisibility, handleResetFilters, filters } = useSearchAndFilter();
|
|
6786
|
-
const innerMenuRef =
|
|
6813
|
+
const innerMenuRef = React6.useRef(null);
|
|
6787
6814
|
useEffect19(() => {
|
|
6788
6815
|
var _a;
|
|
6789
6816
|
if (filterVisibility) {
|