@uniformdev/mesh-sdk-react 20.36.2-alpha.90 → 20.37.1-alpha.1
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 +11 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.esm.js +16 -8
- package/dist/index.js +16 -8
- package/dist/index.mjs +16 -8
- package/package.json +6 -6
package/dist/index.d.mts
CHANGED
|
@@ -416,6 +416,11 @@ type VariablesPluginProps<TEditorContext = unknown> = {
|
|
|
416
416
|
filterVariable?: SelectVariableMenuProps<TEditorContext>['filterVariable'];
|
|
417
417
|
/** If true, the whole value of the editor is replaced when a variable is inserted */
|
|
418
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;
|
|
419
424
|
};
|
|
420
425
|
type UseVariablesMenuInput<TEditorContext> = Pick<VariablesPluginProps<TEditorContext>, 'showAddVariableMenuOption' | 'enableEditingVariables' | 'filterVariable' | 'getEditorContext'>;
|
|
421
426
|
type OnVariableSelectInput = {
|
|
@@ -436,7 +441,7 @@ declare function useVariablesMenu<TEditorContext>({ showAddVariableMenuOption, e
|
|
|
436
441
|
* Enables variables auto-complete and reference management to a Lexical editor.
|
|
437
442
|
* Must also activate the VariableNode node to make this work.
|
|
438
443
|
*/
|
|
439
|
-
declare function VariablesPlugin<TEditorContext = unknown>({ disableVariables, showAddVariableMenuOption, enableEditingVariables, getEditorContext, replaceValueOnVariableInsert, filterVariable, }: VariablesPluginProps<TEditorContext>): JSX.Element | null;
|
|
444
|
+
declare function VariablesPlugin<TEditorContext = unknown>({ disableVariables, showAddVariableMenuOption, enableEditingVariables, getEditorContext, replaceValueOnVariableInsert, filterVariable, disableVariableDisplayNames, }: VariablesPluginProps<TEditorContext>): JSX.Element | null;
|
|
440
445
|
|
|
441
446
|
type PasteTransformerPluginProps = {
|
|
442
447
|
/**
|
|
@@ -553,6 +558,11 @@ type InputVariablesProps<TEditorContext = unknown> = {
|
|
|
553
558
|
* any existing value on insert a new dynamic token.
|
|
554
559
|
*/
|
|
555
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;
|
|
556
566
|
} & PasteTransformerPluginProps & UseInputVariablesStateProps<TEditorContext>;
|
|
557
567
|
/**
|
|
558
568
|
* An input box that enables insertion of 'variables', provided by VariablesProvider,
|
package/dist/index.d.ts
CHANGED
|
@@ -416,6 +416,11 @@ type VariablesPluginProps<TEditorContext = unknown> = {
|
|
|
416
416
|
filterVariable?: SelectVariableMenuProps<TEditorContext>['filterVariable'];
|
|
417
417
|
/** If true, the whole value of the editor is replaced when a variable is inserted */
|
|
418
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;
|
|
419
424
|
};
|
|
420
425
|
type UseVariablesMenuInput<TEditorContext> = Pick<VariablesPluginProps<TEditorContext>, 'showAddVariableMenuOption' | 'enableEditingVariables' | 'filterVariable' | 'getEditorContext'>;
|
|
421
426
|
type OnVariableSelectInput = {
|
|
@@ -436,7 +441,7 @@ declare function useVariablesMenu<TEditorContext>({ showAddVariableMenuOption, e
|
|
|
436
441
|
* Enables variables auto-complete and reference management to a Lexical editor.
|
|
437
442
|
* Must also activate the VariableNode node to make this work.
|
|
438
443
|
*/
|
|
439
|
-
declare function VariablesPlugin<TEditorContext = unknown>({ disableVariables, showAddVariableMenuOption, enableEditingVariables, getEditorContext, replaceValueOnVariableInsert, filterVariable, }: VariablesPluginProps<TEditorContext>): JSX.Element | null;
|
|
444
|
+
declare function VariablesPlugin<TEditorContext = unknown>({ disableVariables, showAddVariableMenuOption, enableEditingVariables, getEditorContext, replaceValueOnVariableInsert, filterVariable, disableVariableDisplayNames, }: VariablesPluginProps<TEditorContext>): JSX.Element | null;
|
|
440
445
|
|
|
441
446
|
type PasteTransformerPluginProps = {
|
|
442
447
|
/**
|
|
@@ -553,6 +558,11 @@ type InputVariablesProps<TEditorContext = unknown> = {
|
|
|
553
558
|
* any existing value on insert a new dynamic token.
|
|
554
559
|
*/
|
|
555
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;
|
|
556
566
|
} & PasteTransformerPluginProps & UseInputVariablesStateProps<TEditorContext>;
|
|
557
567
|
/**
|
|
558
568
|
* An input box that enables insertion of 'variables', provided by VariablesProvider,
|
package/dist/index.esm.js
CHANGED
|
@@ -1244,7 +1244,8 @@ function VariablesPlugin({
|
|
|
1244
1244
|
enableEditingVariables,
|
|
1245
1245
|
getEditorContext,
|
|
1246
1246
|
replaceValueOnVariableInsert,
|
|
1247
|
-
filterVariable
|
|
1247
|
+
filterVariable,
|
|
1248
|
+
disableVariableDisplayNames
|
|
1248
1249
|
}) {
|
|
1249
1250
|
const [editor] = useLexicalComposerContext2();
|
|
1250
1251
|
const { variables, dispatch, isEditing, canDispatch, readOnly, knownUndefinedValues, isLoading } = useVariables(true);
|
|
@@ -1322,9 +1323,10 @@ function VariablesPlugin({
|
|
|
1322
1323
|
});
|
|
1323
1324
|
return;
|
|
1324
1325
|
}
|
|
1326
|
+
const initialDisplayName = disableVariableDisplayNames ? prettifyBindExpression(result.selectedVariable.name) : result.selectedVariable.displayName;
|
|
1325
1327
|
editor.dispatchCommand(INSERT_VARIABLE_COMMAND, {
|
|
1326
1328
|
variable: result.selectedVariable.name,
|
|
1327
|
-
initialDisplayName
|
|
1329
|
+
initialDisplayName,
|
|
1328
1330
|
targetKey: sourceKey,
|
|
1329
1331
|
overwriteExistingValue: replaceValueOnVariableInsert
|
|
1330
1332
|
});
|
|
@@ -1372,9 +1374,10 @@ function VariablesPlugin({
|
|
|
1372
1374
|
if (result.canceled) {
|
|
1373
1375
|
return;
|
|
1374
1376
|
}
|
|
1377
|
+
const initialDisplayName = disableVariableDisplayNames ? prettifyBindExpression(result.selectedVariable.name) : result.selectedVariable.displayName;
|
|
1375
1378
|
editor.dispatchCommand(INSERT_VARIABLE_COMMAND, {
|
|
1376
1379
|
variable: result.selectedVariable.name,
|
|
1377
|
-
initialDisplayName
|
|
1380
|
+
initialDisplayName,
|
|
1378
1381
|
targetKey: void 0,
|
|
1379
1382
|
overwriteExistingValue: replaceValueOnVariableInsert
|
|
1380
1383
|
});
|
|
@@ -1393,8 +1396,9 @@ function VariablesPlugin({
|
|
|
1393
1396
|
var _a, _b;
|
|
1394
1397
|
if (!disableVariables) {
|
|
1395
1398
|
const targetVariable = variablesRef.current.variables[reference];
|
|
1399
|
+
const displayName = disableVariableDisplayNames ? prettifyBindExpression(reference) : initialDisplayName != null ? initialDisplayName : (targetVariable == null ? void 0 : targetVariable.displayName) || prettifyBindExpression(reference);
|
|
1396
1400
|
const variableNode = $createVariableNode(reference, {
|
|
1397
|
-
displayName
|
|
1401
|
+
displayName,
|
|
1398
1402
|
hasClickEvent: canEditVariable(reference, targetVariable),
|
|
1399
1403
|
referenceIsValid: true,
|
|
1400
1404
|
tooltip: (_a = targetVariable == null ? void 0 : targetVariable.tooltip) != null ? _a : targetVariable == null ? void 0 : targetVariable.helpText,
|
|
@@ -1431,7 +1435,8 @@ function VariablesPlugin({
|
|
|
1431
1435
|
readOnly,
|
|
1432
1436
|
getEditorContext,
|
|
1433
1437
|
editVariable,
|
|
1434
|
-
replaceValueOnVariableInsert
|
|
1438
|
+
replaceValueOnVariableInsert,
|
|
1439
|
+
disableVariableDisplayNames
|
|
1435
1440
|
]);
|
|
1436
1441
|
const updateExistingNodeIfChanged = useCallback2(
|
|
1437
1442
|
(variableNode) => {
|
|
@@ -1444,9 +1449,10 @@ function VariablesPlugin({
|
|
|
1444
1449
|
return;
|
|
1445
1450
|
}
|
|
1446
1451
|
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;
|
|
1452
|
+
const displayName = disableVariableDisplayNames ? prettifyBindExpression(variableNode.reference) : (targetVar == null ? void 0 : targetVar.displayName) || (targetUndefinedVar == null ? void 0 : targetUndefinedVar.displayName) || prettifyBindExpression(variableNode.reference);
|
|
1447
1453
|
const newState = {
|
|
1448
1454
|
...currentState,
|
|
1449
|
-
displayName
|
|
1455
|
+
displayName,
|
|
1450
1456
|
isLoading: isLoadingVariables && !targetVar && !(targetUndefinedVar == null ? void 0 : targetUndefinedVar.info),
|
|
1451
1457
|
hasClickEvent: canEditVariable(variableNode.reference, targetVar),
|
|
1452
1458
|
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 +1463,7 @@ function VariablesPlugin({
|
|
|
1457
1463
|
variableNode.setState(newState);
|
|
1458
1464
|
}
|
|
1459
1465
|
},
|
|
1460
|
-
[canEditVariable]
|
|
1466
|
+
[canEditVariable, disableVariableDisplayNames]
|
|
1461
1467
|
);
|
|
1462
1468
|
useEffect4(() => {
|
|
1463
1469
|
let selection;
|
|
@@ -2485,7 +2491,8 @@ function InputVariables(props) {
|
|
|
2485
2491
|
styleVariant = "default",
|
|
2486
2492
|
renderMenuInPortal,
|
|
2487
2493
|
disableDismissEditorOnChange,
|
|
2488
|
-
singleTokenMode
|
|
2494
|
+
singleTokenMode,
|
|
2495
|
+
disableVariableDisplayNames
|
|
2489
2496
|
} = props;
|
|
2490
2497
|
const [finalId] = useState7(id != null ? id : () => v4());
|
|
2491
2498
|
const { dispatch, canDispatch, isEditing } = useVariables(true);
|
|
@@ -2594,6 +2601,7 @@ function InputVariables(props) {
|
|
|
2594
2601
|
replaceValueOnVariableInsert: useInputWithNoVariables,
|
|
2595
2602
|
autoFocus,
|
|
2596
2603
|
filterVariable,
|
|
2604
|
+
disableVariableDisplayNames,
|
|
2597
2605
|
children: [
|
|
2598
2606
|
/* @__PURE__ */ jsx28(PasteTransformerPlugin, { transformPaste }),
|
|
2599
2607
|
/* @__PURE__ */ jsx28(ControlledValuePlugin, { value, enabled: singleTokenMode || useInputWithNoVariables }),
|
package/dist/index.js
CHANGED
|
@@ -1390,7 +1390,8 @@ function VariablesPlugin({
|
|
|
1390
1390
|
enableEditingVariables,
|
|
1391
1391
|
getEditorContext,
|
|
1392
1392
|
replaceValueOnVariableInsert,
|
|
1393
|
-
filterVariable
|
|
1393
|
+
filterVariable,
|
|
1394
|
+
disableVariableDisplayNames
|
|
1394
1395
|
}) {
|
|
1395
1396
|
const [editor] = (0, import_LexicalComposerContext2.useLexicalComposerContext)();
|
|
1396
1397
|
const { variables, dispatch, isEditing, canDispatch, readOnly, knownUndefinedValues, isLoading } = useVariables(true);
|
|
@@ -1468,9 +1469,10 @@ function VariablesPlugin({
|
|
|
1468
1469
|
});
|
|
1469
1470
|
return;
|
|
1470
1471
|
}
|
|
1472
|
+
const initialDisplayName = disableVariableDisplayNames ? prettifyBindExpression(result.selectedVariable.name) : result.selectedVariable.displayName;
|
|
1471
1473
|
editor.dispatchCommand(INSERT_VARIABLE_COMMAND, {
|
|
1472
1474
|
variable: result.selectedVariable.name,
|
|
1473
|
-
initialDisplayName
|
|
1475
|
+
initialDisplayName,
|
|
1474
1476
|
targetKey: sourceKey,
|
|
1475
1477
|
overwriteExistingValue: replaceValueOnVariableInsert
|
|
1476
1478
|
});
|
|
@@ -1518,9 +1520,10 @@ function VariablesPlugin({
|
|
|
1518
1520
|
if (result.canceled) {
|
|
1519
1521
|
return;
|
|
1520
1522
|
}
|
|
1523
|
+
const initialDisplayName = disableVariableDisplayNames ? prettifyBindExpression(result.selectedVariable.name) : result.selectedVariable.displayName;
|
|
1521
1524
|
editor.dispatchCommand(INSERT_VARIABLE_COMMAND, {
|
|
1522
1525
|
variable: result.selectedVariable.name,
|
|
1523
|
-
initialDisplayName
|
|
1526
|
+
initialDisplayName,
|
|
1524
1527
|
targetKey: void 0,
|
|
1525
1528
|
overwriteExistingValue: replaceValueOnVariableInsert
|
|
1526
1529
|
});
|
|
@@ -1539,8 +1542,9 @@ function VariablesPlugin({
|
|
|
1539
1542
|
var _a, _b;
|
|
1540
1543
|
if (!disableVariables) {
|
|
1541
1544
|
const targetVariable = variablesRef.current.variables[reference];
|
|
1545
|
+
const displayName = disableVariableDisplayNames ? prettifyBindExpression(reference) : initialDisplayName != null ? initialDisplayName : (targetVariable == null ? void 0 : targetVariable.displayName) || prettifyBindExpression(reference);
|
|
1542
1546
|
const variableNode = $createVariableNode(reference, {
|
|
1543
|
-
displayName
|
|
1547
|
+
displayName,
|
|
1544
1548
|
hasClickEvent: canEditVariable(reference, targetVariable),
|
|
1545
1549
|
referenceIsValid: true,
|
|
1546
1550
|
tooltip: (_a = targetVariable == null ? void 0 : targetVariable.tooltip) != null ? _a : targetVariable == null ? void 0 : targetVariable.helpText,
|
|
@@ -1577,7 +1581,8 @@ function VariablesPlugin({
|
|
|
1577
1581
|
readOnly,
|
|
1578
1582
|
getEditorContext,
|
|
1579
1583
|
editVariable,
|
|
1580
|
-
replaceValueOnVariableInsert
|
|
1584
|
+
replaceValueOnVariableInsert,
|
|
1585
|
+
disableVariableDisplayNames
|
|
1581
1586
|
]);
|
|
1582
1587
|
const updateExistingNodeIfChanged = (0, import_react15.useCallback)(
|
|
1583
1588
|
(variableNode) => {
|
|
@@ -1590,9 +1595,10 @@ function VariablesPlugin({
|
|
|
1590
1595
|
return;
|
|
1591
1596
|
}
|
|
1592
1597
|
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;
|
|
1598
|
+
const displayName = disableVariableDisplayNames ? prettifyBindExpression(variableNode.reference) : (targetVar == null ? void 0 : targetVar.displayName) || (targetUndefinedVar == null ? void 0 : targetUndefinedVar.displayName) || prettifyBindExpression(variableNode.reference);
|
|
1593
1599
|
const newState = {
|
|
1594
1600
|
...currentState,
|
|
1595
|
-
displayName
|
|
1601
|
+
displayName,
|
|
1596
1602
|
isLoading: isLoadingVariables && !targetVar && !(targetUndefinedVar == null ? void 0 : targetUndefinedVar.info),
|
|
1597
1603
|
hasClickEvent: canEditVariable(variableNode.reference, targetVar),
|
|
1598
1604
|
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),
|
|
@@ -1603,7 +1609,7 @@ function VariablesPlugin({
|
|
|
1603
1609
|
variableNode.setState(newState);
|
|
1604
1610
|
}
|
|
1605
1611
|
},
|
|
1606
|
-
[canEditVariable]
|
|
1612
|
+
[canEditVariable, disableVariableDisplayNames]
|
|
1607
1613
|
);
|
|
1608
1614
|
(0, import_react15.useEffect)(() => {
|
|
1609
1615
|
let selection;
|
|
@@ -2613,7 +2619,8 @@ function InputVariables(props) {
|
|
|
2613
2619
|
styleVariant = "default",
|
|
2614
2620
|
renderMenuInPortal,
|
|
2615
2621
|
disableDismissEditorOnChange,
|
|
2616
|
-
singleTokenMode
|
|
2622
|
+
singleTokenMode,
|
|
2623
|
+
disableVariableDisplayNames
|
|
2617
2624
|
} = props;
|
|
2618
2625
|
const [finalId] = (0, import_react28.useState)(id != null ? id : () => (0, import_uuid.v4)());
|
|
2619
2626
|
const { dispatch, canDispatch, isEditing } = useVariables(true);
|
|
@@ -2722,6 +2729,7 @@ function InputVariables(props) {
|
|
|
2722
2729
|
replaceValueOnVariableInsert: useInputWithNoVariables,
|
|
2723
2730
|
autoFocus,
|
|
2724
2731
|
filterVariable,
|
|
2732
|
+
disableVariableDisplayNames,
|
|
2725
2733
|
children: [
|
|
2726
2734
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(PasteTransformerPlugin, { transformPaste }),
|
|
2727
2735
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ControlledValuePlugin, { value, enabled: singleTokenMode || useInputWithNoVariables }),
|
package/dist/index.mjs
CHANGED
|
@@ -1244,7 +1244,8 @@ function VariablesPlugin({
|
|
|
1244
1244
|
enableEditingVariables,
|
|
1245
1245
|
getEditorContext,
|
|
1246
1246
|
replaceValueOnVariableInsert,
|
|
1247
|
-
filterVariable
|
|
1247
|
+
filterVariable,
|
|
1248
|
+
disableVariableDisplayNames
|
|
1248
1249
|
}) {
|
|
1249
1250
|
const [editor] = useLexicalComposerContext2();
|
|
1250
1251
|
const { variables, dispatch, isEditing, canDispatch, readOnly, knownUndefinedValues, isLoading } = useVariables(true);
|
|
@@ -1322,9 +1323,10 @@ function VariablesPlugin({
|
|
|
1322
1323
|
});
|
|
1323
1324
|
return;
|
|
1324
1325
|
}
|
|
1326
|
+
const initialDisplayName = disableVariableDisplayNames ? prettifyBindExpression(result.selectedVariable.name) : result.selectedVariable.displayName;
|
|
1325
1327
|
editor.dispatchCommand(INSERT_VARIABLE_COMMAND, {
|
|
1326
1328
|
variable: result.selectedVariable.name,
|
|
1327
|
-
initialDisplayName
|
|
1329
|
+
initialDisplayName,
|
|
1328
1330
|
targetKey: sourceKey,
|
|
1329
1331
|
overwriteExistingValue: replaceValueOnVariableInsert
|
|
1330
1332
|
});
|
|
@@ -1372,9 +1374,10 @@ function VariablesPlugin({
|
|
|
1372
1374
|
if (result.canceled) {
|
|
1373
1375
|
return;
|
|
1374
1376
|
}
|
|
1377
|
+
const initialDisplayName = disableVariableDisplayNames ? prettifyBindExpression(result.selectedVariable.name) : result.selectedVariable.displayName;
|
|
1375
1378
|
editor.dispatchCommand(INSERT_VARIABLE_COMMAND, {
|
|
1376
1379
|
variable: result.selectedVariable.name,
|
|
1377
|
-
initialDisplayName
|
|
1380
|
+
initialDisplayName,
|
|
1378
1381
|
targetKey: void 0,
|
|
1379
1382
|
overwriteExistingValue: replaceValueOnVariableInsert
|
|
1380
1383
|
});
|
|
@@ -1393,8 +1396,9 @@ function VariablesPlugin({
|
|
|
1393
1396
|
var _a, _b;
|
|
1394
1397
|
if (!disableVariables) {
|
|
1395
1398
|
const targetVariable = variablesRef.current.variables[reference];
|
|
1399
|
+
const displayName = disableVariableDisplayNames ? prettifyBindExpression(reference) : initialDisplayName != null ? initialDisplayName : (targetVariable == null ? void 0 : targetVariable.displayName) || prettifyBindExpression(reference);
|
|
1396
1400
|
const variableNode = $createVariableNode(reference, {
|
|
1397
|
-
displayName
|
|
1401
|
+
displayName,
|
|
1398
1402
|
hasClickEvent: canEditVariable(reference, targetVariable),
|
|
1399
1403
|
referenceIsValid: true,
|
|
1400
1404
|
tooltip: (_a = targetVariable == null ? void 0 : targetVariable.tooltip) != null ? _a : targetVariable == null ? void 0 : targetVariable.helpText,
|
|
@@ -1431,7 +1435,8 @@ function VariablesPlugin({
|
|
|
1431
1435
|
readOnly,
|
|
1432
1436
|
getEditorContext,
|
|
1433
1437
|
editVariable,
|
|
1434
|
-
replaceValueOnVariableInsert
|
|
1438
|
+
replaceValueOnVariableInsert,
|
|
1439
|
+
disableVariableDisplayNames
|
|
1435
1440
|
]);
|
|
1436
1441
|
const updateExistingNodeIfChanged = useCallback2(
|
|
1437
1442
|
(variableNode) => {
|
|
@@ -1444,9 +1449,10 @@ function VariablesPlugin({
|
|
|
1444
1449
|
return;
|
|
1445
1450
|
}
|
|
1446
1451
|
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;
|
|
1452
|
+
const displayName = disableVariableDisplayNames ? prettifyBindExpression(variableNode.reference) : (targetVar == null ? void 0 : targetVar.displayName) || (targetUndefinedVar == null ? void 0 : targetUndefinedVar.displayName) || prettifyBindExpression(variableNode.reference);
|
|
1447
1453
|
const newState = {
|
|
1448
1454
|
...currentState,
|
|
1449
|
-
displayName
|
|
1455
|
+
displayName,
|
|
1450
1456
|
isLoading: isLoadingVariables && !targetVar && !(targetUndefinedVar == null ? void 0 : targetUndefinedVar.info),
|
|
1451
1457
|
hasClickEvent: canEditVariable(variableNode.reference, targetVar),
|
|
1452
1458
|
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 +1463,7 @@ function VariablesPlugin({
|
|
|
1457
1463
|
variableNode.setState(newState);
|
|
1458
1464
|
}
|
|
1459
1465
|
},
|
|
1460
|
-
[canEditVariable]
|
|
1466
|
+
[canEditVariable, disableVariableDisplayNames]
|
|
1461
1467
|
);
|
|
1462
1468
|
useEffect4(() => {
|
|
1463
1469
|
let selection;
|
|
@@ -2485,7 +2491,8 @@ function InputVariables(props) {
|
|
|
2485
2491
|
styleVariant = "default",
|
|
2486
2492
|
renderMenuInPortal,
|
|
2487
2493
|
disableDismissEditorOnChange,
|
|
2488
|
-
singleTokenMode
|
|
2494
|
+
singleTokenMode,
|
|
2495
|
+
disableVariableDisplayNames
|
|
2489
2496
|
} = props;
|
|
2490
2497
|
const [finalId] = useState7(id != null ? id : () => v4());
|
|
2491
2498
|
const { dispatch, canDispatch, isEditing } = useVariables(true);
|
|
@@ -2594,6 +2601,7 @@ function InputVariables(props) {
|
|
|
2594
2601
|
replaceValueOnVariableInsert: useInputWithNoVariables,
|
|
2595
2602
|
autoFocus,
|
|
2596
2603
|
filterVariable,
|
|
2604
|
+
disableVariableDisplayNames,
|
|
2597
2605
|
children: [
|
|
2598
2606
|
/* @__PURE__ */ jsx28(PasteTransformerPlugin, { transformPaste }),
|
|
2599
2607
|
/* @__PURE__ */ jsx28(ControlledValuePlugin, { value, enabled: singleTokenMode || useInputWithNoVariables }),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/mesh-sdk-react",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.37.1-alpha.1+5ac67f77a7",
|
|
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.
|
|
54
|
-
"@uniformdev/design-system": "20.
|
|
55
|
-
"@uniformdev/mesh-sdk": "20.
|
|
56
|
-
"@uniformdev/richtext": "20.
|
|
53
|
+
"@uniformdev/canvas": "20.37.1-alpha.1+5ac67f77a7",
|
|
54
|
+
"@uniformdev/design-system": "20.37.1-alpha.1+5ac67f77a7",
|
|
55
|
+
"@uniformdev/mesh-sdk": "20.37.1-alpha.1+5ac67f77a7",
|
|
56
|
+
"@uniformdev/richtext": "20.37.1-alpha.1+5ac67f77a7",
|
|
57
57
|
"dequal": "^2.0.3",
|
|
58
58
|
"lexical": "0.25.0",
|
|
59
59
|
"mitt": "3.0.1",
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"publishConfig": {
|
|
87
87
|
"access": "public"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "5ac67f77a77da73d93c76b9ec23d86acbd0a2123"
|
|
90
90
|
}
|