@uniformdev/mesh-sdk-react 19.178.2-alpha.25 → 19.179.2-alpha.22

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.js CHANGED
@@ -33,12 +33,13 @@ var src_exports = {};
33
33
  __export(src_exports, {
34
34
  $createVariableNode: () => $createVariableNode,
35
35
  $isVariableNode: () => $isVariableNode,
36
- AddListButton: () => import_design_system64.AddListButton,
37
- Button: () => import_design_system64.Button,
36
+ AddListButton: () => import_design_system65.AddListButton,
37
+ Button: () => import_design_system65.Button,
38
38
  CHECKBOX_OPERATORS: () => CHECKBOX_OPERATORS,
39
- Callout: () => import_design_system64.Callout,
39
+ Callout: () => import_design_system65.Callout,
40
40
  ControlledValuePlugin: () => ControlledValuePlugin,
41
41
  DATE_OPERATORS: () => DATE_OPERATORS,
42
+ DATE_TIME_OPERATORS: () => DATE_TIME_OPERATORS,
42
43
  DISCONNECT_VARIABLE_COMMAND: () => DISCONNECT_VARIABLE_COMMAND,
43
44
  DamSelectedItem: () => DamSelectedItem,
44
45
  DataRefreshButton: () => DataRefreshButton,
@@ -51,7 +52,7 @@ __export(src_exports, {
51
52
  DateRangeEditor: () => DateRangeEditor,
52
53
  DefaultSearchRow: () => DefaultSearchRow,
53
54
  DefaultSelectedItem: () => DefaultSelectedItem,
54
- DrawerContent: () => import_design_system64.DrawerContent,
55
+ DrawerContent: () => import_design_system65.DrawerContent,
55
56
  EDIT_VARIABLE_COMMAND: () => EDIT_VARIABLE_COMMAND,
56
57
  EntrySearch: () => EntrySearch,
57
58
  FilterButton: () => FilterButton2,
@@ -62,22 +63,22 @@ __export(src_exports, {
62
63
  FilterMenu: () => FilterMenu,
63
64
  FilterMultiChoiceEditor: () => FilterMultiChoiceEditor,
64
65
  FilterSingleChoiceEditor: () => FilterSingleChoiceEditor,
65
- Heading: () => import_design_system64.Heading,
66
+ Heading: () => import_design_system65.Heading,
66
67
  INSERT_VARIABLE_COMMAND: () => INSERT_VARIABLE_COMMAND,
67
68
  Icons: () => icons_exports,
68
- Input: () => import_design_system64.Input,
69
- InputComboBox: () => import_design_system64.InputComboBox,
70
- InputKeywordSearch: () => import_design_system64.InputKeywordSearch,
71
- InputSelect: () => import_design_system64.InputSelect,
72
- InputToggle: () => import_design_system64.InputToggle,
69
+ Input: () => import_design_system65.Input,
70
+ InputComboBox: () => import_design_system65.InputComboBox,
71
+ InputKeywordSearch: () => import_design_system65.InputKeywordSearch,
72
+ InputSelect: () => import_design_system65.InputSelect,
73
+ InputToggle: () => import_design_system65.InputToggle,
73
74
  InputVariables: () => InputVariables,
74
- Label: () => import_design_system64.Label,
75
+ Label: () => import_design_system65.Label,
75
76
  LinkButton: () => LinkButton,
76
- LoadingIndicator: () => import_design_system64.LoadingIndicator,
77
- LoadingOverlay: () => import_design_system64.LoadingOverlay,
77
+ LoadingIndicator: () => import_design_system65.LoadingIndicator,
78
+ LoadingOverlay: () => import_design_system65.LoadingOverlay,
78
79
  MULTI_SELECT_OPERATORS: () => MULTI_SELECT_OPERATORS,
79
- Menu: () => import_design_system64.Menu,
80
- MenuItem: () => import_design_system64.MenuItem,
80
+ Menu: () => import_design_system65.Menu,
81
+ MenuItem: () => import_design_system65.MenuItem,
81
82
  MeshApp: () => MeshApp,
82
83
  NUMBER_OPERATORS: () => NUMBER_OPERATORS,
83
84
  NumberEditor: () => NumberEditor,
@@ -96,22 +97,22 @@ __export(src_exports, {
96
97
  PUBLISH_STATUS_FIELD_OPERATORS: () => PUBLISH_STATUS_FIELD_OPERATORS,
97
98
  ParamTypeDynamicDataProvider: () => ParamTypeDynamicDataProvider,
98
99
  ParameterConnectionIndicator: () => ParameterConnectionIndicator,
99
- ParameterGroup: () => import_design_system64.ParameterGroup,
100
- ParameterImage: () => import_design_system64.ParameterImage,
101
- ParameterImageInner: () => import_design_system64.ParameterImageInner,
102
- ParameterInput: () => import_design_system64.ParameterInput,
103
- ParameterInputInner: () => import_design_system64.ParameterInputInner,
104
- ParameterLabel: () => import_design_system64.ParameterLabel,
105
- ParameterMenuButton: () => import_design_system64.ParameterMenuButton,
100
+ ParameterGroup: () => import_design_system65.ParameterGroup,
101
+ ParameterImage: () => import_design_system65.ParameterImage,
102
+ ParameterImageInner: () => import_design_system65.ParameterImageInner,
103
+ ParameterInput: () => import_design_system65.ParameterInput,
104
+ ParameterInputInner: () => import_design_system65.ParameterInputInner,
105
+ ParameterLabel: () => import_design_system65.ParameterLabel,
106
+ ParameterMenuButton: () => import_design_system65.ParameterMenuButton,
106
107
  ParameterOrSingleVariable: () => ParameterOrSingleVariable,
107
- ParameterSelect: () => import_design_system64.ParameterSelect,
108
- ParameterSelectInner: () => import_design_system64.ParameterSelectInner,
109
- ParameterShell: () => import_design_system64.ParameterShell,
108
+ ParameterSelect: () => import_design_system65.ParameterSelect,
109
+ ParameterSelectInner: () => import_design_system65.ParameterSelectInner,
110
+ ParameterShell: () => import_design_system65.ParameterShell,
110
111
  ParameterShellContext: () => import_design_system14.ParameterShellContext,
111
- ParameterTextarea: () => import_design_system64.ParameterTextarea,
112
- ParameterTextareaInner: () => import_design_system64.ParameterTextareaInner,
113
- ParameterToggle: () => import_design_system64.ParameterToggle,
114
- ParameterToggleInner: () => import_design_system64.ParameterToggleInner,
112
+ ParameterTextarea: () => import_design_system65.ParameterTextarea,
113
+ ParameterTextareaInner: () => import_design_system65.ParameterTextareaInner,
114
+ ParameterToggle: () => import_design_system65.ParameterToggle,
115
+ ParameterToggleInner: () => import_design_system65.ParameterToggleInner,
115
116
  ParameterVariables: () => ParameterVariables,
116
117
  ProductPreviewList: () => ProductPreviewList,
117
118
  ProductQuery: () => ProductQuery,
@@ -132,10 +133,9 @@ __export(src_exports, {
132
133
  RequestUrlInput: () => RequestUrlInput,
133
134
  ResolvableLoadingValue: () => ResolvableLoadingValue,
134
135
  SELECT_OPERATORS: () => SELECT_OPERATORS,
135
- SYSTEM_DATE_OPERATORS: () => SYSTEM_DATE_OPERATORS,
136
136
  SYSTEM_FIELD_OPERATORS: () => SYSTEM_FIELD_OPERATORS,
137
- ScrollableList: () => import_design_system64.ScrollableList,
138
- ScrollableListItem: () => import_design_system64.ScrollableListItem,
137
+ ScrollableList: () => import_design_system65.ScrollableList,
138
+ ScrollableListItem: () => import_design_system65.ScrollableListItem,
139
139
  SearchAndFilter: () => SearchAndFilter,
140
140
  SearchAndFilterContext: () => SearchAndFilterContext,
141
141
  SearchAndFilterOptionsContainer: () => SearchAndFilterOptionsContainer2,
@@ -147,13 +147,13 @@ __export(src_exports, {
147
147
  SortItems: () => SortItems,
148
148
  StatusMultiEditor: () => StatusMultiEditor,
149
149
  StatusSingleEditor: () => StatusSingleEditor,
150
- Switch: () => import_design_system64.Switch,
150
+ Switch: () => import_design_system65.Switch,
151
151
  TEXTBOX_OPERATORS: () => TEXTBOX_OPERATORS,
152
152
  TextEditor: () => TextEditor,
153
153
  TextMultiChoiceEditor: () => TextMultiChoiceEditor,
154
154
  TextVariableRenderer: () => TextVariableRenderer,
155
- Textarea: () => import_design_system64.Textarea,
156
- Theme: () => import_design_system64.Theme,
155
+ Textarea: () => import_design_system65.Textarea,
156
+ Theme: () => import_design_system65.Theme,
157
157
  USER_OPERATORS: () => USER_OPERATORS,
158
158
  VariableChip: () => VariableChip,
159
159
  VariableEditor: () => VariableEditor,
@@ -194,7 +194,7 @@ __export(src_exports, {
194
194
  entrySearchSelectOption: () => entrySearchSelectOption,
195
195
  entrySearchWrapper: () => entrySearchWrapper,
196
196
  filterMapper: () => filterMapper,
197
- hasReferencedVariables: () => hasReferencedVariables,
197
+ hasReferencedVariables: () => hasReferencedVariables2,
198
198
  prettifyBindExpression: () => prettifyBindExpression,
199
199
  productSearchRowActiveIcon: () => productSearchRowActiveIcon,
200
200
  productSearchRowCategory: () => productSearchRowCategory,
@@ -229,6 +229,7 @@ __export(src_exports, {
229
229
  selectedItemIcon: () => selectedItemIcon,
230
230
  selectedItemInner: () => selectedItemInner,
231
231
  selectedItemTitle: () => selectedItemTitle,
232
+ serializeVariablesEditorSerializedState: () => serializeVariablesEditorSerializedState,
232
233
  serializeVariablesEditorState: () => serializeVariablesEditorState,
233
234
  setVariablesEditorValue: () => setVariablesEditorValue,
234
235
  urlEncodeRequestParameter: () => urlEncodeRequestParameter,
@@ -249,7 +250,7 @@ __export(src_exports, {
249
250
  useVariableEditor: () => useVariableEditor,
250
251
  useVariables: () => useVariables,
251
252
  useVariablesMenu: () => useVariablesMenu,
252
- utilityColors: () => import_design_system64.utilityColors,
253
+ utilityColors: () => import_design_system65.utilityColors,
253
254
  variableDefaultTextValue: () => variableDefaultTextValue,
254
255
  variablePrefix: () => variablePrefix,
255
256
  variableSuffix: () => variableSuffix,
@@ -1220,7 +1221,8 @@ var searchRowContainer = import_react8.css`
1220
1221
  cursor: pointer;
1221
1222
  padding: var(--spacing-sm);
1222
1223
  position: relative;
1223
- transition: background-color var(--duration-fast) var(--timing-ease-out),
1224
+ transition:
1225
+ background-color var(--duration-fast) var(--timing-ease-out),
1224
1226
  color var(--duration-fast) var(--timing-ease-out);
1225
1227
  `;
1226
1228
  var searchRowContainerWithPopover = import_react8.css`
@@ -2200,7 +2202,8 @@ var productSearchRowContainer = import_react18.css`
2200
2202
  padding: var(--spacing-sm) 0;
2201
2203
  margin-right: var(--spacing-sm);
2202
2204
  position: relative;
2203
- transition: background-color var(--duration-fast) var(--timing-ease-out),
2205
+ transition:
2206
+ background-color var(--duration-fast) var(--timing-ease-out),
2204
2207
  color var(--duration-fast) var(--timing-ease-out);
2205
2208
  `;
2206
2209
  var productSearchRowContent = import_react18.css`
@@ -3036,21 +3039,52 @@ var import_design_system14 = require("@uniformdev/design-system");
3036
3039
 
3037
3040
  // src/components/Variables/composer/ControlledValuePlugin.tsx
3038
3041
  var import_LexicalComposerContext = require("@lexical/react/LexicalComposerContext");
3039
- var import_lite = require("dequal/lite");
3040
3042
  var import_react31 = require("react");
3041
3043
 
3042
- // src/components/Variables/util/setVariablesEditorValue.ts
3043
- var import_richtext = require("@uniformdev/richtext");
3044
-
3045
- // src/components/Variables/util/deserializeVariablesEditorState.ts
3044
+ // src/components/Variables/util/serializeVariablesEditorState.ts
3046
3045
  var import_canvas2 = require("@uniformdev/canvas");
3047
3046
  var import_lexical = require("lexical");
3047
+
3048
+ // src/components/Variables/util/variableExpression.ts
3049
+ var variablePrefix = "${";
3050
+ var variableSuffix = "}";
3051
+
3052
+ // src/components/Variables/util/serializeVariablesEditorState.ts
3053
+ function serializeVariablesEditorState(editorState) {
3054
+ return serializeVariablesEditorSerializedState(editorState.toJSON().root);
3055
+ }
3056
+ function serializeVariablesEditorSerializedState(serializedEditorState) {
3057
+ const buf = [];
3058
+ serializeRecursive(serializedEditorState, buf);
3059
+ const result = buf.join("");
3060
+ return result.length > 0 ? result : void 0;
3061
+ }
3062
+ function serializeRecursive(node, buffer) {
3063
+ if (node.type === import_lexical.TextNode.getType()) {
3064
+ buffer.push(node.text.replace(variablePrefix, "\\${"));
3065
+ }
3066
+ if (node.type === VariableNode.getType()) {
3067
+ buffer.push((0, import_canvas2.createVariableReference)(node.reference));
3068
+ }
3069
+ if (node.type === import_lexical.LineBreakNode.getType()) {
3070
+ buffer.push("\n");
3071
+ }
3072
+ if ("children" in node && node.children) {
3073
+ for (const child of node.children) {
3074
+ serializeRecursive(child, buffer);
3075
+ }
3076
+ }
3077
+ }
3078
+
3079
+ // src/components/Variables/util/deserializeVariablesEditorState.ts
3080
+ var import_canvas3 = require("@uniformdev/canvas");
3081
+ var import_lexical2 = require("lexical");
3048
3082
  function deserializeVariablesEditorState(serialized) {
3049
3083
  const result = [];
3050
- (0, import_canvas2.parseVariableExpression)(serialized != null ? serialized : "", (token, type) => {
3084
+ (0, import_canvas3.parseVariableExpression)(serialized != null ? serialized : "", (token, type) => {
3051
3085
  if (type === "text") {
3052
3086
  const node = {
3053
- type: import_lexical.TextNode.getType(),
3087
+ type: import_lexical2.TextNode.getType(),
3054
3088
  text: token,
3055
3089
  mode: "normal",
3056
3090
  version: 1,
@@ -3092,11 +3126,11 @@ function deserializeVariablesEditorState(serialized) {
3092
3126
  }
3093
3127
 
3094
3128
  // src/components/Variables/util/refreshVariableNodeMetadata.ts
3095
- var import_lexical2 = require("lexical");
3129
+ var import_lexical3 = require("lexical");
3096
3130
  function refreshVariableNodeMetadata(editor) {
3097
3131
  setTimeout(() => {
3098
3132
  editor.update(() => {
3099
- (0, import_lexical2.$nodesOfType)(VariableNode).forEach((variableNode) => {
3133
+ (0, import_lexical3.$nodesOfType)(VariableNode).forEach((variableNode) => {
3100
3134
  variableNode.markDirty();
3101
3135
  });
3102
3136
  });
@@ -3119,7 +3153,27 @@ function setVariablesEditorValue(editor, newValue) {
3119
3153
  "Error:",
3120
3154
  e
3121
3155
  );
3122
- const parsedState = editor.parseEditorState(import_richtext.emptyRichTextValue);
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
+ }
3176
+ });
3123
3177
  editor.setEditorState(parsedState);
3124
3178
  }
3125
3179
  }
@@ -3133,17 +3187,18 @@ function ControlledValuePlugin({
3133
3187
  extraDependencies
3134
3188
  }) {
3135
3189
  const [editor] = (0, import_LexicalComposerContext.useLexicalComposerContext)();
3136
- const lastValueRef = (0, import_react31.useRef)(value);
3137
3190
  (0, import_react31.useEffect)(() => {
3191
+ var _a, _b;
3138
3192
  if (!enabled) {
3139
3193
  return;
3140
3194
  }
3141
- if ((0, import_lite.dequal)(lastValueRef.current, value)) {
3195
+ const currentValue = (_a = serializeVariablesEditorState(editor.getEditorState())) != null ? _a : "";
3196
+ const newValue = (_b = value !== void 0 && typeof value !== "string" ? serializeVariablesEditorSerializedState(value.root) : value) != null ? _b : "";
3197
+ if (currentValue === newValue) {
3142
3198
  return;
3143
3199
  }
3144
3200
  setTimeout(() => {
3145
3201
  if (editor) {
3146
- lastValueRef.current = value;
3147
3202
  setVariablesEditorValue(editor, value);
3148
3203
  }
3149
3204
  });
@@ -3232,9 +3287,9 @@ var import_LexicalComposerContext3 = require("@lexical/react/LexicalComposerCont
3232
3287
  var import_useLexicalNodeSelection = require("@lexical/react/useLexicalNodeSelection");
3233
3288
  var import_selection = require("@lexical/selection");
3234
3289
  var import_utils2 = require("@lexical/utils");
3235
- var import_canvas4 = require("@uniformdev/canvas");
3290
+ var import_canvas5 = require("@uniformdev/canvas");
3236
3291
  var import_design_system18 = require("@uniformdev/design-system");
3237
- var import_lexical4 = require("lexical");
3292
+ var import_lexical5 = require("lexical");
3238
3293
  var import_react40 = require("react");
3239
3294
 
3240
3295
  // src/components/Variables/util/prettifyBindExpression.tsx
@@ -3249,10 +3304,10 @@ var import_LexicalComposerContext2 = require("@lexical/react/LexicalComposerCont
3249
3304
  var import_LexicalTypeaheadMenuPlugin = require("@lexical/react/LexicalTypeaheadMenuPlugin");
3250
3305
  var import_utils = require("@lexical/utils");
3251
3306
  var import_AiFillPlusCircle = require("@react-icons/all-files/ai/AiFillPlusCircle");
3252
- var import_canvas3 = require("@uniformdev/canvas");
3307
+ var import_canvas4 = require("@uniformdev/canvas");
3253
3308
  var import_design_system17 = require("@uniformdev/design-system");
3254
- var import_lite2 = require("dequal/lite");
3255
- var import_lexical3 = require("lexical");
3309
+ var import_lite = require("dequal/lite");
3310
+ var import_lexical4 = require("lexical");
3256
3311
  var import_react39 = require("react");
3257
3312
  var import_react_dom = require("react-dom");
3258
3313
 
@@ -3707,12 +3762,12 @@ function variablesToGroupedList(variables, filterFn, context) {
3707
3762
 
3708
3763
  // src/components/Variables/composer/VariablesPlugin.tsx
3709
3764
  var import_jsx_runtime33 = require("@emotion/react/jsx-runtime");
3710
- var OPEN_INSERT_VARIABLE_COMMAND = (0, import_lexical3.createCommand)("uniform:open-insert-variable");
3711
- var EDIT_VARIABLE_COMMAND = (0, import_lexical3.createCommand)("uniform:edit-variable");
3712
- var DISCONNECT_VARIABLE_COMMAND = (0, import_lexical3.createCommand)(
3765
+ var OPEN_INSERT_VARIABLE_COMMAND = (0, import_lexical4.createCommand)("uniform:open-insert-variable");
3766
+ var EDIT_VARIABLE_COMMAND = (0, import_lexical4.createCommand)("uniform:edit-variable");
3767
+ var DISCONNECT_VARIABLE_COMMAND = (0, import_lexical4.createCommand)(
3713
3768
  "uniform:disconnect-variable"
3714
3769
  );
3715
- var INSERT_VARIABLE_COMMAND = (0, import_lexical3.createCommand)("uniform:insert-variable");
3770
+ var INSERT_VARIABLE_COMMAND = (0, import_lexical4.createCommand)("uniform:insert-variable");
3716
3771
  var TRIGGER = "\\$\\$";
3717
3772
  var LENGTH_LIMIT = 20;
3718
3773
  var DollarSignVariablesRegex = new RegExp(`(^.*)(${TRIGGER}(.{0,${LENGTH_LIMIT}}))$`);
@@ -3782,7 +3837,7 @@ function useVariablesMenu({
3782
3837
  var _a;
3783
3838
  const targetVariable = variables[value];
3784
3839
  if (overwriteExistingValue) {
3785
- setVariablesEditorValue(editor, (0, import_canvas3.createVariableReference)(value));
3840
+ setVariablesEditorValue(editor, (0, import_canvas4.createVariableReference)(value));
3786
3841
  return true;
3787
3842
  }
3788
3843
  const variableNode = $createVariableNode(value, {
@@ -3796,7 +3851,7 @@ function useVariablesMenu({
3796
3851
  if (nodeToReplace) {
3797
3852
  nodeToReplace.replace(variableNode);
3798
3853
  } else {
3799
- (0, import_lexical3.$insertNodes)([variableNode]);
3854
+ (0, import_lexical4.$insertNodes)([variableNode]);
3800
3855
  }
3801
3856
  });
3802
3857
  }
@@ -3879,11 +3934,11 @@ function VariablesPlugin({
3879
3934
  return;
3880
3935
  }
3881
3936
  editor.update(() => {
3882
- const selection = (0, import_lexical3.$getSelection)();
3883
- if ((0, import_lexical3.$isNodeSelection)(selection)) {
3937
+ const selection = (0, import_lexical4.$getSelection)();
3938
+ if ((0, import_lexical4.$isNodeSelection)(selection)) {
3884
3939
  const selectedNodes = selection.getNodes();
3885
3940
  if (selectedNodes.every((node) => $isVariableNode(node))) {
3886
- (0, import_lexical3.$setSelection)(null);
3941
+ (0, import_lexical4.$setSelection)(null);
3887
3942
  }
3888
3943
  }
3889
3944
  });
@@ -3899,7 +3954,7 @@ function VariablesPlugin({
3899
3954
  }
3900
3955
  return true;
3901
3956
  },
3902
- import_lexical3.COMMAND_PRIORITY_NORMAL
3957
+ import_lexical4.COMMAND_PRIORITY_NORMAL
3903
3958
  ),
3904
3959
  // disconnects a variable node from its variable value and leaves the variable's default value
3905
3960
  // as a string literal in its place. Note that single-valued binding UIs override this so that it
@@ -3909,17 +3964,17 @@ function VariablesPlugin({
3909
3964
  ({ sourceKey }) => {
3910
3965
  editor.update(() => {
3911
3966
  var _a;
3912
- const currentNode = (0, import_lexical3.$getNodeByKey)(sourceKey);
3967
+ const currentNode = (0, import_lexical4.$getNodeByKey)(sourceKey);
3913
3968
  if (!$isVariableNode(currentNode)) {
3914
3969
  throw new Error("Cannot disconnect a non-variable node");
3915
3970
  }
3916
3971
  const currentVariableDefinition = variablesRef.current.variables[currentNode.reference];
3917
- const variableTextNode = (0, import_lexical3.$createTextNode)(
3972
+ const variableTextNode = (0, import_lexical4.$createTextNode)(
3918
3973
  variableDefaultTextValue(
3919
3974
  (_a = currentVariableDefinition == null ? void 0 : currentVariableDefinition.default) != null ? _a : currentNode.getState().displayName
3920
3975
  )
3921
3976
  );
3922
- const variableNode = (0, import_lexical3.$getNodeByKey)(sourceKey);
3977
+ const variableNode = (0, import_lexical4.$getNodeByKey)(sourceKey);
3923
3978
  if (!variableNode) {
3924
3979
  console.error("Disconnected from unknown node.");
3925
3980
  return true;
@@ -3929,7 +3984,7 @@ function VariablesPlugin({
3929
3984
  });
3930
3985
  return true;
3931
3986
  },
3932
- import_lexical3.COMMAND_PRIORITY_NORMAL
3987
+ import_lexical4.COMMAND_PRIORITY_NORMAL
3933
3988
  ),
3934
3989
  editor.registerCommand(
3935
3990
  OPEN_INSERT_VARIABLE_COMMAND,
@@ -3949,7 +4004,7 @@ function VariablesPlugin({
3949
4004
  }
3950
4005
  return true;
3951
4006
  },
3952
- import_lexical3.COMMAND_PRIORITY_NORMAL
4007
+ import_lexical4.COMMAND_PRIORITY_NORMAL
3953
4008
  ),
3954
4009
  // register the insert variable command, used to handle inserting
3955
4010
  // a variable reference from non-autocomplete menus at the current selection,
@@ -3960,27 +4015,33 @@ function VariablesPlugin({
3960
4015
  var _a, _b;
3961
4016
  if (!disableVariables) {
3962
4017
  const targetVariable = variablesRef.current.variables[reference];
3963
- if (overwriteExistingValue) {
3964
- setVariablesEditorValue(editor, (0, import_canvas3.createVariableReference)(reference));
3965
- return true;
3966
- }
3967
4018
  const variableNode = $createVariableNode(reference, {
3968
- displayName: initialDisplayName != null ? initialDisplayName : (targetVariable == null ? void 0 : targetVariable.displayName) || reference,
4019
+ displayName: initialDisplayName != null ? initialDisplayName : (targetVariable == null ? void 0 : targetVariable.displayName) || prettifyBindExpression(reference),
3969
4020
  hasClickEvent: canEditVariable(reference, targetVariable),
3970
4021
  referenceIsValid: true,
3971
4022
  tooltip: (_a = targetVariable == null ? void 0 : targetVariable.tooltip) != null ? _a : targetVariable == null ? void 0 : targetVariable.helpText,
3972
4023
  isFresh: true,
3973
4024
  isLoading: false
3974
4025
  });
4026
+ if (overwriteExistingValue) {
4027
+ const pNode = (0, import_lexical4.$createParagraphNode)();
4028
+ pNode.append(variableNode);
4029
+ editor.update(() => {
4030
+ const root = (0, import_lexical4.$getRoot)();
4031
+ root.clear();
4032
+ root.append(pNode);
4033
+ });
4034
+ return true;
4035
+ }
3975
4036
  if (targetKey) {
3976
- (_b = (0, import_lexical3.$getNodeByKey)(targetKey)) == null ? void 0 : _b.replace(variableNode);
4037
+ (_b = (0, import_lexical4.$getNodeByKey)(targetKey)) == null ? void 0 : _b.replace(variableNode);
3977
4038
  } else {
3978
- (0, import_lexical3.$insertNodes)([variableNode]);
4039
+ (0, import_lexical4.$insertNodes)([variableNode]);
3979
4040
  }
3980
4041
  }
3981
4042
  return true;
3982
4043
  },
3983
- import_lexical3.COMMAND_PRIORITY_NORMAL
4044
+ import_lexical4.COMMAND_PRIORITY_NORMAL
3984
4045
  )
3985
4046
  );
3986
4047
  }, [
@@ -4007,14 +4068,14 @@ function VariablesPlugin({
4007
4068
  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;
4008
4069
  const newState = {
4009
4070
  ...currentState,
4010
- displayName: (targetVar == null ? void 0 : targetVar.displayName) || (targetUndefinedVar == null ? void 0 : targetUndefinedVar.displayName) || variableNode.reference,
4071
+ displayName: (targetVar == null ? void 0 : targetVar.displayName) || (targetUndefinedVar == null ? void 0 : targetUndefinedVar.displayName) || prettifyBindExpression(variableNode.reference),
4011
4072
  isLoading: isLoadingVariables && !targetVar && !(targetUndefinedVar == null ? void 0 : targetUndefinedVar.info),
4012
4073
  hasClickEvent: canEditVariable(variableNode.reference, targetVar),
4013
4074
  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),
4014
4075
  tooltip,
4015
4076
  isFresh: false
4016
4077
  };
4017
- if (!(0, import_lite2.dequal)(currentState, newState)) {
4078
+ if (!(0, import_lite.dequal)(currentState, newState)) {
4018
4079
  variableNode.setState(newState);
4019
4080
  }
4020
4081
  },
@@ -4022,7 +4083,7 @@ function VariablesPlugin({
4022
4083
  );
4023
4084
  (0, import_react39.useEffect)(() => {
4024
4085
  editor.update(() => {
4025
- (0, import_lexical3.$nodesOfType)(VariableNode).forEach((variableNode) => {
4086
+ (0, import_lexical4.$nodesOfType)(VariableNode).forEach((variableNode) => {
4026
4087
  updateExistingNodeIfChanged(variableNode);
4027
4088
  });
4028
4089
  });
@@ -4112,7 +4173,7 @@ function VariablesPlugin({
4112
4173
 
4113
4174
  // src/components/Variables/composer/VariableNode.tsx
4114
4175
  var import_jsx_runtime34 = require("@emotion/react/jsx-runtime");
4115
- var VariableNode = class _VariableNode extends import_lexical4.DecoratorNode {
4176
+ var VariableNode = class _VariableNode extends import_lexical5.DecoratorNode {
4116
4177
  constructor(reference, state, key) {
4117
4178
  super(key);
4118
4179
  this.reference = reference;
@@ -4161,7 +4222,7 @@ var VariableNode = class _VariableNode extends import_lexical4.DecoratorNode {
4161
4222
  * (albeit it won't get the fancy chip-node)
4162
4223
  */
4163
4224
  getTextContent() {
4164
- return (0, import_canvas4.createVariableReference)(this.reference);
4225
+ return (0, import_canvas5.createVariableReference)(this.reference);
4165
4226
  }
4166
4227
  /** Creates the DOM wrapper that hosts the node */
4167
4228
  createDOM() {
@@ -4195,9 +4256,9 @@ function VariableNodeComponent({
4195
4256
  const readOnly = !editor.isEditable();
4196
4257
  const onDelete = (0, import_react40.useCallback)(
4197
4258
  (event) => {
4198
- if (isSelected && (0, import_lexical4.$isNodeSelection)((0, import_lexical4.$getSelection)())) {
4259
+ if (isSelected && (0, import_lexical5.$isNodeSelection)((0, import_lexical5.$getSelection)())) {
4199
4260
  event.preventDefault();
4200
- const node = (0, import_lexical4.$getNodeByKey)(nodeKey);
4261
+ const node = (0, import_lexical5.$getNodeByKey)(nodeKey);
4201
4262
  if ($isVariableNode(node)) {
4202
4263
  node.remove();
4203
4264
  }
@@ -4208,18 +4269,18 @@ function VariableNodeComponent({
4208
4269
  );
4209
4270
  (0, import_react40.useEffect)(() => {
4210
4271
  return (0, import_utils2.mergeRegister)(
4211
- editor.registerCommand(import_lexical4.KEY_DELETE_COMMAND, onDelete, import_lexical4.COMMAND_PRIORITY_LOW),
4212
- editor.registerCommand(import_lexical4.KEY_BACKSPACE_COMMAND, onDelete, import_lexical4.COMMAND_PRIORITY_LOW),
4272
+ editor.registerCommand(import_lexical5.KEY_DELETE_COMMAND, onDelete, import_lexical5.COMMAND_PRIORITY_LOW),
4273
+ editor.registerCommand(import_lexical5.KEY_BACKSPACE_COMMAND, onDelete, import_lexical5.COMMAND_PRIORITY_LOW),
4213
4274
  // HACK: see https://github.com/facebook/lexical/issues/4214
4214
4275
  // Copied from https://github.com/facebook/lexical/blob/d4b192289d3714b34614b411d40e513d1f86f413/packages/lexical-rich-text/src/index.ts#L775
4215
4276
  // Fixes selection moving into and out of this node with arrow keys and plain text plugin.
4216
4277
  // If the above bug is fixed this may be removable. It's been tested when this is used within the RTE,
4217
4278
  // and seems to work ok there. It should also unregister itself when not in the context of the node. I think?
4218
4279
  editor.registerCommand(
4219
- import_lexical4.KEY_ARROW_LEFT_COMMAND,
4280
+ import_lexical5.KEY_ARROW_LEFT_COMMAND,
4220
4281
  (event) => {
4221
- const selection = (0, import_lexical4.$getSelection)();
4222
- if ((0, import_lexical4.$isNodeSelection)(selection)) {
4282
+ const selection = (0, import_lexical5.$getSelection)();
4283
+ if ((0, import_lexical5.$isNodeSelection)(selection)) {
4223
4284
  const nodes = selection.getNodes();
4224
4285
  if (nodes.length > 0) {
4225
4286
  event.preventDefault();
@@ -4227,7 +4288,7 @@ function VariableNodeComponent({
4227
4288
  return true;
4228
4289
  }
4229
4290
  }
4230
- if (!(0, import_lexical4.$isRangeSelection)(selection)) {
4291
+ if (!(0, import_lexical5.$isRangeSelection)(selection)) {
4231
4292
  return false;
4232
4293
  }
4233
4294
  if ((0, import_selection.$shouldOverrideDefaultCharacterSelection)(selection, true)) {
@@ -4238,15 +4299,15 @@ function VariableNodeComponent({
4238
4299
  }
4239
4300
  return false;
4240
4301
  },
4241
- import_lexical4.COMMAND_PRIORITY_EDITOR
4302
+ import_lexical5.COMMAND_PRIORITY_EDITOR
4242
4303
  ),
4243
4304
  // HACK: as above
4244
4305
  // Source: https://github.com/facebook/lexical/blob/d4b192289d3714b34614b411d40e513d1f86f413/packages/lexical-rich-text/src/index.ts#L802C5-L831C7
4245
4306
  editor.registerCommand(
4246
- import_lexical4.KEY_ARROW_RIGHT_COMMAND,
4307
+ import_lexical5.KEY_ARROW_RIGHT_COMMAND,
4247
4308
  (event) => {
4248
- const selection = (0, import_lexical4.$getSelection)();
4249
- if ((0, import_lexical4.$isNodeSelection)(selection) && !$isTargetWithinDecorator(event.target)) {
4309
+ const selection = (0, import_lexical5.$getSelection)();
4310
+ if ((0, import_lexical5.$isNodeSelection)(selection) && !$isTargetWithinDecorator(event.target)) {
4250
4311
  const nodes = selection.getNodes();
4251
4312
  if (nodes.length > 0) {
4252
4313
  event.preventDefault();
@@ -4254,7 +4315,7 @@ function VariableNodeComponent({
4254
4315
  return true;
4255
4316
  }
4256
4317
  }
4257
- if (!(0, import_lexical4.$isRangeSelection)(selection)) {
4318
+ if (!(0, import_lexical5.$isRangeSelection)(selection)) {
4258
4319
  return false;
4259
4320
  }
4260
4321
  const isHoldingShift = event.shiftKey;
@@ -4265,7 +4326,7 @@ function VariableNodeComponent({
4265
4326
  }
4266
4327
  return false;
4267
4328
  },
4268
- import_lexical4.COMMAND_PRIORITY_EDITOR
4329
+ import_lexical5.COMMAND_PRIORITY_EDITOR
4269
4330
  )
4270
4331
  );
4271
4332
  }, [clearSelection, editor, isSelected, nodeKey, onDelete, setSelected]);
@@ -4289,8 +4350,8 @@ function VariableNodeComponent({
4289
4350
  );
4290
4351
  }
4291
4352
  function $isTargetWithinDecorator(target) {
4292
- const node = (0, import_lexical4.$getNearestNodeFromDOMNode)(target);
4293
- return (0, import_lexical4.$isDecoratorNode)(node);
4353
+ const node = (0, import_lexical5.$getNearestNodeFromDOMNode)(target);
4354
+ return (0, import_lexical5.$isDecoratorNode)(node);
4294
4355
  }
4295
4356
 
4296
4357
  // src/components/Variables/InputVariables.tsx
@@ -4316,19 +4377,19 @@ function EditorRefPlugin({
4316
4377
  // src/components/Variables/composer/PasteTransformerPlugin.tsx
4317
4378
  var import_LexicalComposerContext5 = require("@lexical/react/LexicalComposerContext");
4318
4379
  var import_utils3 = require("@lexical/utils");
4319
- var import_lexical5 = require("lexical");
4380
+ var import_lexical6 = require("lexical");
4320
4381
  var import_react41 = require("react");
4321
4382
  function PasteTransformerPlugin({ transformPaste }) {
4322
4383
  const [editor] = (0, import_LexicalComposerContext5.useLexicalComposerContext)();
4323
4384
  (0, import_react41.useEffect)(() => {
4324
4385
  return (0, import_utils3.mergeRegister)(
4325
4386
  editor.registerCommand(
4326
- import_lexical5.PASTE_COMMAND,
4387
+ import_lexical6.PASTE_COMMAND,
4327
4388
  (event) => {
4328
4389
  var _a;
4329
- const selection = (0, import_lexical5.$getSelection)();
4390
+ const selection = (0, import_lexical6.$getSelection)();
4330
4391
  const pastedText = (_a = event.clipboardData) == null ? void 0 : _a.getData("text/plain");
4331
- if (pastedText && transformPaste && (0, import_lexical5.$isRangeSelection)(selection)) {
4392
+ if (pastedText && transformPaste && (0, import_lexical6.$isRangeSelection)(selection)) {
4332
4393
  const result = transformPaste(pastedText);
4333
4394
  if (result !== void 0) {
4334
4395
  selection.insertText(result);
@@ -4337,7 +4398,7 @@ function PasteTransformerPlugin({ transformPaste }) {
4337
4398
  }
4338
4399
  return false;
4339
4400
  },
4340
- import_lexical5.COMMAND_PRIORITY_HIGH
4401
+ import_lexical6.COMMAND_PRIORITY_HIGH
4341
4402
  )
4342
4403
  );
4343
4404
  }, [editor, transformPaste]);
@@ -4366,9 +4427,11 @@ var input = import_react42.css`
4366
4427
  min-height: 50px;
4367
4428
  width: 100%;
4368
4429
  position: relative;
4369
- transition: background var(--duration-fast) var(--timing-ease-out),
4430
+ transition:
4431
+ background var(--duration-fast) var(--timing-ease-out),
4370
4432
  border-color var(--duration-fast) var(--timing-ease-out),
4371
- color var(--duration-fast) var(--timing-ease-out), box-shadow var(--duration-fast) var(--timing-ease-out);
4433
+ color var(--duration-fast) var(--timing-ease-out),
4434
+ box-shadow var(--duration-fast) var(--timing-ease-out);
4372
4435
 
4373
4436
  &::placeholder {
4374
4437
  color: var(--gray-400);
@@ -4432,7 +4495,8 @@ var variableBindButton = import_react43.css`
4432
4495
  display: flex;
4433
4496
  height: 1.2rem;
4434
4497
  padding: var(--spacing-2xs);
4435
- transition: background var(--duration-fast) var(--timing-ease-out),
4498
+ transition:
4499
+ background var(--duration-fast) var(--timing-ease-out),
4436
4500
  color var(--duration-fast) var(--timing-ease-out);
4437
4501
  width: 1.2rem;
4438
4502
 
@@ -4515,23 +4579,9 @@ var inputMultiLine = (lines) => import_react43.css`
4515
4579
  `;
4516
4580
 
4517
4581
  // src/components/Variables/toolbox/InputVariablesProvider.tsx
4582
+ var import_canvas6 = require("@uniformdev/canvas");
4518
4583
  var React10 = __toESM(require("react"));
4519
4584
  var import_react44 = require("react");
4520
-
4521
- // src/components/Variables/util/hasReferencedVariables.ts
4522
- var import_canvas5 = require("@uniformdev/canvas");
4523
- function hasReferencedVariables(value) {
4524
- let result = false;
4525
- (0, import_canvas5.parseVariableExpression)(value, (token, type) => {
4526
- if (type === "variable") {
4527
- result = true;
4528
- return false;
4529
- }
4530
- });
4531
- return result;
4532
- }
4533
-
4534
- // src/components/Variables/toolbox/InputVariablesProvider.tsx
4535
4585
  function useInputVariablesState({
4536
4586
  value,
4537
4587
  onChange,
@@ -4546,20 +4596,20 @@ function useInputVariablesState({
4546
4596
  renderMenuInPortal
4547
4597
  }) {
4548
4598
  const { variables } = useVariables(true);
4549
- const hasVariablesInValue = hasReferencedVariables(value != null ? value : "");
4599
+ const variableReferenceCountInValue = (0, import_canvas6.hasReferencedVariables)(value != null ? value : "");
4550
4600
  const [lastKnownId] = React10.useState(id);
4551
- const [hadVariablesInValue, setHadVariablesInValue] = React10.useState(hasVariablesInValue);
4601
+ const [hadVariablesInValue, setHadVariablesInValue] = React10.useState(variableReferenceCountInValue > 0);
4552
4602
  React10.useEffect(() => {
4553
- if (hasVariablesInValue) {
4603
+ if (variableReferenceCountInValue) {
4554
4604
  setHadVariablesInValue(true);
4555
4605
  }
4556
- }, [hasVariablesInValue]);
4606
+ }, [variableReferenceCountInValue]);
4557
4607
  React10.useEffect(() => {
4558
4608
  if (id !== lastKnownId) {
4559
- setHadVariablesInValue(hasVariablesInValue);
4609
+ setHadVariablesInValue(variableReferenceCountInValue > 0);
4560
4610
  }
4561
- }, [hasVariablesInValue, id, lastKnownId]);
4562
- const hadVariablesInValueForReals = inputWhenNoVariables ? hadVariablesInValue : hasVariablesInValue;
4611
+ }, [variableReferenceCountInValue, id, lastKnownId]);
4612
+ const hadVariablesInValueForReals = inputWhenNoVariables ? hadVariablesInValue : variableReferenceCountInValue > 0;
4563
4613
  const disableVariablesForReals = disableVariables || Object.keys(variables).length === 0 && !showAddVariableMenuOption;
4564
4614
  const disableResetForReals = !inputWhenNoVariables || !hadVariablesInValueForReals;
4565
4615
  const sharedMenuProps = (0, import_react44.useMemo)(
@@ -4588,7 +4638,7 @@ function useInputVariablesState({
4588
4638
  return {
4589
4639
  sharedMenuProps,
4590
4640
  disableVariablesForReals,
4591
- hasVariablesInValue,
4641
+ hasVariablesInValue: variableReferenceCountInValue > 0,
4592
4642
  hadVariablesInValue: hadVariablesInValueForReals,
4593
4643
  setHadVariablesInValue
4594
4644
  };
@@ -4611,7 +4661,8 @@ var variableBindButton2 = import_react45.css`
4611
4661
  display: flex;
4612
4662
  height: 1.2rem;
4613
4663
  padding: var(--spacing-2xs);
4614
- transition: background var(--duration-fast) var(--timing-ease-out),
4664
+ transition:
4665
+ background var(--duration-fast) var(--timing-ease-out),
4615
4666
  color var(--duration-fast) var(--timing-ease-out);
4616
4667
  width: 1.2rem;
4617
4668
 
@@ -4629,7 +4680,7 @@ var variableBindButton2 = import_react45.css`
4629
4680
 
4630
4681
  // src/components/Variables/toolbox/VariablesComposerVariableMenu.tsx
4631
4682
  var import_LexicalComposerContext6 = require("@lexical/react/LexicalComposerContext");
4632
- var import_lexical6 = require("lexical");
4683
+ var import_lexical7 = require("lexical");
4633
4684
 
4634
4685
  // src/components/Variables/toolbox/SelectVariableMenu.tsx
4635
4686
  var import_BsFillPlusCircleFill = require("@react-icons/all-files/bs/BsFillPlusCircleFill");
@@ -4737,7 +4788,7 @@ function VariablesComposerVariableMenu(props) {
4737
4788
  };
4738
4789
  const onResetVariable = () => {
4739
4790
  var _a;
4740
- editor.dispatchCommand(import_lexical6.CLEAR_EDITOR_COMMAND, void 0);
4791
+ editor.dispatchCommand(import_lexical7.CLEAR_EDITOR_COMMAND, void 0);
4741
4792
  (_a = props.onResetVariables) == null ? void 0 : _a.call(props);
4742
4793
  };
4743
4794
  return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
@@ -4799,50 +4850,18 @@ function DisablePlugin({ disabled }) {
4799
4850
 
4800
4851
  // src/components/Variables/composer/SingleLineTextPlugin.tsx
4801
4852
  var import_LexicalComposerContext8 = require("@lexical/react/LexicalComposerContext");
4802
- var import_lexical7 = require("lexical");
4853
+ var import_lexical8 = require("lexical");
4803
4854
  var import_react48 = require("react");
4804
4855
  function SingleLineTextPlugin() {
4805
4856
  const [editor] = (0, import_LexicalComposerContext8.useLexicalComposerContext)();
4806
4857
  (0, import_react48.useEffect)(() => {
4807
- editor.registerNodeTransform(import_lexical7.LineBreakNode, (node) => {
4858
+ editor.registerNodeTransform(import_lexical8.LineBreakNode, (node) => {
4808
4859
  node.remove();
4809
4860
  });
4810
4861
  }, [editor]);
4811
4862
  return null;
4812
4863
  }
4813
4864
 
4814
- // src/components/Variables/util/serializeVariablesEditorState.ts
4815
- var import_canvas6 = require("@uniformdev/canvas");
4816
- var import_lexical8 = require("lexical");
4817
-
4818
- // src/components/Variables/util/variableExpression.ts
4819
- var variablePrefix = "${";
4820
- var variableSuffix = "}";
4821
-
4822
- // src/components/Variables/util/serializeVariablesEditorState.ts
4823
- function serializeVariablesEditorState(editorState) {
4824
- const buf = [];
4825
- serializeRecursive(editorState.toJSON().root, buf);
4826
- const result = buf.join("");
4827
- return result.length > 0 ? result : void 0;
4828
- }
4829
- function serializeRecursive(node, buffer) {
4830
- if (node.type === import_lexical8.TextNode.getType()) {
4831
- buffer.push(node.text.replace(variablePrefix, "\\${"));
4832
- }
4833
- if (node.type === VariableNode.getType()) {
4834
- buffer.push((0, import_canvas6.createVariableReference)(node.reference));
4835
- }
4836
- if (node.type === import_lexical8.LineBreakNode.getType()) {
4837
- buffer.push("\n");
4838
- }
4839
- if ("children" in node && node.children) {
4840
- for (const child of node.children) {
4841
- serializeRecursive(child, buffer);
4842
- }
4843
- }
4844
- }
4845
-
4846
4865
  // src/components/Variables/toolbox/VariablesComposer.tsx
4847
4866
  var import_jsx_runtime38 = require("@emotion/react/jsx-runtime");
4848
4867
  function VariablesComposer(props) {
@@ -5037,7 +5056,8 @@ function InputVariables(props) {
5037
5056
  filterVariable,
5038
5057
  styleVariant = "default",
5039
5058
  renderMenuInPortal,
5040
- disableDismissEditorOnChange
5059
+ disableDismissEditorOnChange,
5060
+ singleTokenMode
5041
5061
  } = props;
5042
5062
  const [finalId] = (0, import_react52.useState)(id != null ? id : () => (0, import_uuid2.v4)());
5043
5063
  const { dispatch, canDispatch, isEditing } = useVariables(true);
@@ -5102,7 +5122,7 @@ function InputVariables(props) {
5102
5122
  buttonCss: variableBindButton,
5103
5123
  tip: useInputWithNoVariables ? void 0 : "Tip: access this list by typing $$",
5104
5124
  buttonProps: hadVariablesInValue ? { "aria-pressed": "true" } : void 0,
5105
- replaceValueOnVariableInsert: useInputWithNoVariables
5125
+ replaceValueOnVariableInsert: singleTokenMode || useInputWithNoVariables
5106
5126
  }
5107
5127
  )
5108
5128
  ]
@@ -5142,13 +5162,13 @@ function InputVariables(props) {
5142
5162
  showAddVariableMenuOption,
5143
5163
  enableEditingVariables: !disabled && !disableVariablesForReals && enableEditingVariables,
5144
5164
  getEditorContext,
5145
- disabled,
5165
+ disabled: disabled || singleTokenMode,
5146
5166
  replaceValueOnVariableInsert: useInputWithNoVariables,
5147
5167
  autoFocus,
5148
5168
  filterVariable,
5149
5169
  children: [
5150
5170
  /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(PasteTransformerPlugin, { transformPaste }),
5151
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ControlledValuePlugin, { value, enabled: useInputWithNoVariables }),
5171
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ControlledValuePlugin, { value, enabled: singleTokenMode || useInputWithNoVariables }),
5152
5172
  editorRef ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(EditorRefPlugin, { editorRef }) : null,
5153
5173
  body
5154
5174
  ]
@@ -5206,7 +5226,7 @@ function ParameterConnectionIndicator({
5206
5226
  return result;
5207
5227
  }, [value]);
5208
5228
  return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_design_system22.HorizontalRhythm, { align: "center", gap: "xs", css: { width: "100%" }, children: [
5209
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { css: { flex: 1, maxWidth: "100%" }, children }),
5229
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { css: { flex: 1 }, children }),
5210
5230
  disabled ? null : /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
5211
5231
  import_design_system22.Menu,
5212
5232
  {
@@ -5444,6 +5464,12 @@ ${prettifyBindExpression(bindExpression)}`
5444
5464
  };
5445
5465
  }
5446
5466
 
5467
+ // src/components/Variables/util/hasReferencedVariables.ts
5468
+ var import_canvas8 = require("@uniformdev/canvas");
5469
+ function hasReferencedVariables2(value) {
5470
+ return (0, import_canvas8.hasReferencedVariables)(value) > 0;
5471
+ }
5472
+
5447
5473
  // src/components/Variables/VariablesList.tsx
5448
5474
  var import_react58 = require("@emotion/react");
5449
5475
  var import_design_system25 = require("@uniformdev/design-system");
@@ -6472,11 +6498,11 @@ var DataRefreshButton = ({
6472
6498
 
6473
6499
  // src/components/ObjectSearch/ObjectSearchContainer.tsx
6474
6500
  var import_react68 = require("@emotion/react");
6475
- var import_canvas9 = require("@uniformdev/canvas");
6501
+ var import_canvas10 = require("@uniformdev/canvas");
6476
6502
  var import_design_system35 = require("@uniformdev/design-system");
6477
6503
 
6478
6504
  // src/components/ObjectSearch/hooks/ObjectSearchContext.tsx
6479
- var import_canvas8 = require("@uniformdev/canvas");
6505
+ var import_canvas9 = require("@uniformdev/canvas");
6480
6506
  var import_react66 = require("react");
6481
6507
  var import_jsx_runtime59 = require("@emotion/react/jsx-runtime");
6482
6508
  var ObjectSearchContext = (0, import_react66.createContext)({
@@ -6575,7 +6601,7 @@ function useObjectSearchContext() {
6575
6601
  return (0, import_react66.useContext)(ObjectSearchContext);
6576
6602
  }
6577
6603
  function bindQuery(query, inputs) {
6578
- const { result, errors } = (0, import_canvas8.bindVariablesToObject)({
6604
+ const { result, errors } = (0, import_canvas9.bindVariablesToObject)({
6579
6605
  value: query,
6580
6606
  variables: inputs,
6581
6607
  errorPrefix: "Dynamic input"
@@ -6764,7 +6790,7 @@ var ObjectSearchContainer = ({
6764
6790
  onSelectItem([]);
6765
6791
  return;
6766
6792
  }
6767
- const { result, errors } = (0, import_canvas9.bindVariables)({
6793
+ const { result, errors } = (0, import_canvas10.bindVariables)({
6768
6794
  value: selectedValue,
6769
6795
  variables: flatVariables,
6770
6796
  errorPrefix: "Dynamic input"
@@ -6931,7 +6957,8 @@ var ButtonStyles = import_react71.css`
6931
6957
  font-size: var(--fs-sm);
6932
6958
  line-height: 1;
6933
6959
  gap: var(--spacing-xs);
6934
- transition: border-color var(--duration-fast) var(--timing-ease-out),
6960
+ transition:
6961
+ border-color var(--duration-fast) var(--timing-ease-out),
6935
6962
  background-color var(--duration-fast) var(--timing-ease-out);
6936
6963
 
6937
6964
  &:hover {
@@ -7447,371 +7474,445 @@ var JsonMeshVariableEditor = ({
7447
7474
  var NUMBER_OPERATORS = [
7448
7475
  {
7449
7476
  label: "equals...",
7450
- symbol: "=",
7451
7477
  value: "eq",
7452
- editorType: "number"
7478
+ editorType: "number",
7479
+ expectedValueType: "single"
7453
7480
  },
7454
7481
  {
7455
7482
  label: "does not equal...",
7456
- symbol: "\u2260",
7457
7483
  value: "neq",
7458
- editorType: "number"
7484
+ editorType: "number",
7485
+ expectedValueType: "single"
7459
7486
  },
7460
7487
  {
7461
7488
  label: "greater than...",
7462
- symbol: ">",
7463
7489
  value: "gt",
7464
- editorType: "number"
7490
+ editorType: "number",
7491
+ expectedValueType: "single"
7465
7492
  },
7466
7493
  {
7467
7494
  label: "greater than or equal to...",
7468
- symbol: "\u2265",
7469
7495
  value: "gte",
7470
- editorType: "number"
7496
+ editorType: "number",
7497
+ expectedValueType: "single"
7471
7498
  },
7472
7499
  {
7473
7500
  label: "less than...",
7474
- symbol: "<",
7475
7501
  value: "lt",
7476
- editorType: "number"
7502
+ editorType: "number",
7503
+ expectedValueType: "single"
7477
7504
  },
7478
7505
  {
7479
7506
  label: "less than or equal to...",
7480
- symbol: "\u2264",
7481
7507
  value: "lte",
7482
- editorType: "number"
7508
+ editorType: "number",
7509
+ expectedValueType: "single"
7483
7510
  },
7484
7511
  {
7485
7512
  label: "is empty",
7486
7513
  value: "ndef",
7487
- editorType: "empty"
7514
+ editorType: "empty",
7515
+ expectedValueType: "false"
7488
7516
  },
7489
7517
  {
7490
7518
  label: "is between...",
7491
7519
  value: "between",
7492
- editorType: "numberRange"
7520
+ editorType: "numberRange",
7521
+ expectedValueType: "between"
7493
7522
  },
7494
7523
  {
7495
7524
  label: "is not empty",
7496
7525
  value: "def",
7497
- editorType: "empty"
7526
+ editorType: "empty",
7527
+ expectedValueType: "true"
7498
7528
  }
7499
7529
  ];
7500
7530
  var DATE_OPERATORS = [
7501
7531
  {
7502
7532
  label: "is",
7503
7533
  value: "eq",
7504
- editorType: "date"
7534
+ editorType: "date",
7535
+ expectedValueType: "single"
7505
7536
  },
7506
7537
  {
7507
7538
  label: "is between...",
7508
7539
  value: "between",
7509
- editorType: "dateRange"
7540
+ editorType: "dateRange",
7541
+ expectedValueType: "between"
7510
7542
  },
7511
7543
  {
7512
7544
  label: "is before...",
7513
7545
  value: "lt",
7514
- editorType: "date"
7546
+ editorType: "date",
7547
+ expectedValueType: "single"
7515
7548
  },
7516
7549
  {
7517
7550
  label: "is after...",
7518
7551
  value: "gt",
7519
- editorType: "date"
7552
+ editorType: "date",
7553
+ expectedValueType: "single"
7520
7554
  },
7521
7555
  {
7522
7556
  label: "is on or before...",
7523
7557
  value: "lte",
7524
- editorType: "date"
7558
+ editorType: "date",
7559
+ expectedValueType: "single"
7525
7560
  },
7526
7561
  {
7527
7562
  label: "is on or after...",
7528
7563
  value: "gte",
7529
- editorType: "date"
7564
+ editorType: "date",
7565
+ expectedValueType: "single"
7530
7566
  },
7531
7567
  {
7532
7568
  label: "is empty",
7533
7569
  value: "ndef",
7534
- editorType: "empty"
7570
+ editorType: "empty",
7571
+ expectedValueType: "false"
7535
7572
  },
7536
7573
  {
7537
7574
  label: "is not",
7538
7575
  value: "neq",
7539
- editorType: "date"
7576
+ editorType: "date",
7577
+ expectedValueType: "single"
7540
7578
  },
7541
7579
  {
7542
7580
  label: "is not empty",
7543
7581
  value: "def",
7544
- editorType: "empty"
7582
+ editorType: "empty",
7583
+ expectedValueType: "true"
7545
7584
  }
7546
7585
  ];
7547
7586
  var TEXTBOX_OPERATORS = [
7548
7587
  {
7549
7588
  label: "contains...",
7550
7589
  value: "match",
7551
- editorType: "text"
7590
+ editorType: "text",
7591
+ expectedValueType: "single"
7552
7592
  },
7553
7593
  {
7554
7594
  label: "is",
7555
7595
  value: "eq",
7556
- editorType: "text"
7596
+ editorType: "text",
7597
+ expectedValueType: "single"
7557
7598
  },
7558
7599
  {
7559
7600
  label: "is empty",
7560
7601
  value: "ndef",
7561
- editorType: "empty"
7602
+ editorType: "empty",
7603
+ expectedValueType: "false"
7562
7604
  },
7563
7605
  {
7564
7606
  label: "starts with...",
7565
7607
  value: "starts",
7566
- editorType: "text"
7608
+ editorType: "text",
7609
+ expectedValueType: "single"
7567
7610
  },
7568
7611
  {
7569
7612
  label: "is not",
7570
7613
  value: "neq",
7571
- editorType: "text"
7614
+ editorType: "text",
7615
+ expectedValueType: "single"
7572
7616
  },
7573
7617
  {
7574
7618
  label: "is not empty",
7575
7619
  value: "def",
7576
- editorType: "empty"
7620
+ editorType: "empty",
7621
+ expectedValueType: "true"
7577
7622
  }
7578
7623
  ];
7579
7624
  var USER_OPERATORS = [
7580
7625
  {
7581
7626
  label: "contains...",
7582
7627
  value: "match",
7583
- editorType: "text"
7628
+ editorType: "text",
7629
+ expectedValueType: "single"
7584
7630
  },
7585
7631
  {
7586
7632
  label: "is",
7587
7633
  value: "eq",
7588
- editorType: "text"
7634
+ editorType: "text",
7635
+ expectedValueType: "single"
7589
7636
  },
7590
7637
  {
7591
7638
  label: "starts with...",
7592
7639
  value: "starts",
7593
- editorType: "text"
7640
+ editorType: "text",
7641
+ expectedValueType: "single"
7594
7642
  },
7595
7643
  {
7596
7644
  label: "is not",
7597
7645
  value: "neq",
7598
- editorType: "text"
7646
+ editorType: "text",
7647
+ expectedValueType: "single"
7599
7648
  }
7600
7649
  ];
7601
- var SYSTEM_DATE_OPERATORS = [
7650
+ var DATE_TIME_OPERATORS = [
7602
7651
  {
7603
7652
  label: "is",
7604
7653
  value: "sys-date-eq",
7605
- editorType: "date"
7654
+ editorType: "date",
7655
+ expectedValueType: "single"
7606
7656
  },
7607
7657
  {
7608
7658
  label: "is between...",
7609
7659
  value: "sys-date-between",
7610
- editorType: "dateRange"
7660
+ editorType: "dateRange",
7661
+ expectedValueType: "between"
7611
7662
  },
7612
7663
  {
7613
7664
  label: "is before...",
7614
7665
  value: "sys-date-lt",
7615
- editorType: "date"
7666
+ editorType: "date",
7667
+ expectedValueType: "single"
7616
7668
  },
7617
7669
  {
7618
7670
  label: "is after...",
7619
7671
  value: "sys-date-gt",
7620
- editorType: "date"
7672
+ editorType: "date",
7673
+ expectedValueType: "single"
7621
7674
  },
7622
7675
  {
7623
7676
  label: "is on or before...",
7624
7677
  value: "sys-date-lte",
7625
- editorType: "date"
7678
+ editorType: "date",
7679
+ expectedValueType: "single"
7626
7680
  },
7627
7681
  {
7628
7682
  label: "is on or after...",
7629
7683
  value: "sys-date-gte",
7630
- editorType: "date"
7684
+ editorType: "date",
7685
+ expectedValueType: "single"
7686
+ },
7687
+ {
7688
+ label: "is empty",
7689
+ value: "ndef",
7690
+ editorType: "empty",
7691
+ expectedValueType: "false"
7692
+ },
7693
+ {
7694
+ label: "is not empty",
7695
+ value: "def",
7696
+ editorType: "empty",
7697
+ expectedValueType: "true"
7631
7698
  }
7632
7699
  ];
7633
7700
  var RICHTEXT_OPERATORS = [
7634
7701
  {
7635
7702
  label: "contains...",
7636
7703
  value: "match",
7637
- editorType: "text"
7704
+ editorType: "text",
7705
+ expectedValueType: "single"
7638
7706
  },
7639
7707
  {
7640
7708
  label: "is empty",
7641
7709
  value: "ndef",
7642
- editorType: "empty"
7710
+ editorType: "empty",
7711
+ expectedValueType: "false"
7643
7712
  },
7644
7713
  {
7645
7714
  label: "starts with...",
7646
7715
  value: "starts",
7647
- editorType: "text"
7716
+ editorType: "text",
7717
+ expectedValueType: "single"
7648
7718
  },
7649
7719
  {
7650
7720
  label: "is not empty",
7651
7721
  value: "def",
7652
- editorType: "empty"
7722
+ editorType: "empty",
7723
+ expectedValueType: "true"
7653
7724
  }
7654
7725
  ];
7655
7726
  var CHECKBOX_OPERATORS = [
7656
7727
  {
7657
7728
  label: "is checked",
7658
7729
  value: "def",
7659
- editorType: "empty"
7730
+ editorType: "empty",
7731
+ expectedValueType: "true"
7660
7732
  },
7661
7733
  {
7662
7734
  label: "is not checked",
7663
7735
  value: "ndef",
7664
- editorType: "empty"
7736
+ editorType: "empty",
7737
+ expectedValueType: "false"
7665
7738
  }
7666
7739
  ];
7667
7740
  var SYSTEM_FIELD_OPERATORS = [
7668
7741
  {
7669
7742
  label: "is",
7670
7743
  value: "eq",
7671
- editorType: "singleChoice"
7744
+ editorType: "singleChoice",
7745
+ expectedValueType: "single"
7672
7746
  },
7673
7747
  {
7674
7748
  label: "is any of...",
7675
7749
  value: "in",
7676
- editorType: "multiChoice"
7750
+ editorType: "multiChoice",
7751
+ expectedValueType: "array"
7677
7752
  },
7678
7753
  {
7679
7754
  label: "is not",
7680
7755
  value: "neq",
7681
- editorType: "singleChoice"
7756
+ editorType: "singleChoice",
7757
+ expectedValueType: "single"
7682
7758
  },
7683
7759
  {
7684
7760
  label: "is none of...",
7685
7761
  value: "nin",
7686
- editorType: "multiChoice"
7762
+ editorType: "multiChoice",
7763
+ expectedValueType: "array"
7687
7764
  }
7688
7765
  ];
7689
7766
  var OPTIONAL_SYSTEM_FIELD_OPERATORS = [
7690
7767
  {
7691
7768
  label: "is",
7692
7769
  value: "eq",
7693
- editorType: "singleChoice"
7770
+ editorType: "singleChoice",
7771
+ expectedValueType: "single"
7694
7772
  },
7695
7773
  {
7696
7774
  label: "is any of...",
7697
7775
  value: "in",
7698
- editorType: "multiChoice"
7776
+ editorType: "multiChoice",
7777
+ expectedValueType: "array"
7699
7778
  },
7700
7779
  {
7701
7780
  label: "is empty",
7702
7781
  value: "ndef",
7703
- editorType: "empty"
7782
+ editorType: "empty",
7783
+ expectedValueType: "false"
7704
7784
  },
7705
7785
  {
7706
7786
  label: "is not",
7707
7787
  value: "neq",
7708
- editorType: "singleChoice"
7788
+ editorType: "singleChoice",
7789
+ expectedValueType: "single"
7709
7790
  },
7710
7791
  {
7711
7792
  label: "is none of...",
7712
7793
  value: "nin",
7713
- editorType: "multiChoice"
7794
+ editorType: "multiChoice",
7795
+ expectedValueType: "array"
7714
7796
  },
7715
7797
  {
7716
7798
  label: "is not empty",
7717
7799
  value: "def",
7718
- editorType: "empty"
7800
+ editorType: "empty",
7801
+ expectedValueType: "true"
7719
7802
  }
7720
7803
  ];
7721
7804
  var PUBLISH_STATUS_FIELD_OPERATORS = [
7722
7805
  {
7723
7806
  label: "is",
7724
7807
  value: "eq",
7725
- editorType: "statusSingleChoice"
7808
+ editorType: "statusSingleChoice",
7809
+ expectedValueType: "single"
7726
7810
  },
7727
7811
  {
7728
7812
  label: "is any of...",
7729
7813
  value: "in",
7730
- editorType: "statusMultiChoice"
7814
+ editorType: "statusMultiChoice",
7815
+ expectedValueType: "array"
7731
7816
  },
7732
7817
  {
7733
7818
  label: "is not",
7734
7819
  value: "neq",
7735
- editorType: "statusSingleChoice"
7820
+ editorType: "statusSingleChoice",
7821
+ expectedValueType: "single"
7736
7822
  },
7737
7823
  {
7738
7824
  label: "is none of...",
7739
7825
  value: "nin",
7740
- editorType: "statusMultiChoice"
7826
+ editorType: "statusMultiChoice",
7827
+ expectedValueType: "array"
7741
7828
  }
7742
7829
  ];
7743
7830
  var SELECT_OPERATORS = [
7744
7831
  {
7745
7832
  label: "is",
7746
7833
  value: "eq",
7747
- editorType: "singleChoice"
7834
+ editorType: "singleChoice",
7835
+ expectedValueType: "single"
7748
7836
  },
7749
7837
  {
7750
7838
  label: "is any of...",
7751
7839
  value: "in",
7752
- editorType: "multiChoice"
7840
+ editorType: "multiChoice",
7841
+ expectedValueType: "array"
7753
7842
  },
7754
7843
  {
7755
7844
  label: "is empty",
7756
7845
  value: "ndef",
7757
- editorType: "empty"
7846
+ editorType: "empty",
7847
+ expectedValueType: "false"
7758
7848
  },
7759
7849
  {
7760
7850
  label: "contains...",
7761
7851
  value: "match",
7762
- editorType: "text"
7852
+ editorType: "text",
7853
+ expectedValueType: "single"
7763
7854
  },
7764
7855
  {
7765
7856
  label: "starts with...",
7766
7857
  value: "starts",
7767
- editorType: "text"
7858
+ editorType: "text",
7859
+ expectedValueType: "single"
7768
7860
  },
7769
7861
  {
7770
7862
  label: "is not",
7771
7863
  value: "neq",
7772
- editorType: "singleChoice"
7864
+ editorType: "singleChoice",
7865
+ expectedValueType: "single"
7773
7866
  },
7774
7867
  {
7775
7868
  label: "is none of...",
7776
7869
  value: "nin",
7777
- editorType: "multiChoice"
7870
+ editorType: "multiChoice",
7871
+ expectedValueType: "array"
7778
7872
  },
7779
7873
  {
7780
7874
  label: "is not empty",
7781
7875
  value: "def",
7782
- editorType: "empty"
7876
+ editorType: "empty",
7877
+ expectedValueType: "true"
7783
7878
  }
7784
7879
  ];
7785
7880
  var MULTI_SELECT_OPERATORS = [
7786
7881
  {
7787
7882
  label: "is",
7788
7883
  value: "eq",
7789
- editorType: "singleChoice"
7884
+ editorType: "singleChoice",
7885
+ expectedValueType: "single"
7790
7886
  },
7791
7887
  {
7792
7888
  label: "is any of...",
7793
7889
  value: "in",
7794
- editorType: "multiChoice"
7890
+ editorType: "multiChoice",
7891
+ expectedValueType: "array"
7795
7892
  },
7796
7893
  {
7797
7894
  label: "is empty",
7798
7895
  value: "ndef",
7799
- editorType: "empty"
7896
+ editorType: "empty",
7897
+ expectedValueType: "false"
7800
7898
  },
7801
7899
  {
7802
7900
  label: "is not",
7803
7901
  value: "neq",
7804
- editorType: "singleChoice"
7902
+ editorType: "singleChoice",
7903
+ expectedValueType: "single"
7805
7904
  },
7806
7905
  {
7807
7906
  label: "is none of...",
7808
7907
  value: "nin",
7809
- editorType: "multiChoice"
7908
+ editorType: "multiChoice",
7909
+ expectedValueType: "array"
7810
7910
  },
7811
7911
  {
7812
7912
  label: "is not empty",
7813
7913
  value: "def",
7814
- editorType: "empty"
7914
+ editorType: "empty",
7915
+ expectedValueType: "true"
7815
7916
  }
7816
7917
  ];
7817
7918
 
@@ -8443,7 +8544,7 @@ var ConditionalInputRow = import_react86.css`
8443
8544
  ${(0, import_design_system53.cq)("764px")} {
8444
8545
  align-items: flex-start;
8445
8546
  display: grid;
8446
- grid-template-columns: 200px 160px 1fr 32px;
8547
+ grid-template-columns: 250px 160px 1fr 32px;
8447
8548
 
8448
8549
  & > div:nth-child(n) {
8449
8550
  width: auto;
@@ -8492,7 +8593,8 @@ var FilterButton = import_react86.css`
8492
8593
  gap: var(--spacing-sm);
8493
8594
  padding: var(--spacing-sm) var(--spacing-base);
8494
8595
  max-height: 40px;
8495
- transition: color var(--duration-fast) var(--timing-ease-out),
8596
+ transition:
8597
+ color var(--duration-fast) var(--timing-ease-out),
8496
8598
  background-color var(--duration-fast) var(--timing-ease-out),
8497
8599
  border-color var(--duration-fast) var(--timing-ease-out),
8498
8600
  box-shadow var(--duration-fast) var(--timing-ease-out);
@@ -8587,6 +8689,9 @@ var ResetConditionsBtn = import_react86.css`
8587
8689
  &:focus {
8588
8690
  color: var(--action-destructive-hover);
8589
8691
  }
8692
+ &:disabled {
8693
+ color: var(--gray-400);
8694
+ }
8590
8695
  `;
8591
8696
  var IconBtn = import_react86.css`
8592
8697
  align-self: center;
@@ -8650,6 +8755,7 @@ var FilterButton2 = ({
8650
8755
 
8651
8756
  // src/components/SearchAndFilter/FilterControls.tsx
8652
8757
  var import_CgClose5 = require("@react-icons/all-files/cg/CgClose");
8758
+ var import_canvas11 = require("@uniformdev/canvas");
8653
8759
  var import_design_system56 = require("@uniformdev/design-system");
8654
8760
  var import_lexical11 = require("lexical");
8655
8761
  var import_react88 = require("react");
@@ -8683,7 +8789,7 @@ var filterMapper = {
8683
8789
  statusSingleChoice: StatusSingleEditor,
8684
8790
  empty: null
8685
8791
  };
8686
- function withInputVariables(WrappedComponent) {
8792
+ function withInputVariables(WrappedComponent, noSwapping = false) {
8687
8793
  const WithInputVariables = (props) => {
8688
8794
  if (Array.isArray(props.value) || !props.bindable || props.disabled || props.readOnly) {
8689
8795
  return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(WrappedComponent, { ...props });
@@ -8696,7 +8802,7 @@ function withInputVariables(WrappedComponent) {
8696
8802
  onChange: (newValue) => props.onChange(newValue != null ? newValue : ""),
8697
8803
  value: props.value,
8698
8804
  disabled: props.disabled,
8699
- inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(WrappedComponent, { ...props })
8805
+ inputWhenNoVariables: noSwapping ? void 0 : /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(WrappedComponent, { ...props })
8700
8806
  }
8701
8807
  );
8702
8808
  };
@@ -8726,7 +8832,7 @@ var bindableFiltersMapper = {
8726
8832
  multiChoice: withInputVariablesForMultiValue(FilterMultiChoiceEditor),
8727
8833
  singleChoice: withInputVariables(FilterSingleChoiceEditor),
8728
8834
  date: withInputVariables(DateEditor),
8729
- text: withInputVariables(TextEditor),
8835
+ text: withInputVariables(TextEditor, true),
8730
8836
  number: withInputVariables(NumberEditor)
8731
8837
  };
8732
8838
 
@@ -8758,6 +8864,7 @@ var SearchAndFilterProvider = ({
8758
8864
  filters,
8759
8865
  filterOptions,
8760
8866
  filterVisible = false,
8867
+ alwaysVisible = false,
8761
8868
  defaultSearchTerm = "",
8762
8869
  onSearchChange,
8763
8870
  onChange,
@@ -8769,7 +8876,7 @@ var SearchAndFilterProvider = ({
8769
8876
  }) => {
8770
8877
  const [searchTerm, setSearchTerm] = (0, import_react87.useState)(defaultSearchTerm);
8771
8878
  const deferredSearchTerm = (0, import_react87.useDeferredValue)(searchTerm);
8772
- const [filterVisibility, setFilterVisibility] = (0, import_react87.useState)(filterVisible);
8879
+ const [filterVisibility, setFilterVisibility] = (0, import_react87.useState)(alwaysVisible || filterVisible);
8773
8880
  const handleSearchTerm = (0, import_react87.useCallback)(
8774
8881
  (term) => {
8775
8882
  setSearchTerm(term);
@@ -8778,8 +8885,13 @@ var SearchAndFilterProvider = ({
8778
8885
  [setSearchTerm, onSearchChange]
8779
8886
  );
8780
8887
  const handleToggleFilterVisibility = (0, import_react87.useCallback)(
8781
- (visible) => setFilterVisibility(visible),
8782
- [setFilterVisibility]
8888
+ (visible) => {
8889
+ if (alwaysVisible) {
8890
+ return;
8891
+ }
8892
+ setFilterVisibility(visible);
8893
+ },
8894
+ [alwaysVisible]
8783
8895
  );
8784
8896
  const handleAddFilter = (0, import_react87.useCallback)(() => {
8785
8897
  onChange([...filters, { field: "", operator: "", value: "" }]);
@@ -8805,7 +8917,7 @@ var SearchAndFilterProvider = ({
8805
8917
  if (filterVisibility) {
8806
8918
  const handleEscKeyFilterClose = (e) => {
8807
8919
  if (e.key === "Escape") {
8808
- setFilterVisibility(false);
8920
+ handleToggleFilterVisibility(false);
8809
8921
  }
8810
8922
  };
8811
8923
  document.addEventListener("keydown", (e) => handleEscKeyFilterClose(e));
@@ -8813,7 +8925,7 @@ var SearchAndFilterProvider = ({
8813
8925
  document.removeEventListener("keydown", (e) => handleEscKeyFilterClose(e));
8814
8926
  };
8815
8927
  }
8816
- }, [filterVisibility]);
8928
+ }, [filterVisibility, handleToggleFilterVisibility]);
8817
8929
  return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
8818
8930
  SearchAndFilterContext.Provider,
8819
8931
  {
@@ -8857,7 +8969,7 @@ var FilterControls = ({
8857
8969
  allowBindingSearchTerm
8858
8970
  } = useSearchAndFilter();
8859
8971
  const editorRef = (0, import_react88.useRef)(null);
8860
- const hasVariableInSearchTerm = hasReferencedVariables(searchTerm);
8972
+ const variableRefernceCountInSearchTerm = (0, import_canvas11.hasReferencedVariables)(searchTerm);
8861
8973
  const [idToResetInputVariables, setIdToResetInputVariables] = (0, import_react88.useState)("data-resource-search-term-input");
8862
8974
  const [localeSearchTerm, setLocaleSearchTerm] = (0, import_react88.useState)(searchTerm);
8863
8975
  (0, import_react_use10.useDebounce)(
@@ -8911,7 +9023,7 @@ var FilterControls = ({
8911
9023
  )
8912
9024
  }
8913
9025
  ),
8914
- hasVariableInSearchTerm ? /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { css: ClearSearchButtonContainer, children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
9026
+ variableRefernceCountInSearchTerm ? /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { css: ClearSearchButtonContainer, children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
8915
9027
  "button",
8916
9028
  {
8917
9029
  css: ClearSearchButtonStyles,
@@ -8934,89 +9046,27 @@ var FilterControls = ({
8934
9046
  };
8935
9047
 
8936
9048
  // src/components/SearchAndFilter/FilterItem.tsx
8937
- var import_design_system58 = require("@uniformdev/design-system");
8938
- var import_react90 = require("react");
8939
-
8940
- // src/components/SearchAndFilter/FilterMenu.tsx
8941
9049
  var import_design_system57 = require("@uniformdev/design-system");
8942
- var import_react89 = __toESM(require("react"));
8943
- var import_jsx_runtime85 = require("@emotion/react/jsx-runtime");
8944
- var SearchAndFilterOptionsContainer2 = ({
8945
- buttonRow,
8946
- additionalFiltersContainer,
8947
- children
8948
- }) => {
8949
- return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { css: SearchAndFilterOptionsContainer, children: [
8950
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { css: SearchAndFilterOptionsInnerContainer, children }),
8951
- buttonRow ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
8952
- import_design_system57.HorizontalRhythm,
8953
- {
8954
- css: SearchAndFilterButtonGroup,
8955
- gap: "sm",
8956
- align: "center",
8957
- justify: "space-between",
8958
- children: buttonRow
8959
- }
8960
- ) : null,
8961
- additionalFiltersContainer ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { children: additionalFiltersContainer }) : null
8962
- ] });
8963
- };
8964
- var FilterMenu = ({
8965
- id,
8966
- filterTitle = "Show results",
8967
- menuControls,
8968
- additionalFiltersContainer,
8969
- children,
8970
- dataTestId,
8971
- resetButtonText = "reset"
8972
- }) => {
8973
- const { filterVisibility, setFilterVisibility, handleResetFilters, filters } = useSearchAndFilter();
8974
- const innerMenuRef = import_react89.default.useRef(null);
8975
- (0, import_react89.useEffect)(() => {
8976
- var _a;
8977
- if (filterVisibility) {
8978
- (_a = innerMenuRef.current) == null ? void 0 : _a.focus();
8979
- }
8980
- }, [filterVisibility]);
8981
- return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_design_system57.VerticalRhythm, { gap: "sm", "aria-haspopup": "true", id, "data-testid": dataTestId, children: filterVisibility ? /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
8982
- SearchAndFilterOptionsContainer2,
8983
- {
8984
- buttonRow: menuControls,
8985
- additionalFiltersContainer,
8986
- children: [
8987
- /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_design_system57.HorizontalRhythm, { gap: "sm", align: "center", justify: "space-between", children: [
8988
- filterTitle ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { css: Title, ref: innerMenuRef, tabIndex: 0, children: filterTitle }) : null,
8989
- (filters == null ? void 0 : filters.length) && resetButtonText ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
8990
- "button",
8991
- {
8992
- type: "button",
8993
- css: ResetConditionsBtn,
8994
- onClick: () => {
8995
- handleResetFilters();
8996
- setFilterVisibility(false);
8997
- },
8998
- "data-testid": "reset-filters",
8999
- children: resetButtonText
9000
- }
9001
- ) : null
9002
- ] }),
9003
- children
9004
- ]
9005
- }
9006
- ) : null });
9007
- };
9050
+ var import_react89 = require("react");
9051
+
9052
+ // src/components/SearchAndFilter/util/isFilterBindable.ts
9053
+ function isFilterBindable(filter, operator) {
9054
+ var _a, _b;
9055
+ return (_b = (_a = operator == null ? void 0 : operator.bindable) != null ? _a : filter == null ? void 0 : filter.bindable) != null ? _b : false;
9056
+ }
9008
9057
 
9009
9058
  // src/components/SearchAndFilter/FilterItem.tsx
9010
- var import_jsx_runtime86 = require("@emotion/react/jsx-runtime");
9059
+ var import_jsx_runtime85 = require("@emotion/react/jsx-runtime");
9011
9060
  var FilterItem = ({
9012
9061
  index,
9013
- paramOptions,
9014
9062
  operatorOptions,
9015
9063
  valueOptions,
9016
- onParamChange,
9064
+ onFilterOptionChange,
9065
+ onFilterDynamicChange,
9017
9066
  onOperatorChange,
9018
9067
  onValueChange,
9019
- initialCriteriaTitle = "Where"
9068
+ initialCriteriaTitle = "Where",
9069
+ criteriaGroupOperator = "and"
9020
9070
  }) => {
9021
9071
  var _a, _b;
9022
9072
  const { filters, handleDeleteFilter, filterOptions } = useSearchAndFilter();
@@ -9024,25 +9074,26 @@ var FilterItem = ({
9024
9074
  const operatorLabel = filters[index].operator !== "" ? `operator ${filters[index].operator}` : "unknown operator";
9025
9075
  const metaDataLabel = filters[index].value !== "" ? `value ${filters[index].value}` : "unknown value";
9026
9076
  const metaDataPossibleOptions = (_b = (_a = operatorOptions.find((op) => filters[index].operator === op.value)) == null ? void 0 : _a.editorType) != null ? _b : "singleChoice";
9027
- const { selectedFieldValue, selectedOperatorValue, selectedMetaValue, readOnly, bindable } = (0, import_react90.useMemo)(() => {
9077
+ const { selectedFieldValue, selectedOperatorValue, selectedMetaValue, readOnly, bindable } = (0, import_react89.useMemo)(() => {
9028
9078
  var _a2;
9029
- const currentSelectedFilter = filterOptions.find((item) => {
9079
+ const currentSelectedFilterGroup = filterOptions.find((item) => {
9030
9080
  var _a3;
9031
9081
  return (_a3 = item.options) == null ? void 0 : _a3.find((op) => op.value === filters[index].field);
9032
9082
  });
9033
- const selectedFieldValue2 = (_a2 = currentSelectedFilter == null ? void 0 : currentSelectedFilter.options) == null ? void 0 : _a2.find((item) => {
9083
+ const selectedFilterOption = (_a2 = currentSelectedFilterGroup == null ? void 0 : currentSelectedFilterGroup.options) == null ? void 0 : _a2.find((item) => {
9034
9084
  return filters[index].field === item.value;
9035
9085
  });
9036
- const isCurrentFieldReadOnly = selectedFieldValue2 == null ? void 0 : selectedFieldValue2.readOnly;
9086
+ const isCurrentFieldReadOnly = selectedFilterOption == null ? void 0 : selectedFilterOption.readOnly;
9037
9087
  const selectedOperatorValue2 = operatorOptions == null ? void 0 : operatorOptions.find((item) => {
9038
9088
  return filters[index].operator === item.value;
9039
9089
  });
9090
+ const bindable2 = isFilterBindable(selectedFilterOption, selectedOperatorValue2);
9040
9091
  return {
9041
- selectedFieldValue: selectedFieldValue2,
9092
+ selectedFieldValue: selectedFilterOption,
9042
9093
  selectedOperatorValue: selectedOperatorValue2 != null ? selectedOperatorValue2 : void 0,
9043
9094
  selectedMetaValue: filters[index].value,
9044
9095
  readOnly: isCurrentFieldReadOnly,
9045
- bindable: selectedFieldValue2 == null ? void 0 : selectedFieldValue2.bindable
9096
+ bindable: bindable2
9046
9097
  };
9047
9098
  }, [filters, filterOptions, index, operatorOptions]);
9048
9099
  const readOnlyProps = readOnly ? {
@@ -9051,17 +9102,28 @@ var FilterItem = ({
9051
9102
  menuIsOpen: false,
9052
9103
  isClearable: false
9053
9104
  } : {};
9054
- return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { css: ConditionalFilterRow, "data-testid": "filter-item", children: [
9055
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("span", { children: index === 0 ? initialCriteriaTitle : "and" }),
9056
- /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { css: ConditionalInputRow, children: [
9057
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
9058
- import_design_system58.InputComboBox,
9105
+ const CustomLeftHandComponent = selectedFieldValue == null ? void 0 : selectedFieldValue.leftHandSideComponentWhenSelected;
9106
+ return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { css: ConditionalFilterRow, "data-testid": "filter-item", children: [
9107
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { children: index === 0 ? initialCriteriaTitle : criteriaGroupOperator }),
9108
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { css: ConditionalInputRow, children: [
9109
+ CustomLeftHandComponent ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
9110
+ CustomLeftHandComponent,
9111
+ {
9112
+ filterOption: selectedFieldValue,
9113
+ filter: filters[index],
9114
+ setFilterDynamicValue: onFilterDynamicChange,
9115
+ deselectFilterOption: () => {
9116
+ onFilterOptionChange("");
9117
+ }
9118
+ }
9119
+ ) : /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
9120
+ import_design_system57.InputComboBox,
9059
9121
  {
9060
9122
  "aria-label": label,
9061
- options: paramOptions,
9123
+ options: filterOptions,
9062
9124
  onChange: (e) => {
9063
9125
  var _a2;
9064
- onParamChange((_a2 = e == null ? void 0 : e.value) != null ? _a2 : "");
9126
+ onFilterOptionChange((_a2 = e == null ? void 0 : e.value) != null ? _a2 : "");
9065
9127
  },
9066
9128
  isOptionDisabled: (option) => {
9067
9129
  var _a2;
@@ -9081,8 +9143,8 @@ var FilterItem = ({
9081
9143
  name: `filter-field-${index}`
9082
9144
  }
9083
9145
  ),
9084
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
9085
- import_design_system58.InputComboBox,
9146
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
9147
+ import_design_system57.InputComboBox,
9086
9148
  {
9087
9149
  "aria-label": operatorLabel,
9088
9150
  options: operatorOptions,
@@ -9105,7 +9167,7 @@ var FilterItem = ({
9105
9167
  name: `filter-operator-${index}`
9106
9168
  }
9107
9169
  ),
9108
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
9170
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
9109
9171
  FilterEditorRenderer,
9110
9172
  {
9111
9173
  "aria-label": metaDataLabel,
@@ -9119,7 +9181,7 @@ var FilterItem = ({
9119
9181
  valueTestId: "filter-value"
9120
9182
  }
9121
9183
  ),
9122
- readOnly ? null : /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
9184
+ readOnly ? null : /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
9123
9185
  "button",
9124
9186
  {
9125
9187
  type: "button",
@@ -9128,35 +9190,184 @@ var FilterItem = ({
9128
9190
  css: IconBtn,
9129
9191
  "data-testid": "delete-filter",
9130
9192
  disabled: filters.length === 1,
9131
- children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_design_system58.Icon, { icon: "trash", iconColor: filters.length === 1 ? "gray" : "red", size: "1rem" })
9193
+ children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_design_system57.Icon, { icon: "trash", iconColor: filters.length === 1 ? "gray" : "red", size: "1rem" })
9132
9194
  }
9133
9195
  )
9134
9196
  ] })
9135
9197
  ] });
9136
9198
  };
9137
- var singleValuedOperators = /* @__PURE__ */ new Set([
9138
- "eq",
9139
- "neq",
9140
- "lt",
9141
- "gt",
9142
- "is",
9143
- "!is",
9144
- "has",
9145
- "!has",
9146
- "startswith",
9147
- "!startswith",
9148
- "endswith",
9149
- "!endswith"
9150
- ]);
9151
- var arrayValuedOperators = /* @__PURE__ */ new Set(["in", "nin", "is$", "!is$"]);
9152
- var clearValueOnChangeAwayFromOperators = /* @__PURE__ */ new Set(["def", "ndef", "empty", "!empty", "between"]);
9153
- var noValueOperators = /* @__PURE__ */ new Set(["empty", "!empty"]);
9199
+
9200
+ // src/components/SearchAndFilter/FilterItems.tsx
9201
+ var import_design_system59 = require("@uniformdev/design-system");
9202
+
9203
+ // src/components/SearchAndFilter/FilterMenu.tsx
9204
+ var import_design_system58 = require("@uniformdev/design-system");
9205
+ var import_react90 = __toESM(require("react"));
9206
+ var import_jsx_runtime86 = require("@emotion/react/jsx-runtime");
9207
+ var SearchAndFilterOptionsContainer2 = ({
9208
+ buttonRow,
9209
+ additionalFiltersContainer,
9210
+ children
9211
+ }) => {
9212
+ return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { css: SearchAndFilterOptionsContainer, children: [
9213
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { css: SearchAndFilterOptionsInnerContainer, children }),
9214
+ buttonRow ? /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
9215
+ import_design_system58.HorizontalRhythm,
9216
+ {
9217
+ css: SearchAndFilterButtonGroup,
9218
+ gap: "sm",
9219
+ align: "center",
9220
+ justify: "space-between",
9221
+ children: buttonRow
9222
+ }
9223
+ ) : null,
9224
+ additionalFiltersContainer ? /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { children: additionalFiltersContainer }) : null
9225
+ ] });
9226
+ };
9227
+ var FilterMenu = ({
9228
+ id,
9229
+ filterTitle = "Show results",
9230
+ menuControls,
9231
+ additionalFiltersContainer,
9232
+ children,
9233
+ dataTestId,
9234
+ resetButtonText = "reset"
9235
+ }) => {
9236
+ const { filterVisibility, setFilterVisibility, handleResetFilters, filters } = useSearchAndFilter();
9237
+ const innerMenuRef = import_react90.default.useRef(null);
9238
+ (0, import_react90.useEffect)(() => {
9239
+ var _a;
9240
+ if (filterVisibility) {
9241
+ (_a = innerMenuRef.current) == null ? void 0 : _a.focus();
9242
+ }
9243
+ }, [filterVisibility]);
9244
+ return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_design_system58.VerticalRhythm, { gap: "sm", "aria-haspopup": "true", id, "data-testid": dataTestId, children: filterVisibility ? /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(
9245
+ SearchAndFilterOptionsContainer2,
9246
+ {
9247
+ buttonRow: menuControls,
9248
+ additionalFiltersContainer,
9249
+ children: [
9250
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(import_design_system58.HorizontalRhythm, { gap: "sm", align: "center", justify: "space-between", children: [
9251
+ filterTitle ? /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("span", { css: Title, ref: innerMenuRef, tabIndex: 0, children: filterTitle }) : null,
9252
+ (filters == null ? void 0 : filters.length) && resetButtonText ? /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
9253
+ "button",
9254
+ {
9255
+ type: "button",
9256
+ css: ResetConditionsBtn,
9257
+ disabled: filters.every((f) => !f.field),
9258
+ onClick: () => {
9259
+ handleResetFilters();
9260
+ setFilterVisibility(false);
9261
+ },
9262
+ "data-testid": "reset-filters",
9263
+ children: resetButtonText
9264
+ }
9265
+ ) : null
9266
+ ] }),
9267
+ children
9268
+ ]
9269
+ }
9270
+ ) : null });
9271
+ };
9272
+
9273
+ // src/components/SearchAndFilter/util/getNewFilterValueAfterOperatorChange.ts
9274
+ var import_canvas12 = require("@uniformdev/canvas");
9275
+ function getNewFilterValueAfterOperatorChange({
9276
+ newOperatorId,
9277
+ currentFilter,
9278
+ filterOptions
9279
+ }) {
9280
+ var _a, _b, _c;
9281
+ if (Array.isArray(newOperatorId)) {
9282
+ throw new Error("Operator value must be a single string");
9283
+ }
9284
+ const result = {
9285
+ ...currentFilter,
9286
+ operator: newOperatorId,
9287
+ value: ""
9288
+ };
9289
+ const currentOperatorId = currentFilter.operator;
9290
+ let currentValue = currentFilter.value;
9291
+ const currentFieldDefinition = filterOptions.flatMap((group) => {
9292
+ var _a2;
9293
+ return (_a2 = group.options) != null ? _a2 : [];
9294
+ }).find((filter) => filter.value === currentFilter.field);
9295
+ const currentOperator = (_a = currentFieldDefinition == null ? void 0 : currentFieldDefinition.operatorOptions) == null ? void 0 : _a.find(
9296
+ (op) => op.value === currentOperatorId
9297
+ );
9298
+ const newOperator = (_b = currentFieldDefinition == null ? void 0 : currentFieldDefinition.operatorOptions) == null ? void 0 : _b.find((op) => op.value === newOperatorId);
9299
+ if (!currentOperator || !newOperator) {
9300
+ result.value = "";
9301
+ return result;
9302
+ } else {
9303
+ const currentOperatorValueType = currentOperator.expectedValueType;
9304
+ const newOperatorValueType = newOperator.expectedValueType;
9305
+ if (!isFilterBindable(currentFieldDefinition, newOperator) && hasBindings(currentValue)) {
9306
+ currentValue = "";
9307
+ }
9308
+ if (isHardcodedOperatorValue(currentOperatorValueType)) {
9309
+ result.value = isHardcodedOperatorValue(newOperatorValueType) ? newOperatorValueType : "";
9310
+ return result;
9311
+ }
9312
+ switch (newOperatorValueType) {
9313
+ case "single":
9314
+ if (Array.isArray(currentValue)) {
9315
+ if (currentOperatorValueType === "between") {
9316
+ result.value = "";
9317
+ } else {
9318
+ result.value = (_c = currentValue[0]) != null ? _c : "";
9319
+ }
9320
+ } else {
9321
+ result.value = currentValue;
9322
+ }
9323
+ return result;
9324
+ case "array":
9325
+ if (currentOperatorValueType === "between") {
9326
+ result.value = "";
9327
+ } else if (Array.isArray(currentValue)) {
9328
+ result.value = currentValue;
9329
+ } else {
9330
+ result.value = currentValue ? [currentValue] : [];
9331
+ }
9332
+ return result;
9333
+ case "between":
9334
+ if (Array.isArray(currentValue)) {
9335
+ result.value = "";
9336
+ } else {
9337
+ result.value = [currentValue, ""];
9338
+ }
9339
+ return result;
9340
+ case "none":
9341
+ result.value = "";
9342
+ return result;
9343
+ default:
9344
+ result.value = newOperatorValueType;
9345
+ return result;
9346
+ }
9347
+ }
9348
+ }
9349
+ function isHardcodedOperatorValue(valueType) {
9350
+ return valueType !== void 0 && valueType !== "array" && valueType !== "between" && valueType !== "none" && valueType !== "single";
9351
+ }
9352
+ function hasBindings(currentValue) {
9353
+ if (currentValue === void 0) {
9354
+ return false;
9355
+ }
9356
+ if (Array.isArray(currentValue)) {
9357
+ return currentValue.some((value) => (0, import_canvas12.hasReferencedVariables)(value));
9358
+ }
9359
+ return (0, import_canvas12.hasReferencedVariables)(currentValue) > 0;
9360
+ }
9361
+
9362
+ // src/components/SearchAndFilter/FilterItems.tsx
9363
+ var import_jsx_runtime87 = require("@emotion/react/jsx-runtime");
9154
9364
  var FilterItems = ({
9155
9365
  addButtonText = "add condition",
9156
9366
  additionalFiltersContainer,
9157
9367
  filterTitle,
9158
9368
  resetButtonText,
9159
- initialCriteriaTitle
9369
+ initialCriteriaTitle,
9370
+ criteriaGroupOperator
9160
9371
  }) => {
9161
9372
  const { filterOptions, filters, setFilters, handleAddFilter } = useSearchAndFilter();
9162
9373
  const handleUpdateFilter = (index, prop, value) => {
@@ -9164,32 +9375,16 @@ var FilterItems = ({
9164
9375
  const next = [...filters];
9165
9376
  next[index] = { ...next[index], [prop]: value };
9166
9377
  if (prop === "operator") {
9167
- const newOperator = value;
9168
- const currentValue = next[index].value;
9169
- if (Array.isArray(newOperator)) {
9170
- throw new Error("Operator value must be a single string");
9171
- }
9172
- if (singleValuedOperators.has(newOperator) && Array.isArray(currentValue)) {
9173
- next[index].value = next[index].value[0];
9174
- }
9175
- if (arrayValuedOperators.has(newOperator) && Array.isArray(currentValue) === false) {
9176
- next[index].value = currentValue ? [currentValue] : [];
9177
- }
9178
- if (clearValueOnChangeAwayFromOperators.has(filters[index].operator)) {
9179
- next[index].value = "";
9180
- }
9181
- if (noValueOperators.has(newOperator)) {
9182
- next[index].value = "";
9183
- }
9184
- if (newOperator === "between" && Array.isArray(currentValue) === false) {
9185
- next[index].value = [currentValue, ""];
9186
- }
9187
- if (value === "def" || value === "true") {
9188
- next[index].value = "true";
9189
- }
9190
- if (value === "ndef" || value === "false") {
9191
- next[index].value = "false";
9378
+ const newOperatorId = value;
9379
+ const currentFilter = next[index];
9380
+ if (!newOperatorId) {
9381
+ throw new Error("you bad");
9192
9382
  }
9383
+ next[index] = getNewFilterValueAfterOperatorChange({
9384
+ newOperatorId,
9385
+ currentFilter,
9386
+ filterOptions
9387
+ });
9193
9388
  }
9194
9389
  if (prop === "field") {
9195
9390
  const firstOperatorInAvailableOperators = (_e = (_d = (_c = (_b = (_a = filterOptions.find((fo) => {
@@ -9198,15 +9393,16 @@ var FilterItems = ({
9198
9393
  })) == null ? void 0 : _a.options) == null ? void 0 : _b.find((op) => op.value === next[index].field)) == null ? void 0 : _c.operatorOptions) == null ? void 0 : _d[0].value) != null ? _e : "eq";
9199
9394
  next[index].operator = firstOperatorInAvailableOperators;
9200
9395
  next[index].value = "";
9396
+ next[index].dynamicField = void 0;
9201
9397
  }
9202
9398
  setFilters(next);
9203
9399
  };
9204
- return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
9400
+ return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
9205
9401
  FilterMenu,
9206
9402
  {
9207
9403
  id: "search-and-filter-options",
9208
9404
  dataTestId: "search-and-filter-options",
9209
- menuControls: /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(
9405
+ menuControls: /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
9210
9406
  "button",
9211
9407
  {
9212
9408
  type: "button",
@@ -9214,7 +9410,7 @@ var FilterItems = ({
9214
9410
  onClick: handleAddFilter,
9215
9411
  "data-testid": "add-filter",
9216
9412
  children: [
9217
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_design_system58.Icon, { icon: "math-plus", iconColor: "currentColor", size: "1rem" }),
9413
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_design_system59.Icon, { icon: "math-plus", iconColor: "currentColor", size: "1rem" }),
9218
9414
  addButtonText
9219
9415
  ]
9220
9416
  }
@@ -9230,17 +9426,18 @@ var FilterItems = ({
9230
9426
  })) == null ? void 0 : _a.options) != null ? _b : [];
9231
9427
  const possibleValueOptions = (_d = (_c = availableTypeOptions == null ? void 0 : availableTypeOptions.find((op) => op.value === item.field)) == null ? void 0 : _c.valueOptions) != null ? _d : [];
9232
9428
  const possibleOperators = (_f = (_e = availableTypeOptions == null ? void 0 : availableTypeOptions.find((op) => op.value === item.field)) == null ? void 0 : _e.operatorOptions) != null ? _f : [];
9233
- return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
9429
+ return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
9234
9430
  FilterItem,
9235
9431
  {
9236
9432
  index: i,
9237
- paramOptions: filterOptions,
9238
- onParamChange: (e) => handleUpdateFilter(i, "field", e),
9433
+ onFilterOptionChange: (e) => handleUpdateFilter(i, "field", e),
9239
9434
  operatorOptions: possibleOperators,
9240
9435
  onOperatorChange: (e) => handleUpdateFilter(i, "operator", e),
9241
9436
  onValueChange: (e) => handleUpdateFilter(i, "value", e),
9437
+ onFilterDynamicChange: (e) => handleUpdateFilter(i, "dynamicField", e),
9242
9438
  valueOptions: possibleValueOptions,
9243
- initialCriteriaTitle
9439
+ initialCriteriaTitle,
9440
+ criteriaGroupOperator
9244
9441
  },
9245
9442
  i
9246
9443
  );
@@ -9250,11 +9447,11 @@ var FilterItems = ({
9250
9447
  };
9251
9448
 
9252
9449
  // src/components/SearchAndFilter/SearchAndFilter.tsx
9253
- var import_design_system60 = require("@uniformdev/design-system");
9450
+ var import_design_system61 = require("@uniformdev/design-system");
9254
9451
 
9255
9452
  // src/components/SearchAndFilter/SearchAndFilterResultContainer.tsx
9256
- var import_design_system59 = require("@uniformdev/design-system");
9257
- var import_jsx_runtime87 = require("@emotion/react/jsx-runtime");
9453
+ var import_design_system60 = require("@uniformdev/design-system");
9454
+ var import_jsx_runtime88 = require("@emotion/react/jsx-runtime");
9258
9455
  var SearchAndFilterResultContainer = ({
9259
9456
  buttonText,
9260
9457
  clearButtonLabel = "clear",
@@ -9284,19 +9481,19 @@ var SearchAndFilterResultContainer = ({
9284
9481
  handleResetFilters();
9285
9482
  }
9286
9483
  };
9287
- return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(import_jsx_runtime87.Fragment, { children: [
9288
- /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(import_design_system59.HorizontalRhythm, { children: [
9289
- /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("span", { children: [
9484
+ return /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(import_jsx_runtime88.Fragment, { children: [
9485
+ /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(import_design_system60.HorizontalRhythm, { children: [
9486
+ /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("span", { children: [
9290
9487
  totalResults,
9291
9488
  " results ",
9292
9489
  searchTerm ? `for "${searchTerm}"` : null
9293
9490
  ] }),
9294
- !searchTerm || hideClearButton ? null : /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_design_system59.Button, { buttonType: "ghostDestructive", size: "zero", onClick: handleClearSearch, children: clearButtonLabel })
9491
+ !searchTerm || hideClearButton ? null : /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_design_system60.Button, { buttonType: "ghostDestructive", size: "zero", onClick: handleClearSearch, children: clearButtonLabel })
9295
9492
  ] }),
9296
- totalResults === 0 ? /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(import_design_system59.Callout, { title: calloutTitle != null ? calloutTitle : automateCalloutTitle(), type: "note", children: [
9297
- calloutText ? /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_design_system59.Paragraph, { children: calloutText }) : null,
9298
- hideClearButton ? null : /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
9299
- import_design_system59.Button,
9493
+ totalResults === 0 ? /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(import_design_system60.Callout, { title: calloutTitle != null ? calloutTitle : automateCalloutTitle(), type: "note", children: [
9494
+ calloutText ? /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_design_system60.Paragraph, { children: calloutText }) : null,
9495
+ hideClearButton ? null : /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
9496
+ import_design_system60.Button,
9300
9497
  {
9301
9498
  buttonType: "tertiaryOutline",
9302
9499
  size: "xs",
@@ -9310,14 +9507,14 @@ var SearchAndFilterResultContainer = ({
9310
9507
  };
9311
9508
 
9312
9509
  // src/components/SearchAndFilter/SearchAndFilter.tsx
9313
- var import_jsx_runtime88 = require("@emotion/react/jsx-runtime");
9510
+ var import_jsx_runtime89 = require("@emotion/react/jsx-runtime");
9314
9511
  var SearchAndFilter = ({
9315
9512
  filters,
9316
9513
  filterOptions,
9317
9514
  filterVisible,
9318
9515
  filterControls,
9319
9516
  viewSwitchControls,
9320
- resultsContainerView = /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(SearchAndFilterResultContainer, {}),
9517
+ resultsContainerView = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(SearchAndFilterResultContainer, {}),
9321
9518
  filterMapper: filterMapper2 = filterMapper,
9322
9519
  additionalFiltersContainer,
9323
9520
  onChange,
@@ -9327,7 +9524,7 @@ var SearchAndFilter = ({
9327
9524
  allowBindingSearchTerm = false,
9328
9525
  resetFilterValues = []
9329
9526
  }) => {
9330
- return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
9527
+ return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
9331
9528
  SearchAndFilterProvider,
9332
9529
  {
9333
9530
  filters,
@@ -9340,18 +9537,18 @@ var SearchAndFilter = ({
9340
9537
  resetFilterValues,
9341
9538
  filterMapper: filterMapper2,
9342
9539
  allowBindingSearchTerm,
9343
- children: /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(import_design_system60.VerticalRhythm, { "data-testid": "search-and-filter", children: [
9344
- /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { css: SearchAndFilterOutterControlWrapper(viewSwitchControls ? "1fr auto" : "1fr"), children: [
9345
- /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
9540
+ children: /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(import_design_system61.VerticalRhythm, { "data-testid": "search-and-filter", children: [
9541
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { css: SearchAndFilterOutterControlWrapper(viewSwitchControls ? "1fr auto" : "1fr"), children: [
9542
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
9346
9543
  "div",
9347
9544
  {
9348
9545
  css: SearchAndFilterControlsWrapper(viewSwitchControls ? "auto 1fr 0.05fr" : "auto 1fr"),
9349
- children: !filterControls ? /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(FilterControls, { hideSearchInput: !onSearchChange }) : filterControls
9546
+ children: !filterControls ? /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(FilterControls, { hideSearchInput: !onSearchChange }) : filterControls
9350
9547
  }
9351
9548
  ),
9352
9549
  viewSwitchControls
9353
9550
  ] }),
9354
- /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(FilterItems, { additionalFiltersContainer }),
9551
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(FilterItems, { additionalFiltersContainer }),
9355
9552
  resultsContainerView
9356
9553
  ] })
9357
9554
  }
@@ -9359,10 +9556,10 @@ var SearchAndFilter = ({
9359
9556
  };
9360
9557
 
9361
9558
  // src/components/SearchAndFilter/SearchOnlyFilter.tsx
9362
- var import_design_system61 = require("@uniformdev/design-system");
9559
+ var import_design_system62 = require("@uniformdev/design-system");
9363
9560
  var import_react91 = require("react");
9364
9561
  var import_react_use11 = require("react-use");
9365
- var import_jsx_runtime89 = require("@emotion/react/jsx-runtime");
9562
+ var import_jsx_runtime90 = require("@emotion/react/jsx-runtime");
9366
9563
  var SearchOnlyContext = (0, import_react91.createContext)({
9367
9564
  searchTerm: "",
9368
9565
  setSearchTerm: () => {
@@ -9379,15 +9576,15 @@ var SearchOnlyFilter = ({ onSearchChange, maxWidth }) => {
9379
9576
  300,
9380
9577
  [localeSearchTerm]
9381
9578
  );
9382
- return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
9579
+ return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
9383
9580
  SearchOnlyContext.Provider,
9384
9581
  {
9385
9582
  value: {
9386
9583
  searchTerm,
9387
9584
  setSearchTerm: setLocaleSearchTerm
9388
9585
  },
9389
- children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { css: { maxWidth: maxWidth != null ? maxWidth : "712px" }, children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
9390
- import_design_system61.InputKeywordSearch,
9586
+ children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { css: { maxWidth: maxWidth != null ? maxWidth : "712px" }, children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
9587
+ import_design_system62.InputKeywordSearch,
9391
9588
  {
9392
9589
  placeholder: "Search...",
9393
9590
  onSearchTextChanged: (e) => setLocaleSearchTerm(e),
@@ -9401,18 +9598,18 @@ var SearchOnlyFilter = ({ onSearchChange, maxWidth }) => {
9401
9598
  };
9402
9599
 
9403
9600
  // src/components/SearchAndFilter/SortItems.tsx
9404
- var import_design_system63 = require("@uniformdev/design-system");
9601
+ var import_design_system64 = require("@uniformdev/design-system");
9405
9602
 
9406
9603
  // src/components/SearchAndFilter/styles/SortItems.styles.ts
9407
9604
  var import_react92 = require("@emotion/react");
9408
- var import_design_system62 = require("@uniformdev/design-system");
9605
+ var import_design_system63 = require("@uniformdev/design-system");
9409
9606
  var ConditionalFilterRow2 = import_react92.css`
9410
9607
  display: grid;
9411
9608
  grid-template-columns: 35px 1fr;
9412
9609
  gap: var(--spacing-sm);
9413
9610
  margin-left: var(--spacing-base);
9414
9611
 
9415
- ${(0, import_design_system62.cq)("380px")} {
9612
+ ${(0, import_design_system63.cq)("380px")} {
9416
9613
  align-items: center;
9417
9614
 
9418
9615
  &:after {
@@ -9433,14 +9630,14 @@ var ConditionalFilterRow2 = import_react92.css`
9433
9630
  grid-template-columns: 50px 1fr;
9434
9631
  }
9435
9632
 
9436
- ${(0, import_design_system62.cq)("580px")} {
9633
+ ${(0, import_design_system63.cq)("580px")} {
9437
9634
  &:after {
9438
9635
  display: none;
9439
9636
  }
9440
9637
  }
9441
9638
 
9442
9639
  @media (prefers-reduced-motion: no-preference) {
9443
- animation: ${import_design_system62.fadeInLtr} var(--duration-fast) var(--timing-ease-out);
9640
+ animation: ${import_design_system63.fadeInLtr} var(--duration-fast) var(--timing-ease-out);
9444
9641
  }
9445
9642
  `;
9446
9643
  var ConditionalInputRow2 = import_react92.css`
@@ -9448,7 +9645,7 @@ var ConditionalInputRow2 = import_react92.css`
9448
9645
  gap: var(--spacing-sm);
9449
9646
  flex-wrap: wrap;
9450
9647
 
9451
- ${(0, import_design_system62.cq)("380px")} {
9648
+ ${(0, import_design_system63.cq)("380px")} {
9452
9649
  & > div:nth-child(-n + 2) {
9453
9650
  width: calc(50% - var(--spacing-sm));
9454
9651
  }
@@ -9457,7 +9654,7 @@ var ConditionalInputRow2 = import_react92.css`
9457
9654
  width: calc(100% - 48px);
9458
9655
  }
9459
9656
  }
9460
- ${(0, import_design_system62.cq)("580px")} {
9657
+ ${(0, import_design_system63.cq)("580px")} {
9461
9658
  display: grid;
9462
9659
  grid-template-columns: 200px 160px 1fr 32px;
9463
9660
 
@@ -9481,7 +9678,8 @@ var FilterButton3 = import_react92.css`
9481
9678
  gap: var(--spacing-sm);
9482
9679
  padding: var(--spacing-sm) var(--spacing-base);
9483
9680
  max-height: 40px;
9484
- transition: color var(--duration-fast) var(--timing-ease-out),
9681
+ transition:
9682
+ color var(--duration-fast) var(--timing-ease-out),
9485
9683
  background-color var(--duration-fast) var(--timing-ease-out),
9486
9684
  border-color var(--duration-fast) var(--timing-ease-out),
9487
9685
  box-shadow var(--duration-fast) var(--timing-ease-out);
@@ -9615,7 +9813,7 @@ var SortFilterWrapper = (hiddenLocaleInput) => import_react92.css`
9615
9813
  position: relative;
9616
9814
  z-index: 0;
9617
9815
 
9618
- ${(0, import_design_system62.cq)("420px")} {
9816
+ ${(0, import_design_system63.cq)("420px")} {
9619
9817
  display: grid;
9620
9818
  grid-template-columns: ${hiddenLocaleInput ? "1fr" : "1fr minmax(140px, 0.25fr)"};
9621
9819
  }
@@ -9637,7 +9835,7 @@ var InputVariableWrapper = import_react92.css`
9637
9835
  `;
9638
9836
 
9639
9837
  // src/components/SearchAndFilter/SortItems.tsx
9640
- var import_jsx_runtime90 = require("@emotion/react/jsx-runtime");
9838
+ var import_jsx_runtime91 = require("@emotion/react/jsx-runtime");
9641
9839
  var SortItems = ({
9642
9840
  sortByLabel = "Sort by",
9643
9841
  localeLabel = "Show locale",
@@ -9659,11 +9857,11 @@ var SortItems = ({
9659
9857
  return (_a2 = item.options) == null ? void 0 : _a2.find((option) => option.value === sortField);
9660
9858
  })) == null ? void 0 : _a.options) == null ? void 0 : _b.find((nestedOption) => nestedOption.value === sortField);
9661
9859
  const localeLabelValue = sortOptions.length > 1 ? localeLabel : `${localeLabel}s`;
9662
- return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { css: [SortFilterWrapper(hideLocaleOptions)], "data-testid": "sorting-options", children: [
9663
- /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(import_design_system63.VerticalRhythm, { gap: "xs", children: [
9664
- /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { css: Title2, children: sortByLabel }),
9665
- /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { css: SortFilterInputRow, children: [
9666
- /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
9860
+ return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { css: [SortFilterWrapper(hideLocaleOptions)], "data-testid": "sorting-options", children: [
9861
+ /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(import_design_system64.VerticalRhythm, { gap: "xs", children: [
9862
+ /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { css: Title2, children: sortByLabel }),
9863
+ /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { css: SortFilterInputRow, children: [
9864
+ /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
9667
9865
  InputVariables,
9668
9866
  {
9669
9867
  disableInlineMenu: disableSortBinding,
@@ -9671,8 +9869,8 @@ var SortItems = ({
9671
9869
  value: sortField,
9672
9870
  valueToResetTo: "created_at",
9673
9871
  onChange: (e) => onSortChange(`${e}_${sortDirection}`),
9674
- inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
9675
- import_design_system63.InputComboBox,
9872
+ inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
9873
+ import_design_system64.InputComboBox,
9676
9874
  {
9677
9875
  id: "sort-by-field",
9678
9876
  "aria-label": "Sort by",
@@ -9694,7 +9892,7 @@ var SortItems = ({
9694
9892
  )
9695
9893
  }
9696
9894
  ),
9697
- /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
9895
+ /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
9698
9896
  InputVariables,
9699
9897
  {
9700
9898
  disableInlineMenu: disableSortBinding,
@@ -9702,8 +9900,8 @@ var SortItems = ({
9702
9900
  valueToResetTo: "DESC",
9703
9901
  showMenuPosition: disableSortBinding ? void 0 : "inline-right",
9704
9902
  onChange: (e) => onSortChange(`${sortField}_${e}`),
9705
- inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
9706
- import_design_system63.SegmentedControl,
9903
+ inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
9904
+ import_design_system64.SegmentedControl,
9707
9905
  {
9708
9906
  noCheckmark: true,
9709
9907
  name: "sortBy",
@@ -9734,15 +9932,15 @@ var SortItems = ({
9734
9932
  )
9735
9933
  ] })
9736
9934
  ] }),
9737
- hideLocaleOptions ? null : /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_design_system63.VerticalRhythm, { gap: "xs", css: InputVariableWrapper, children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
9935
+ hideLocaleOptions ? null : /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_design_system64.VerticalRhythm, { gap: "xs", css: InputVariableWrapper, children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
9738
9936
  InputVariables,
9739
9937
  {
9740
9938
  label: localeLabelValue,
9741
9939
  value: localeValue,
9742
9940
  showMenuPosition: "inline-right",
9743
9941
  onChange: (e) => onLocaleChange(e != null ? e : ""),
9744
- inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
9745
- import_design_system63.InputSelect,
9942
+ inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
9943
+ import_design_system64.InputSelect,
9746
9944
  {
9747
9945
  name: "localeReturned",
9748
9946
  "aria-label": localeLabelValue,
@@ -9771,7 +9969,7 @@ function createLocationValidator(setValue, validate) {
9771
9969
  }
9772
9970
 
9773
9971
  // src/utils/useContentDataResourceLocaleInfo.ts
9774
- var import_canvas10 = require("@uniformdev/canvas");
9972
+ var import_canvas13 = require("@uniformdev/canvas");
9775
9973
  var import_react93 = require("react");
9776
9974
  function useContentDataResourceLocaleInfo({
9777
9975
  locale,
@@ -9782,18 +9980,18 @@ function useContentDataResourceLocaleInfo({
9782
9980
  const setLocaleRef = (0, import_react93.useRef)(setLocale);
9783
9981
  setLocaleRef.current = setLocale;
9784
9982
  const { flatVariables } = useVariables();
9785
- const effectiveLocale = locale != null ? locale : dynamicInputs[import_canvas10.LOCALE_DYNAMIC_INPUT_NAME] ? (0, import_canvas10.createVariableReference)(import_canvas10.LOCALE_DYNAMIC_INPUT_NAME) : "";
9786
- const boundLocale = (_a = (0, import_canvas10.bindVariables)({ variables: flatVariables, value: effectiveLocale }).result) != null ? _a : effectiveLocale;
9983
+ const effectiveLocale = locale != null ? locale : dynamicInputs[import_canvas13.LOCALE_DYNAMIC_INPUT_NAME] ? (0, import_canvas13.createVariableReference)(import_canvas13.LOCALE_DYNAMIC_INPUT_NAME) : "";
9984
+ const boundLocale = (_a = (0, import_canvas13.bindVariables)({ variables: flatVariables, value: effectiveLocale }).result) != null ? _a : effectiveLocale;
9787
9985
  (0, import_react93.useEffect)(() => {
9788
9986
  if (locale === void 0 && effectiveLocale && setLocaleRef.current) {
9789
- setLocaleRef.current((0, import_canvas10.createVariableReference)(import_canvas10.LOCALE_DYNAMIC_INPUT_NAME));
9987
+ setLocaleRef.current((0, import_canvas13.createVariableReference)(import_canvas13.LOCALE_DYNAMIC_INPUT_NAME));
9790
9988
  }
9791
9989
  }, [locale, effectiveLocale]);
9792
9990
  return { effectiveLocale, boundLocale: boundLocale ? boundLocale : void 0 };
9793
9991
  }
9794
9992
 
9795
9993
  // src/index.ts
9796
- var import_design_system64 = require("@uniformdev/design-system");
9994
+ var import_design_system65 = require("@uniformdev/design-system");
9797
9995
  __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
9798
9996
  // Annotate the CommonJS export names for ESM import in node:
9799
9997
  0 && (module.exports = {
@@ -9805,6 +10003,7 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
9805
10003
  Callout,
9806
10004
  ControlledValuePlugin,
9807
10005
  DATE_OPERATORS,
10006
+ DATE_TIME_OPERATORS,
9808
10007
  DISCONNECT_VARIABLE_COMMAND,
9809
10008
  DamSelectedItem,
9810
10009
  DataRefreshButton,
@@ -9898,7 +10097,6 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
9898
10097
  RequestUrlInput,
9899
10098
  ResolvableLoadingValue,
9900
10099
  SELECT_OPERATORS,
9901
- SYSTEM_DATE_OPERATORS,
9902
10100
  SYSTEM_FIELD_OPERATORS,
9903
10101
  ScrollableList,
9904
10102
  ScrollableListItem,
@@ -9995,6 +10193,7 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
9995
10193
  selectedItemIcon,
9996
10194
  selectedItemInner,
9997
10195
  selectedItemTitle,
10196
+ serializeVariablesEditorSerializedState,
9998
10197
  serializeVariablesEditorState,
9999
10198
  setVariablesEditorValue,
10000
10199
  urlEncodeRequestParameter,