@uniformdev/mesh-sdk-react 20.6.1-alpha.0 → 20.6.2-alpha.10

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 CHANGED
@@ -96,6 +96,8 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
96
96
  type: TLocationType;
97
97
  }> | Extract<_uniformdev_mesh_sdk.AIGenerateLocation<TLocationValue>, {
98
98
  type: TLocationType;
99
+ }> | Extract<_uniformdev_mesh_sdk.PersonalizationCriteriaLocation<TLocationValue, unknown>, {
100
+ type: TLocationType;
99
101
  }>, "setValue"> & {
100
102
  setValue: SetLocationValueDispatch<(Extract<_uniformdev_mesh_sdk.AssetLibraryLocation, {
101
103
  type: TLocationType;
@@ -121,6 +123,8 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
121
123
  type: TLocationType;
122
124
  }> | Extract<_uniformdev_mesh_sdk.AIGenerateLocation<TLocationValue>, {
123
125
  type: TLocationType;
126
+ }> | Extract<_uniformdev_mesh_sdk.PersonalizationCriteriaLocation<TLocationValue, unknown>, {
127
+ type: TLocationType;
124
128
  }>)["value"], Parameters<(Extract<_uniformdev_mesh_sdk.AssetLibraryLocation, {
125
129
  type: TLocationType;
126
130
  }> | Extract<_uniformdev_mesh_sdk.AssetParameterLocation, {
@@ -145,6 +149,8 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
145
149
  type: TLocationType;
146
150
  }> | Extract<_uniformdev_mesh_sdk.AIGenerateLocation<TLocationValue>, {
147
151
  type: TLocationType;
152
+ }> | Extract<_uniformdev_mesh_sdk.PersonalizationCriteriaLocation<TLocationValue, unknown>, {
153
+ type: TLocationType;
148
154
  }>)["setValue"]>[0]>;
149
155
  };
150
156
  type SetLocationValueDispatch<TValue, TSetValue = TValue> = (dispatch: SetLocationValueFunction<TValue, TSetValue>) => Promise<void> | void;
package/dist/index.d.ts CHANGED
@@ -96,6 +96,8 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
96
96
  type: TLocationType;
97
97
  }> | Extract<_uniformdev_mesh_sdk.AIGenerateLocation<TLocationValue>, {
98
98
  type: TLocationType;
99
+ }> | Extract<_uniformdev_mesh_sdk.PersonalizationCriteriaLocation<TLocationValue, unknown>, {
100
+ type: TLocationType;
99
101
  }>, "setValue"> & {
100
102
  setValue: SetLocationValueDispatch<(Extract<_uniformdev_mesh_sdk.AssetLibraryLocation, {
101
103
  type: TLocationType;
@@ -121,6 +123,8 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
121
123
  type: TLocationType;
122
124
  }> | Extract<_uniformdev_mesh_sdk.AIGenerateLocation<TLocationValue>, {
123
125
  type: TLocationType;
126
+ }> | Extract<_uniformdev_mesh_sdk.PersonalizationCriteriaLocation<TLocationValue, unknown>, {
127
+ type: TLocationType;
124
128
  }>)["value"], Parameters<(Extract<_uniformdev_mesh_sdk.AssetLibraryLocation, {
125
129
  type: TLocationType;
126
130
  }> | Extract<_uniformdev_mesh_sdk.AssetParameterLocation, {
@@ -145,6 +149,8 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
145
149
  type: TLocationType;
146
150
  }> | Extract<_uniformdev_mesh_sdk.AIGenerateLocation<TLocationValue>, {
147
151
  type: TLocationType;
152
+ }> | Extract<_uniformdev_mesh_sdk.PersonalizationCriteriaLocation<TLocationValue, unknown>, {
153
+ type: TLocationType;
148
154
  }>)["setValue"]>[0]>;
149
155
  };
150
156
  type SetLocationValueDispatch<TValue, TSetValue = TValue> = (dispatch: SetLocationValueFunction<TValue, TSetValue>) => Promise<void> | void;
package/dist/index.esm.js CHANGED
@@ -668,7 +668,7 @@ import {
668
668
  LexicalTypeaheadMenuPlugin,
669
669
  MenuOption
670
670
  } from "@lexical/react/LexicalTypeaheadMenuPlugin";
671
- import { mergeRegister } from "@lexical/utils";
671
+ import { $dfs, mergeRegister } from "@lexical/utils";
672
672
  import { AiFillPlusCircle } from "@react-icons/all-files/ai/AiFillPlusCircle";
673
673
  import { createVariableReference as createVariableReference2 } from "@uniformdev/canvas";
674
674
  import { HorizontalRhythm as HorizontalRhythm2, MenuGroup, MenuItemInner, MenuItemSeparator } from "@uniformdev/design-system";
@@ -681,7 +681,6 @@ import {
681
681
  $getSelection,
682
682
  $insertNodes,
683
683
  $isNodeSelection,
684
- $nodesOfType as $nodesOfType2,
685
684
  $setSelection,
686
685
  COMMAND_PRIORITY_NORMAL,
687
686
  createCommand
@@ -1460,8 +1459,14 @@ function VariablesPlugin({
1460
1459
  [canEditVariable]
1461
1460
  );
1462
1461
  useEffect4(() => {
1462
+ let selection;
1463
+ editor.read(() => {
1464
+ selection = $getSelection();
1465
+ });
1463
1466
  editor.update(() => {
1464
- $nodesOfType2(VariableNode).forEach((variableNode) => {
1467
+ var _a;
1468
+ $setSelection((_a = selection == null ? void 0 : selection.clone()) != null ? _a : null);
1469
+ $dfs().filter(({ node }) => $isVariableNode(node)).forEach(({ node: variableNode }) => {
1465
1470
  updateExistingNodeIfChanged(variableNode);
1466
1471
  });
1467
1472
  });
package/dist/index.js CHANGED
@@ -1606,8 +1606,14 @@ function VariablesPlugin({
1606
1606
  [canEditVariable]
1607
1607
  );
1608
1608
  (0, import_react15.useEffect)(() => {
1609
+ let selection;
1610
+ editor.read(() => {
1611
+ selection = (0, import_lexical4.$getSelection)();
1612
+ });
1609
1613
  editor.update(() => {
1610
- (0, import_lexical4.$nodesOfType)(VariableNode).forEach((variableNode) => {
1614
+ var _a;
1615
+ (0, import_lexical4.$setSelection)((_a = selection == null ? void 0 : selection.clone()) != null ? _a : null);
1616
+ (0, import_utils.$dfs)().filter(({ node }) => $isVariableNode(node)).forEach(({ node: variableNode }) => {
1611
1617
  updateExistingNodeIfChanged(variableNode);
1612
1618
  });
1613
1619
  });
package/dist/index.mjs CHANGED
@@ -668,7 +668,7 @@ import {
668
668
  LexicalTypeaheadMenuPlugin,
669
669
  MenuOption
670
670
  } from "@lexical/react/LexicalTypeaheadMenuPlugin";
671
- import { mergeRegister } from "@lexical/utils";
671
+ import { $dfs, mergeRegister } from "@lexical/utils";
672
672
  import { AiFillPlusCircle } from "@react-icons/all-files/ai/AiFillPlusCircle";
673
673
  import { createVariableReference as createVariableReference2 } from "@uniformdev/canvas";
674
674
  import { HorizontalRhythm as HorizontalRhythm2, MenuGroup, MenuItemInner, MenuItemSeparator } from "@uniformdev/design-system";
@@ -681,7 +681,6 @@ import {
681
681
  $getSelection,
682
682
  $insertNodes,
683
683
  $isNodeSelection,
684
- $nodesOfType as $nodesOfType2,
685
684
  $setSelection,
686
685
  COMMAND_PRIORITY_NORMAL,
687
686
  createCommand
@@ -1460,8 +1459,14 @@ function VariablesPlugin({
1460
1459
  [canEditVariable]
1461
1460
  );
1462
1461
  useEffect4(() => {
1462
+ let selection;
1463
+ editor.read(() => {
1464
+ selection = $getSelection();
1465
+ });
1463
1466
  editor.update(() => {
1464
- $nodesOfType2(VariableNode).forEach((variableNode) => {
1467
+ var _a;
1468
+ $setSelection((_a = selection == null ? void 0 : selection.clone()) != null ? _a : null);
1469
+ $dfs().filter(({ node }) => $isVariableNode(node)).forEach(({ node: variableNode }) => {
1465
1470
  updateExistingNodeIfChanged(variableNode);
1466
1471
  });
1467
1472
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/mesh-sdk-react",
3
- "version": "20.6.1-alpha.0+7c7f42aabc",
3
+ "version": "20.6.2-alpha.10+ff8a28da1a",
4
4
  "description": "Uniform Mesh Framework SDK for React",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -45,17 +45,17 @@
45
45
  },
46
46
  "dependencies": {
47
47
  "@hookform/resolvers": "^3.3.1",
48
- "@lexical/clipboard": "0.17.1",
49
- "@lexical/react": "0.17.1",
50
- "@lexical/selection": "0.17.1",
51
- "@lexical/utils": "0.17.1",
48
+ "@lexical/clipboard": "0.25.0",
49
+ "@lexical/react": "0.25.0",
50
+ "@lexical/selection": "0.25.0",
51
+ "@lexical/utils": "0.25.0",
52
52
  "@react-icons/all-files": "https://github.com/react-icons/react-icons/releases/download/v5.2.1/react-icons-all-files-5.2.1.tgz",
53
- "@uniformdev/canvas": "20.6.1-alpha.0+7c7f42aabc",
54
- "@uniformdev/design-system": "20.6.1-alpha.0+7c7f42aabc",
55
- "@uniformdev/mesh-sdk": "20.6.1-alpha.0+7c7f42aabc",
56
- "@uniformdev/richtext": "20.6.1-alpha.0+7c7f42aabc",
53
+ "@uniformdev/canvas": "20.6.2-alpha.10+ff8a28da1a",
54
+ "@uniformdev/design-system": "20.6.2-alpha.10+ff8a28da1a",
55
+ "@uniformdev/mesh-sdk": "20.6.2-alpha.10+ff8a28da1a",
56
+ "@uniformdev/richtext": "20.6.2-alpha.10+ff8a28da1a",
57
57
  "dequal": "^2.0.3",
58
- "lexical": "0.17.1",
58
+ "lexical": "0.25.0",
59
59
  "mitt": "3.0.1",
60
60
  "react-beautiful-dnd": "13.1.1",
61
61
  "react-hook-form": "^7.47.0",
@@ -86,5 +86,5 @@
86
86
  "publishConfig": {
87
87
  "access": "public"
88
88
  },
89
- "gitHead": "7c7f42aabc94d1692a2dbfbccc73f2bbbee200fe"
89
+ "gitHead": "ff8a28da1a7c11416e5585bc4cb66032bcb6ab53"
90
90
  }