@uniformdev/mesh-sdk-react 19.180.0 → 19.181.1-alpha.4

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
@@ -1124,7 +1124,7 @@ declare function serializeVariablesEditorSerializedState(serializedEditorState:
1124
1124
  * If newValue is a string, it will be treated as a variable-reference-containing string, and parsed to a Lexical AST
1125
1125
  * If newValue is a serialized Lexical AST, it will be used as-is. If the AST is invalid, the editor will be set to an empty state.
1126
1126
  */
1127
- declare function setVariablesEditorValue(editor: LexicalEditor, newValue: string | undefined | SerializedEditorState<SerializedLexicalNode>): void;
1127
+ declare function setVariablesEditorValue(editor: LexicalEditor, newValue: string | undefined | SerializedEditorState<SerializedLexicalNode>, tag?: string): void;
1128
1128
 
1129
1129
  declare function variableDefaultTextValue(defaultValue: unknown): string;
1130
1130
 
package/dist/index.d.ts CHANGED
@@ -1124,7 +1124,7 @@ declare function serializeVariablesEditorSerializedState(serializedEditorState:
1124
1124
  * If newValue is a string, it will be treated as a variable-reference-containing string, and parsed to a Lexical AST
1125
1125
  * If newValue is a serialized Lexical AST, it will be used as-is. If the AST is invalid, the editor will be set to an empty state.
1126
1126
  */
1127
- declare function setVariablesEditorValue(editor: LexicalEditor, newValue: string | undefined | SerializedEditorState<SerializedLexicalNode>): void;
1127
+ declare function setVariablesEditorValue(editor: LexicalEditor, newValue: string | undefined | SerializedEditorState<SerializedLexicalNode>, tag?: string): void;
1128
1128
 
1129
1129
  declare function variableDefaultTextValue(defaultValue: unknown): string;
1130
1130
 
package/dist/index.esm.js CHANGED
@@ -2834,6 +2834,9 @@ function serializeRecursive(node, buffer) {
2834
2834
  }
2835
2835
  }
2836
2836
 
2837
+ // src/components/Variables/util/setVariablesEditorValue.ts
2838
+ import { emptyRichTextValue } from "@uniformdev/richtext";
2839
+
2837
2840
  // src/components/Variables/util/deserializeVariablesEditorState.ts
2838
2841
  import { parseVariableExpression } from "@uniformdev/canvas";
2839
2842
  import { TextNode as TextNode2 } from "lexical";
@@ -2896,14 +2899,18 @@ function refreshVariableNodeMetadata(editor) {
2896
2899
  }
2897
2900
 
2898
2901
  // src/components/Variables/util/setVariablesEditorValue.ts
2899
- function setVariablesEditorValue(editor, newValue) {
2902
+ function setVariablesEditorValue(editor, newValue, tag) {
2900
2903
  if (typeof newValue === "undefined" || typeof newValue === "string") {
2901
2904
  const parsedState = editor.parseEditorState(deserializeVariablesEditorState(newValue));
2902
- editor.setEditorState(parsedState);
2905
+ editor.setEditorState(parsedState.clone(null), {
2906
+ tag
2907
+ });
2903
2908
  } else {
2904
2909
  try {
2905
2910
  const parsedState = editor.parseEditorState(newValue);
2906
- editor.setEditorState(parsedState);
2911
+ editor.setEditorState(parsedState.clone(null), {
2912
+ tag
2913
+ });
2907
2914
  } catch (e) {
2908
2915
  console.warn(
2909
2916
  "Tried to set invalid Lexical state, probably invalidly formatted state object - falling back to empty state. Invalid state attempted:",
@@ -2911,28 +2918,10 @@ function setVariablesEditorValue(editor, newValue) {
2911
2918
  "Error:",
2912
2919
  e
2913
2920
  );
2914
- const parsedState = editor.parseEditorState({
2915
- root: {
2916
- type: "root",
2917
- version: 1,
2918
- direction: null,
2919
- format: "",
2920
- indent: 0,
2921
- children: [
2922
- {
2923
- type: "paragraph",
2924
- version: 1,
2925
- format: "start",
2926
- indent: 0,
2927
- direction: null,
2928
- children: [],
2929
- textFormat: 0,
2930
- textStyle: ""
2931
- }
2932
- ]
2933
- }
2921
+ const parsedState = editor.parseEditorState(emptyRichTextValue);
2922
+ editor.setEditorState(parsedState.clone(null), {
2923
+ tag
2934
2924
  });
2935
- editor.setEditorState(parsedState);
2936
2925
  }
2937
2926
  }
2938
2927
  refreshVariableNodeMetadata(editor);
@@ -5031,7 +5020,7 @@ function ParameterConnectionIndicator({
5031
5020
  return result;
5032
5021
  }, [value]);
5033
5022
  return /* @__PURE__ */ jsxs24(HorizontalRhythm5, { align: "center", gap: "xs", css: { width: "100%" }, children: [
5034
- /* @__PURE__ */ jsx41("div", { css: { flex: 1 }, children }),
5023
+ /* @__PURE__ */ jsx41("div", { css: { flex: 1, maxWidth: "100%" }, children }),
5035
5024
  disabled ? null : /* @__PURE__ */ jsx41(
5036
5025
  Menu3,
5037
5026
  {
package/dist/index.js CHANGED
@@ -3076,6 +3076,9 @@ function serializeRecursive(node, buffer) {
3076
3076
  }
3077
3077
  }
3078
3078
 
3079
+ // src/components/Variables/util/setVariablesEditorValue.ts
3080
+ var import_richtext = require("@uniformdev/richtext");
3081
+
3079
3082
  // src/components/Variables/util/deserializeVariablesEditorState.ts
3080
3083
  var import_canvas3 = require("@uniformdev/canvas");
3081
3084
  var import_lexical2 = require("lexical");
@@ -3138,14 +3141,18 @@ function refreshVariableNodeMetadata(editor) {
3138
3141
  }
3139
3142
 
3140
3143
  // src/components/Variables/util/setVariablesEditorValue.ts
3141
- function setVariablesEditorValue(editor, newValue) {
3144
+ function setVariablesEditorValue(editor, newValue, tag) {
3142
3145
  if (typeof newValue === "undefined" || typeof newValue === "string") {
3143
3146
  const parsedState = editor.parseEditorState(deserializeVariablesEditorState(newValue));
3144
- editor.setEditorState(parsedState);
3147
+ editor.setEditorState(parsedState.clone(null), {
3148
+ tag
3149
+ });
3145
3150
  } else {
3146
3151
  try {
3147
3152
  const parsedState = editor.parseEditorState(newValue);
3148
- editor.setEditorState(parsedState);
3153
+ editor.setEditorState(parsedState.clone(null), {
3154
+ tag
3155
+ });
3149
3156
  } catch (e) {
3150
3157
  console.warn(
3151
3158
  "Tried to set invalid Lexical state, probably invalidly formatted state object - falling back to empty state. Invalid state attempted:",
@@ -3153,28 +3160,10 @@ function setVariablesEditorValue(editor, newValue) {
3153
3160
  "Error:",
3154
3161
  e
3155
3162
  );
3156
- const parsedState = editor.parseEditorState({
3157
- root: {
3158
- type: "root",
3159
- version: 1,
3160
- direction: null,
3161
- format: "",
3162
- indent: 0,
3163
- children: [
3164
- {
3165
- type: "paragraph",
3166
- version: 1,
3167
- format: "start",
3168
- indent: 0,
3169
- direction: null,
3170
- children: [],
3171
- textFormat: 0,
3172
- textStyle: ""
3173
- }
3174
- ]
3175
- }
3163
+ const parsedState = editor.parseEditorState(import_richtext.emptyRichTextValue);
3164
+ editor.setEditorState(parsedState.clone(null), {
3165
+ tag
3176
3166
  });
3177
- editor.setEditorState(parsedState);
3178
3167
  }
3179
3168
  }
3180
3169
  refreshVariableNodeMetadata(editor);
@@ -5226,7 +5215,7 @@ function ParameterConnectionIndicator({
5226
5215
  return result;
5227
5216
  }, [value]);
5228
5217
  return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_design_system22.HorizontalRhythm, { align: "center", gap: "xs", css: { width: "100%" }, children: [
5229
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { css: { flex: 1 }, children }),
5218
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { css: { flex: 1, maxWidth: "100%" }, children }),
5230
5219
  disabled ? null : /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
5231
5220
  import_design_system22.Menu,
5232
5221
  {
package/dist/index.mjs CHANGED
@@ -2834,6 +2834,9 @@ function serializeRecursive(node, buffer) {
2834
2834
  }
2835
2835
  }
2836
2836
 
2837
+ // src/components/Variables/util/setVariablesEditorValue.ts
2838
+ import { emptyRichTextValue } from "@uniformdev/richtext";
2839
+
2837
2840
  // src/components/Variables/util/deserializeVariablesEditorState.ts
2838
2841
  import { parseVariableExpression } from "@uniformdev/canvas";
2839
2842
  import { TextNode as TextNode2 } from "lexical";
@@ -2896,14 +2899,18 @@ function refreshVariableNodeMetadata(editor) {
2896
2899
  }
2897
2900
 
2898
2901
  // src/components/Variables/util/setVariablesEditorValue.ts
2899
- function setVariablesEditorValue(editor, newValue) {
2902
+ function setVariablesEditorValue(editor, newValue, tag) {
2900
2903
  if (typeof newValue === "undefined" || typeof newValue === "string") {
2901
2904
  const parsedState = editor.parseEditorState(deserializeVariablesEditorState(newValue));
2902
- editor.setEditorState(parsedState);
2905
+ editor.setEditorState(parsedState.clone(null), {
2906
+ tag
2907
+ });
2903
2908
  } else {
2904
2909
  try {
2905
2910
  const parsedState = editor.parseEditorState(newValue);
2906
- editor.setEditorState(parsedState);
2911
+ editor.setEditorState(parsedState.clone(null), {
2912
+ tag
2913
+ });
2907
2914
  } catch (e) {
2908
2915
  console.warn(
2909
2916
  "Tried to set invalid Lexical state, probably invalidly formatted state object - falling back to empty state. Invalid state attempted:",
@@ -2911,28 +2918,10 @@ function setVariablesEditorValue(editor, newValue) {
2911
2918
  "Error:",
2912
2919
  e
2913
2920
  );
2914
- const parsedState = editor.parseEditorState({
2915
- root: {
2916
- type: "root",
2917
- version: 1,
2918
- direction: null,
2919
- format: "",
2920
- indent: 0,
2921
- children: [
2922
- {
2923
- type: "paragraph",
2924
- version: 1,
2925
- format: "start",
2926
- indent: 0,
2927
- direction: null,
2928
- children: [],
2929
- textFormat: 0,
2930
- textStyle: ""
2931
- }
2932
- ]
2933
- }
2921
+ const parsedState = editor.parseEditorState(emptyRichTextValue);
2922
+ editor.setEditorState(parsedState.clone(null), {
2923
+ tag
2934
2924
  });
2935
- editor.setEditorState(parsedState);
2936
2925
  }
2937
2926
  }
2938
2927
  refreshVariableNodeMetadata(editor);
@@ -5031,7 +5020,7 @@ function ParameterConnectionIndicator({
5031
5020
  return result;
5032
5021
  }, [value]);
5033
5022
  return /* @__PURE__ */ jsxs24(HorizontalRhythm5, { align: "center", gap: "xs", css: { width: "100%" }, children: [
5034
- /* @__PURE__ */ jsx41("div", { css: { flex: 1 }, children }),
5023
+ /* @__PURE__ */ jsx41("div", { css: { flex: 1, maxWidth: "100%" }, children }),
5035
5024
  disabled ? null : /* @__PURE__ */ jsx41(
5036
5025
  Menu3,
5037
5026
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/mesh-sdk-react",
3
- "version": "19.180.0",
3
+ "version": "19.181.1-alpha.4+63886f3999",
4
4
  "description": "Uniform Mesh Framework SDK for React",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -50,9 +50,10 @@
50
50
  "@lexical/selection": "0.17.0",
51
51
  "@lexical/utils": "0.17.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": "19.180.0",
54
- "@uniformdev/design-system": "19.180.0",
55
- "@uniformdev/mesh-sdk": "19.180.0",
53
+ "@uniformdev/canvas": "19.181.1-alpha.4+63886f3999",
54
+ "@uniformdev/design-system": "19.181.1-alpha.4+63886f3999",
55
+ "@uniformdev/mesh-sdk": "19.181.1-alpha.4+63886f3999",
56
+ "@uniformdev/richtext": "19.181.1-alpha.4+63886f3999",
56
57
  "dequal": "^2.0.3",
57
58
  "lexical": "0.17.0",
58
59
  "mitt": "3.0.1",
@@ -86,5 +87,5 @@
86
87
  "publishConfig": {
87
88
  "access": "public"
88
89
  },
89
- "gitHead": "309600b88571d0ffb2b80d7d2c27b7aa3e5ae72b"
90
+ "gitHead": "63886f3999fa693ef6b012fdcaefc930e238fc4d"
90
91
  }