@uniformdev/mesh-sdk-react 19.173.0 → 19.173.2-alpha.210

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.mjs CHANGED
@@ -966,7 +966,8 @@ var searchRowContainer = css6`
966
966
  cursor: pointer;
967
967
  padding: var(--spacing-sm);
968
968
  position: relative;
969
- transition: background-color var(--duration-fast) var(--timing-ease-out),
969
+ transition:
970
+ background-color var(--duration-fast) var(--timing-ease-out),
970
971
  color var(--duration-fast) var(--timing-ease-out);
971
972
  `;
972
973
  var searchRowContainerWithPopover = css6`
@@ -1956,7 +1957,8 @@ var productSearchRowContainer = css12`
1956
1957
  padding: var(--spacing-sm) 0;
1957
1958
  margin-right: var(--spacing-sm);
1958
1959
  position: relative;
1959
- transition: background-color var(--duration-fast) var(--timing-ease-out),
1960
+ transition:
1961
+ background-color var(--duration-fast) var(--timing-ease-out),
1960
1962
  color var(--duration-fast) var(--timing-ease-out);
1961
1963
  `;
1962
1964
  var productSearchRowContent = css12`
@@ -2792,18 +2794,58 @@ import { ParameterShellContext, useParameterShell } from "@uniformdev/design-sys
2792
2794
 
2793
2795
  // src/components/Variables/composer/ControlledValuePlugin.tsx
2794
2796
  import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
2795
- import { dequal } from "dequal/lite";
2796
- import { useEffect as useEffect5, useRef as useRef8 } from "react";
2797
+ import { useEffect as useEffect5 } from "react";
2798
+
2799
+ // src/components/Variables/util/serializeVariablesEditorState.ts
2800
+ import { createVariableReference } from "@uniformdev/canvas";
2801
+ import {
2802
+ LineBreakNode,
2803
+ TextNode
2804
+ } from "lexical";
2805
+
2806
+ // src/components/Variables/util/variableExpression.ts
2807
+ var variablePrefix = "${";
2808
+ var variableSuffix = "}";
2809
+
2810
+ // src/components/Variables/util/serializeVariablesEditorState.ts
2811
+ function serializeVariablesEditorState(editorState) {
2812
+ return serializeVariablesEditorSerializedState(editorState.toJSON().root);
2813
+ }
2814
+ function serializeVariablesEditorSerializedState(serializedEditorState) {
2815
+ const buf = [];
2816
+ serializeRecursive(serializedEditorState, buf);
2817
+ const result = buf.join("");
2818
+ return result.length > 0 ? result : void 0;
2819
+ }
2820
+ function serializeRecursive(node, buffer) {
2821
+ if (node.type === TextNode.getType()) {
2822
+ buffer.push(node.text.replace(variablePrefix, "\\${"));
2823
+ }
2824
+ if (node.type === VariableNode.getType()) {
2825
+ buffer.push(createVariableReference(node.reference));
2826
+ }
2827
+ if (node.type === LineBreakNode.getType()) {
2828
+ buffer.push("\n");
2829
+ }
2830
+ if ("children" in node && node.children) {
2831
+ for (const child of node.children) {
2832
+ serializeRecursive(child, buffer);
2833
+ }
2834
+ }
2835
+ }
2836
+
2837
+ // src/components/Variables/util/setVariablesEditorValue.ts
2838
+ import { emptyRichTextValue } from "@uniformdev/richtext";
2797
2839
 
2798
2840
  // src/components/Variables/util/deserializeVariablesEditorState.ts
2799
2841
  import { parseVariableExpression } from "@uniformdev/canvas";
2800
- import { TextNode } from "lexical";
2842
+ import { TextNode as TextNode2 } from "lexical";
2801
2843
  function deserializeVariablesEditorState(serialized) {
2802
2844
  const result = [];
2803
2845
  parseVariableExpression(serialized != null ? serialized : "", (token, type) => {
2804
2846
  if (type === "text") {
2805
2847
  const node = {
2806
- type: TextNode.getType(),
2848
+ type: TextNode2.getType(),
2807
2849
  text: token,
2808
2850
  mode: "normal",
2809
2851
  version: 1,
@@ -2857,14 +2899,18 @@ function refreshVariableNodeMetadata(editor) {
2857
2899
  }
2858
2900
 
2859
2901
  // src/components/Variables/util/setVariablesEditorValue.ts
2860
- function setVariablesEditorValue(editor, newValue) {
2902
+ function setVariablesEditorValue(editor, newValue, tag) {
2861
2903
  if (typeof newValue === "undefined" || typeof newValue === "string") {
2862
2904
  const parsedState = editor.parseEditorState(deserializeVariablesEditorState(newValue));
2863
- editor.setEditorState(parsedState);
2905
+ editor.setEditorState(parsedState.clone(null), {
2906
+ tag
2907
+ });
2864
2908
  } else {
2865
2909
  try {
2866
2910
  const parsedState = editor.parseEditorState(newValue);
2867
- editor.setEditorState(parsedState);
2911
+ editor.setEditorState(parsedState.clone(null), {
2912
+ tag
2913
+ });
2868
2914
  } catch (e) {
2869
2915
  console.warn(
2870
2916
  "Tried to set invalid Lexical state, probably invalidly formatted state object - falling back to empty state. Invalid state attempted:",
@@ -2872,27 +2918,10 @@ function setVariablesEditorValue(editor, newValue) {
2872
2918
  "Error:",
2873
2919
  e
2874
2920
  );
2875
- const parsedState = editor.parseEditorState({
2876
- root: {
2877
- type: "root",
2878
- version: 1,
2879
- direction: null,
2880
- format: "",
2881
- indent: 0,
2882
- children: [
2883
- {
2884
- type: "paragraph",
2885
- version: 1,
2886
- format: "start",
2887
- indent: 0,
2888
- direction: null,
2889
- children: [],
2890
- textFormat: 0
2891
- }
2892
- ]
2893
- }
2921
+ const parsedState = editor.parseEditorState(emptyRichTextValue);
2922
+ editor.setEditorState(parsedState.clone(null), {
2923
+ tag
2894
2924
  });
2895
- editor.setEditorState(parsedState);
2896
2925
  }
2897
2926
  }
2898
2927
  refreshVariableNodeMetadata(editor);
@@ -2905,17 +2934,18 @@ function ControlledValuePlugin({
2905
2934
  extraDependencies
2906
2935
  }) {
2907
2936
  const [editor] = useLexicalComposerContext();
2908
- const lastValueRef = useRef8(value);
2909
2937
  useEffect5(() => {
2938
+ var _a, _b;
2910
2939
  if (!enabled) {
2911
2940
  return;
2912
2941
  }
2913
- if (dequal(lastValueRef.current, value)) {
2942
+ const currentValue = (_a = serializeVariablesEditorState(editor.getEditorState())) != null ? _a : "";
2943
+ const newValue = (_b = value !== void 0 && typeof value !== "string" ? serializeVariablesEditorSerializedState(value.root) : value) != null ? _b : "";
2944
+ if (currentValue === newValue) {
2914
2945
  return;
2915
2946
  }
2916
2947
  setTimeout(() => {
2917
2948
  if (editor) {
2918
- lastValueRef.current = value;
2919
2949
  setVariablesEditorValue(editor, value);
2920
2950
  }
2921
2951
  });
@@ -3004,7 +3034,7 @@ import { useLexicalComposerContext as useLexicalComposerContext3 } from "@lexica
3004
3034
  import { useLexicalNodeSelection } from "@lexical/react/useLexicalNodeSelection";
3005
3035
  import { $moveCharacter, $shouldOverrideDefaultCharacterSelection } from "@lexical/selection";
3006
3036
  import { mergeRegister as mergeRegister2 } from "@lexical/utils";
3007
- import { createVariableReference as createVariableReference2 } from "@uniformdev/canvas";
3037
+ import { createVariableReference as createVariableReference3 } from "@uniformdev/canvas";
3008
3038
  import { LoadingIndicator as LoadingIndicator2 } from "@uniformdev/design-system";
3009
3039
  import {
3010
3040
  $getNearestNodeFromDOMNode,
@@ -3038,12 +3068,14 @@ import {
3038
3068
  } from "@lexical/react/LexicalTypeaheadMenuPlugin";
3039
3069
  import { mergeRegister } from "@lexical/utils";
3040
3070
  import { AiFillPlusCircle } from "@react-icons/all-files/ai/AiFillPlusCircle";
3041
- import { createVariableReference } from "@uniformdev/canvas";
3071
+ import { createVariableReference as createVariableReference2 } from "@uniformdev/canvas";
3042
3072
  import { HorizontalRhythm as HorizontalRhythm2, MenuGroup, MenuItemInner, MenuItemSeparator } from "@uniformdev/design-system";
3043
- import { dequal as dequal2 } from "dequal/lite";
3073
+ import { dequal } from "dequal/lite";
3044
3074
  import {
3075
+ $createParagraphNode,
3045
3076
  $createTextNode,
3046
3077
  $getNodeByKey,
3078
+ $getRoot,
3047
3079
  $getSelection,
3048
3080
  $insertNodes,
3049
3081
  $isNodeSelection,
@@ -3052,7 +3084,7 @@ import {
3052
3084
  COMMAND_PRIORITY_NORMAL,
3053
3085
  createCommand
3054
3086
  } from "lexical";
3055
- import { useCallback as useCallback2, useEffect as useEffect8, useMemo as useMemo8, useRef as useRef10, useState as useState10 } from "react";
3087
+ import { useCallback as useCallback2, useEffect as useEffect8, useMemo as useMemo8, useRef as useRef9, useState as useState10 } from "react";
3056
3088
  import { createPortal } from "react-dom";
3057
3089
 
3058
3090
  // src/components/Variables/toolbox/SelectVariableMenu.styles.ts
@@ -3138,7 +3170,7 @@ function useVariableEditTransaction({
3138
3170
  // src/components/Variables/VariableEditor.tsx
3139
3171
  import { zodResolver } from "@hookform/resolvers/zod";
3140
3172
  import { Button as Button2, Callout as Callout3, HorizontalRhythm, Input as Input2, useShortcut } from "@uniformdev/design-system";
3141
- import { useLayoutEffect, useRef as useRef9 } from "react";
3173
+ import { useLayoutEffect, useRef as useRef8 } from "react";
3142
3174
  import { useForm } from "react-hook-form";
3143
3175
  import { z } from "zod";
3144
3176
 
@@ -3197,7 +3229,7 @@ function VariableEditor({
3197
3229
  },
3198
3230
  activeWhenEditing: true
3199
3231
  });
3200
- const nameRef = useRef9(null);
3232
+ const nameRef = useRef8(null);
3201
3233
  const { ref, ...nameRegister } = register("name");
3202
3234
  useLayoutEffect(() => {
3203
3235
  if (nameRef.current && !nameRef.current.value) {
@@ -3581,7 +3613,7 @@ function useVariablesMenu({
3581
3613
  var _a;
3582
3614
  const targetVariable = variables[value];
3583
3615
  if (overwriteExistingValue) {
3584
- setVariablesEditorValue(editor, createVariableReference(value));
3616
+ setVariablesEditorValue(editor, createVariableReference2(value));
3585
3617
  return true;
3586
3618
  }
3587
3619
  const variableNode = $createVariableNode(value, {
@@ -3614,7 +3646,7 @@ function VariablesPlugin({
3614
3646
  }) {
3615
3647
  const [editor] = useLexicalComposerContext2();
3616
3648
  const { variables, dispatch, isEditing, canDispatch, readOnly, knownUndefinedValues, isLoading } = useVariables(true);
3617
- const variablesRef = useRef10({ variables, knownUndefinedValues, isLoading });
3649
+ const variablesRef = useRef9({ variables, knownUndefinedValues, isLoading });
3618
3650
  variablesRef.current = { variables, knownUndefinedValues, isLoading };
3619
3651
  const canEditVariable = useCallback2(
3620
3652
  (name, variable) => (
@@ -3759,18 +3791,24 @@ function VariablesPlugin({
3759
3791
  var _a, _b;
3760
3792
  if (!disableVariables) {
3761
3793
  const targetVariable = variablesRef.current.variables[reference];
3762
- if (overwriteExistingValue) {
3763
- setVariablesEditorValue(editor, createVariableReference(reference));
3764
- return true;
3765
- }
3766
3794
  const variableNode = $createVariableNode(reference, {
3767
- displayName: initialDisplayName != null ? initialDisplayName : (targetVariable == null ? void 0 : targetVariable.displayName) || reference,
3795
+ displayName: initialDisplayName != null ? initialDisplayName : (targetVariable == null ? void 0 : targetVariable.displayName) || prettifyBindExpression(reference),
3768
3796
  hasClickEvent: canEditVariable(reference, targetVariable),
3769
3797
  referenceIsValid: true,
3770
3798
  tooltip: (_a = targetVariable == null ? void 0 : targetVariable.tooltip) != null ? _a : targetVariable == null ? void 0 : targetVariable.helpText,
3771
3799
  isFresh: true,
3772
3800
  isLoading: false
3773
3801
  });
3802
+ if (overwriteExistingValue) {
3803
+ const pNode = $createParagraphNode();
3804
+ pNode.append(variableNode);
3805
+ editor.update(() => {
3806
+ const root = $getRoot();
3807
+ root.clear();
3808
+ root.append(pNode);
3809
+ });
3810
+ return true;
3811
+ }
3774
3812
  if (targetKey) {
3775
3813
  (_b = $getNodeByKey(targetKey)) == null ? void 0 : _b.replace(variableNode);
3776
3814
  } else {
@@ -3806,14 +3844,14 @@ function VariablesPlugin({
3806
3844
  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;
3807
3845
  const newState = {
3808
3846
  ...currentState,
3809
- displayName: (targetVar == null ? void 0 : targetVar.displayName) || (targetUndefinedVar == null ? void 0 : targetUndefinedVar.displayName) || variableNode.reference,
3847
+ displayName: (targetVar == null ? void 0 : targetVar.displayName) || (targetUndefinedVar == null ? void 0 : targetUndefinedVar.displayName) || prettifyBindExpression(variableNode.reference),
3810
3848
  isLoading: isLoadingVariables && !targetVar && !(targetUndefinedVar == null ? void 0 : targetUndefinedVar.info),
3811
3849
  hasClickEvent: canEditVariable(variableNode.reference, targetVar),
3812
3850
  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),
3813
3851
  tooltip,
3814
3852
  isFresh: false
3815
3853
  };
3816
- if (!dequal2(currentState, newState)) {
3854
+ if (!dequal(currentState, newState)) {
3817
3855
  variableNode.setState(newState);
3818
3856
  }
3819
3857
  },
@@ -3960,7 +3998,7 @@ var VariableNode = class _VariableNode extends DecoratorNode {
3960
3998
  * (albeit it won't get the fancy chip-node)
3961
3999
  */
3962
4000
  getTextContent() {
3963
- return createVariableReference2(this.reference);
4001
+ return createVariableReference3(this.reference);
3964
4002
  }
3965
4003
  /** Creates the DOM wrapper that hosts the node */
3966
4004
  createDOM() {
@@ -4171,9 +4209,11 @@ var input = css21`
4171
4209
  min-height: 50px;
4172
4210
  width: 100%;
4173
4211
  position: relative;
4174
- transition: background var(--duration-fast) var(--timing-ease-out),
4212
+ transition:
4213
+ background var(--duration-fast) var(--timing-ease-out),
4175
4214
  border-color var(--duration-fast) var(--timing-ease-out),
4176
- color var(--duration-fast) var(--timing-ease-out), box-shadow var(--duration-fast) var(--timing-ease-out);
4215
+ color var(--duration-fast) var(--timing-ease-out),
4216
+ box-shadow var(--duration-fast) var(--timing-ease-out);
4177
4217
 
4178
4218
  &::placeholder {
4179
4219
  color: var(--gray-400);
@@ -4237,7 +4277,8 @@ var variableBindButton = css22`
4237
4277
  display: flex;
4238
4278
  height: 1.2rem;
4239
4279
  padding: var(--spacing-2xs);
4240
- transition: background var(--duration-fast) var(--timing-ease-out),
4280
+ transition:
4281
+ background var(--duration-fast) var(--timing-ease-out),
4241
4282
  color var(--duration-fast) var(--timing-ease-out);
4242
4283
  width: 1.2rem;
4243
4284
 
@@ -4320,23 +4361,9 @@ var inputMultiLine = (lines) => css22`
4320
4361
  `;
4321
4362
 
4322
4363
  // src/components/Variables/toolbox/InputVariablesProvider.tsx
4364
+ import { hasReferencedVariables } from "@uniformdev/canvas";
4323
4365
  import * as React10 from "react";
4324
4366
  import { useMemo as useMemo9 } from "react";
4325
-
4326
- // src/components/Variables/util/hasReferencedVariables.ts
4327
- import { parseVariableExpression as parseVariableExpression2 } from "@uniformdev/canvas";
4328
- function hasReferencedVariables(value) {
4329
- let result = false;
4330
- parseVariableExpression2(value, (token, type) => {
4331
- if (type === "variable") {
4332
- result = true;
4333
- return false;
4334
- }
4335
- });
4336
- return result;
4337
- }
4338
-
4339
- // src/components/Variables/toolbox/InputVariablesProvider.tsx
4340
4367
  function useInputVariablesState({
4341
4368
  value,
4342
4369
  onChange,
@@ -4351,20 +4378,20 @@ function useInputVariablesState({
4351
4378
  renderMenuInPortal
4352
4379
  }) {
4353
4380
  const { variables } = useVariables(true);
4354
- const hasVariablesInValue = hasReferencedVariables(value != null ? value : "");
4381
+ const variableReferenceCountInValue = hasReferencedVariables(value != null ? value : "");
4355
4382
  const [lastKnownId] = React10.useState(id);
4356
- const [hadVariablesInValue, setHadVariablesInValue] = React10.useState(hasVariablesInValue);
4383
+ const [hadVariablesInValue, setHadVariablesInValue] = React10.useState(variableReferenceCountInValue > 0);
4357
4384
  React10.useEffect(() => {
4358
- if (hasVariablesInValue) {
4385
+ if (variableReferenceCountInValue) {
4359
4386
  setHadVariablesInValue(true);
4360
4387
  }
4361
- }, [hasVariablesInValue]);
4388
+ }, [variableReferenceCountInValue]);
4362
4389
  React10.useEffect(() => {
4363
4390
  if (id !== lastKnownId) {
4364
- setHadVariablesInValue(hasVariablesInValue);
4391
+ setHadVariablesInValue(variableReferenceCountInValue > 0);
4365
4392
  }
4366
- }, [hasVariablesInValue, id, lastKnownId]);
4367
- const hadVariablesInValueForReals = inputWhenNoVariables ? hadVariablesInValue : hasVariablesInValue;
4393
+ }, [variableReferenceCountInValue, id, lastKnownId]);
4394
+ const hadVariablesInValueForReals = inputWhenNoVariables ? hadVariablesInValue : variableReferenceCountInValue > 0;
4368
4395
  const disableVariablesForReals = disableVariables || Object.keys(variables).length === 0 && !showAddVariableMenuOption;
4369
4396
  const disableResetForReals = !inputWhenNoVariables || !hadVariablesInValueForReals;
4370
4397
  const sharedMenuProps = useMemo9(
@@ -4393,7 +4420,7 @@ function useInputVariablesState({
4393
4420
  return {
4394
4421
  sharedMenuProps,
4395
4422
  disableVariablesForReals,
4396
- hasVariablesInValue,
4423
+ hasVariablesInValue: variableReferenceCountInValue > 0,
4397
4424
  hadVariablesInValue: hadVariablesInValueForReals,
4398
4425
  setHadVariablesInValue
4399
4426
  };
@@ -4416,7 +4443,8 @@ var variableBindButton2 = css23`
4416
4443
  display: flex;
4417
4444
  height: 1.2rem;
4418
4445
  padding: var(--spacing-2xs);
4419
- transition: background var(--duration-fast) var(--timing-ease-out),
4446
+ transition:
4447
+ background var(--duration-fast) var(--timing-ease-out),
4420
4448
  color var(--duration-fast) var(--timing-ease-out);
4421
4449
  width: 1.2rem;
4422
4450
 
@@ -4440,7 +4468,7 @@ import { CLEAR_EDITOR_COMMAND } from "lexical";
4440
4468
  import { BsFillPlusCircleFill } from "@react-icons/all-files/bs/BsFillPlusCircleFill";
4441
4469
  import { CgUsbC } from "@react-icons/all-files/cg/CgUsbC";
4442
4470
  import { HorizontalRhythm as HorizontalRhythm3, Menu as Menu2, MenuGroup as MenuGroup2, MenuItem as MenuItem2, MenuItemSeparator as MenuItemSeparator2 } from "@uniformdev/design-system";
4443
- import { useRef as useRef11 } from "react";
4471
+ import { useRef as useRef10 } from "react";
4444
4472
  import { Fragment as Fragment7, jsx as jsx35, jsxs as jsxs19 } from "@emotion/react/jsx-runtime";
4445
4473
  function SelectVariableMenu({
4446
4474
  onSelectVariable,
@@ -4455,7 +4483,7 @@ function SelectVariableMenu({
4455
4483
  filterVariable
4456
4484
  }) {
4457
4485
  const { variables, canDispatch, readOnly } = useVariables(true);
4458
- const btnRef = useRef11(null);
4486
+ const btnRef = useRef10(null);
4459
4487
  const { editVariable } = useVariableEditor();
4460
4488
  const variablesGroups = variablesToGroupedList(variables, filterVariable, getEditorContext == null ? void 0 : getEditorContext());
4461
4489
  const showAddVariableMenuOptionForReals = showAddVariableMenuOption && canDispatch && !readOnly;
@@ -4589,7 +4617,7 @@ import { AutoFocusPlugin } from "@lexical/react/LexicalAutoFocusPlugin";
4589
4617
  import { ClearEditorPlugin } from "@lexical/react/LexicalClearEditorPlugin";
4590
4618
  import { LexicalComposer } from "@lexical/react/LexicalComposer";
4591
4619
  import { OnChangePlugin } from "@lexical/react/LexicalOnChangePlugin";
4592
- import { useMemo as useMemo10, useRef as useRef12, useState as useState12 } from "react";
4620
+ import { useMemo as useMemo10, useRef as useRef11, useState as useState12 } from "react";
4593
4621
 
4594
4622
  // src/components/Variables/composer/DisablePlugin.tsx
4595
4623
  import { useLexicalComposerContext as useLexicalComposerContext7 } from "@lexical/react/LexicalComposerContext";
@@ -4604,50 +4632,18 @@ function DisablePlugin({ disabled }) {
4604
4632
 
4605
4633
  // src/components/Variables/composer/SingleLineTextPlugin.tsx
4606
4634
  import { useLexicalComposerContext as useLexicalComposerContext8 } from "@lexical/react/LexicalComposerContext";
4607
- import { LineBreakNode } from "lexical";
4635
+ import { LineBreakNode as LineBreakNode2 } from "lexical";
4608
4636
  import { useEffect as useEffect13 } from "react";
4609
4637
  function SingleLineTextPlugin() {
4610
4638
  const [editor] = useLexicalComposerContext8();
4611
4639
  useEffect13(() => {
4612
- editor.registerNodeTransform(LineBreakNode, (node) => {
4640
+ editor.registerNodeTransform(LineBreakNode2, (node) => {
4613
4641
  node.remove();
4614
4642
  });
4615
4643
  }, [editor]);
4616
4644
  return null;
4617
4645
  }
4618
4646
 
4619
- // src/components/Variables/util/serializeVariablesEditorState.ts
4620
- import { createVariableReference as createVariableReference3 } from "@uniformdev/canvas";
4621
- import { LineBreakNode as LineBreakNode2, TextNode as TextNode3 } from "lexical";
4622
-
4623
- // src/components/Variables/util/variableExpression.ts
4624
- var variablePrefix = "${";
4625
- var variableSuffix = "}";
4626
-
4627
- // src/components/Variables/util/serializeVariablesEditorState.ts
4628
- function serializeVariablesEditorState(editorState) {
4629
- const buf = [];
4630
- serializeRecursive(editorState.toJSON().root, buf);
4631
- const result = buf.join("");
4632
- return result.length > 0 ? result : void 0;
4633
- }
4634
- function serializeRecursive(node, buffer) {
4635
- if (node.type === TextNode3.getType()) {
4636
- buffer.push(node.text.replace(variablePrefix, "\\${"));
4637
- }
4638
- if (node.type === VariableNode.getType()) {
4639
- buffer.push(createVariableReference3(node.reference));
4640
- }
4641
- if (node.type === LineBreakNode2.getType()) {
4642
- buffer.push("\n");
4643
- }
4644
- if ("children" in node && node.children) {
4645
- for (const child of node.children) {
4646
- serializeRecursive(child, buffer);
4647
- }
4648
- }
4649
- }
4650
-
4651
4647
  // src/components/Variables/toolbox/VariablesComposer.tsx
4652
4648
  import { Fragment as Fragment8, jsx as jsx38, jsxs as jsxs21 } from "@emotion/react/jsx-runtime";
4653
4649
  function VariablesComposer(props) {
@@ -4674,8 +4670,8 @@ function VariablesComposer(props) {
4674
4670
  // eslint-disable-next-line react-hooks/exhaustive-deps
4675
4671
  []
4676
4672
  );
4677
- const editorState = useRef12();
4678
- const updateTimeout = useRef12();
4673
+ const editorState = useRef11();
4674
+ const updateTimeout = useRef11();
4679
4675
  if (typeof document === "undefined") return null;
4680
4676
  return /* @__PURE__ */ jsxs21(LexicalComposer, { initialConfig: editorConfig, children: [
4681
4677
  /* @__PURE__ */ jsx38(
@@ -4854,7 +4850,8 @@ function InputVariables(props) {
4854
4850
  filterVariable,
4855
4851
  styleVariant = "default",
4856
4852
  renderMenuInPortal,
4857
- disableDismissEditorOnChange
4853
+ disableDismissEditorOnChange,
4854
+ singleTokenMode
4858
4855
  } = props;
4859
4856
  const [finalId] = useState13(id != null ? id : () => v42());
4860
4857
  const { dispatch, canDispatch, isEditing } = useVariables(true);
@@ -4919,7 +4916,7 @@ function InputVariables(props) {
4919
4916
  buttonCss: variableBindButton,
4920
4917
  tip: useInputWithNoVariables ? void 0 : "Tip: access this list by typing $$",
4921
4918
  buttonProps: hadVariablesInValue ? { "aria-pressed": "true" } : void 0,
4922
- replaceValueOnVariableInsert: useInputWithNoVariables
4919
+ replaceValueOnVariableInsert: singleTokenMode || useInputWithNoVariables
4923
4920
  }
4924
4921
  )
4925
4922
  ]
@@ -4959,13 +4956,13 @@ function InputVariables(props) {
4959
4956
  showAddVariableMenuOption,
4960
4957
  enableEditingVariables: !disabled && !disableVariablesForReals && enableEditingVariables,
4961
4958
  getEditorContext,
4962
- disabled,
4959
+ disabled: disabled || singleTokenMode,
4963
4960
  replaceValueOnVariableInsert: useInputWithNoVariables,
4964
4961
  autoFocus,
4965
4962
  filterVariable,
4966
4963
  children: [
4967
4964
  /* @__PURE__ */ jsx40(PasteTransformerPlugin, { transformPaste }),
4968
- /* @__PURE__ */ jsx40(ControlledValuePlugin, { value, enabled: useInputWithNoVariables }),
4965
+ /* @__PURE__ */ jsx40(ControlledValuePlugin, { value, enabled: singleTokenMode || useInputWithNoVariables }),
4969
4966
  editorRef ? /* @__PURE__ */ jsx40(EditorRefPlugin, { editorRef }) : null,
4970
4967
  body
4971
4968
  ]
@@ -5023,7 +5020,7 @@ function ParameterConnectionIndicator({
5023
5020
  return result;
5024
5021
  }, [value]);
5025
5022
  return /* @__PURE__ */ jsxs24(HorizontalRhythm5, { align: "center", gap: "xs", css: { width: "100%" }, children: [
5026
- /* @__PURE__ */ jsx41("div", { css: { flex: 1 }, children }),
5023
+ /* @__PURE__ */ jsx41("div", { css: { flex: 1, maxWidth: "100%" }, children }),
5027
5024
  disabled ? null : /* @__PURE__ */ jsx41(
5028
5025
  Menu3,
5029
5026
  {
@@ -5062,13 +5059,13 @@ import { useCallback as useCallback4 } from "react";
5062
5059
  import { useLexicalComposerContext as useLexicalComposerContext10 } from "@lexical/react/LexicalComposerContext";
5063
5060
  import { mergeRegister as mergeRegister5 } from "@lexical/utils";
5064
5061
  import { $getNodeByKey as $getNodeByKey3, COMMAND_PRIORITY_HIGH as COMMAND_PRIORITY_HIGH3 } from "lexical";
5065
- import { useEffect as useEffect15, useRef as useRef13 } from "react";
5062
+ import { useEffect as useEffect15, useRef as useRef12 } from "react";
5066
5063
  function OnDisconnectPlugin({
5067
5064
  onDisconnect
5068
5065
  }) {
5069
5066
  const [editor] = useLexicalComposerContext10();
5070
5067
  const { variables } = useVariables(true);
5071
- const variablesRef = useRef13(variables);
5068
+ const variablesRef = useRef12(variables);
5072
5069
  variablesRef.current = variables;
5073
5070
  useEffect15(() => {
5074
5071
  return mergeRegister5(
@@ -5261,8 +5258,15 @@ ${prettifyBindExpression(bindExpression)}`
5261
5258
  };
5262
5259
  }
5263
5260
 
5261
+ // src/components/Variables/util/hasReferencedVariables.ts
5262
+ import { hasReferencedVariables as canvasHasReferencedVariables } from "@uniformdev/canvas";
5263
+ function hasReferencedVariables2(value) {
5264
+ return canvasHasReferencedVariables(value) > 0;
5265
+ }
5266
+
5264
5267
  // src/components/Variables/VariablesList.tsx
5265
5268
  import { css as css27 } from "@emotion/react";
5269
+ import { CgTrash } from "@react-icons/all-files/cg/CgTrash";
5266
5270
  import {
5267
5271
  AddListButton,
5268
5272
  button,
@@ -5397,7 +5401,7 @@ function VariablesList() {
5397
5401
  ],
5398
5402
  "aria-controls": text,
5399
5403
  onClick: () => dispatch({ type: "remove", variable: name }),
5400
- children: /* @__PURE__ */ jsx44(Icon5, { icon: "trash", iconColor: "red" })
5404
+ children: /* @__PURE__ */ jsx44(Icon5, { icon: CgTrash, iconColor: "red" })
5401
5405
  }
5402
5406
  ) })
5403
5407
  ]
@@ -6232,11 +6236,11 @@ import { LoadingIndicator as LoadingIndicator3, Theme as Theme2 } from "@uniform
6232
6236
 
6233
6237
  // src/hooks/useInitializeUniformMeshSdk.ts
6234
6238
  import { initializeUniformMeshSDK } from "@uniformdev/mesh-sdk";
6235
- import { useEffect as useEffect16, useRef as useRef14, useState as useState15 } from "react";
6239
+ import { useEffect as useEffect16, useRef as useRef13, useState as useState15 } from "react";
6236
6240
  var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
6237
6241
  const [error, setError] = useState15();
6238
6242
  const [sdk, setSdk] = useState15();
6239
- const initializationInProgress = useRef14(false);
6243
+ const initializationInProgress = useRef13(false);
6240
6244
  useEffect16(
6241
6245
  () => {
6242
6246
  if (typeof window === "undefined" || sdk) {
@@ -6320,7 +6324,7 @@ var DataRefreshButton = ({
6320
6324
  // src/components/ObjectSearch/ObjectSearchContainer.tsx
6321
6325
  import { css as css33 } from "@emotion/react";
6322
6326
  import { bindVariables } from "@uniformdev/canvas";
6323
- import { Callout as Callout5, Container, IconsProvider, ScrollableList, VerticalRhythm as VerticalRhythm3 } from "@uniformdev/design-system";
6327
+ import { Callout as Callout5, Container, ScrollableList, VerticalRhythm as VerticalRhythm3 } from "@uniformdev/design-system";
6324
6328
 
6325
6329
  // src/components/ObjectSearch/hooks/ObjectSearchContext.tsx
6326
6330
  import { bindVariablesToObject as bindVariablesToObject2 } from "@uniformdev/canvas";
@@ -6639,7 +6643,7 @@ var ObjectSearchContainer = ({
6639
6643
  }
6640
6644
  ]);
6641
6645
  };
6642
- return /* @__PURE__ */ jsx61(IconsProvider, { children: /* @__PURE__ */ jsxs35(VerticalRhythm3, { children: [
6646
+ return /* @__PURE__ */ jsxs35(VerticalRhythm3, { children: [
6643
6647
  /* @__PURE__ */ jsx61(Container, { backgroundColor: "gray-50", padding: "var(--spacing-base)", border: true, children: label ? /* @__PURE__ */ jsx61(
6644
6648
  InputVariables,
6645
6649
  {
@@ -6656,7 +6660,7 @@ var ObjectSearchContainer = ({
6656
6660
  }
6657
6661
  ) : body }),
6658
6662
  children
6659
- ] }) });
6663
+ ] });
6660
6664
  };
6661
6665
  var DefaultResultList = () => {
6662
6666
  var _a;
@@ -6785,7 +6789,8 @@ var ButtonStyles = css35`
6785
6789
  font-size: var(--fs-sm);
6786
6790
  line-height: 1;
6787
6791
  gap: var(--spacing-xs);
6788
- transition: border-color var(--duration-fast) var(--timing-ease-out),
6792
+ transition:
6793
+ border-color var(--duration-fast) var(--timing-ease-out),
6789
6794
  background-color var(--duration-fast) var(--timing-ease-out);
6790
6795
 
6791
6796
  &:hover {
@@ -7245,7 +7250,7 @@ var QueryFilter = ({
7245
7250
  };
7246
7251
 
7247
7252
  // src/components/ParamTypeDynamicDataProvider.tsx
7248
- import { useEffect as useEffect18, useMemo as useMemo16, useRef as useRef15 } from "react";
7253
+ import { useEffect as useEffect18, useMemo as useMemo16, useRef as useRef14 } from "react";
7249
7254
  import { jsx as jsx68 } from "@emotion/react/jsx-runtime";
7250
7255
  function ParamTypeDynamicDataProvider(props) {
7251
7256
  const { children } = props;
@@ -7267,7 +7272,7 @@ var JsonMeshVariableEditor = ({
7267
7272
  variable,
7268
7273
  context
7269
7274
  }) => {
7270
- const sillyRef = useRef15(false);
7275
+ const sillyRef = useRef14(false);
7271
7276
  const { editConnectedData } = useMeshLocation("paramType");
7272
7277
  useEffect18(() => {
7273
7278
  if (sillyRef.current) {
@@ -7301,371 +7306,445 @@ var JsonMeshVariableEditor = ({
7301
7306
  var NUMBER_OPERATORS = [
7302
7307
  {
7303
7308
  label: "equals...",
7304
- symbol: "=",
7305
7309
  value: "eq",
7306
- editorType: "number"
7310
+ editorType: "number",
7311
+ expectedValueType: "single"
7307
7312
  },
7308
7313
  {
7309
7314
  label: "does not equal...",
7310
- symbol: "\u2260",
7311
7315
  value: "neq",
7312
- editorType: "number"
7316
+ editorType: "number",
7317
+ expectedValueType: "single"
7313
7318
  },
7314
7319
  {
7315
7320
  label: "greater than...",
7316
- symbol: ">",
7317
7321
  value: "gt",
7318
- editorType: "number"
7322
+ editorType: "number",
7323
+ expectedValueType: "single"
7319
7324
  },
7320
7325
  {
7321
7326
  label: "greater than or equal to...",
7322
- symbol: "\u2265",
7323
7327
  value: "gte",
7324
- editorType: "number"
7328
+ editorType: "number",
7329
+ expectedValueType: "single"
7325
7330
  },
7326
7331
  {
7327
7332
  label: "less than...",
7328
- symbol: "<",
7329
7333
  value: "lt",
7330
- editorType: "number"
7334
+ editorType: "number",
7335
+ expectedValueType: "single"
7331
7336
  },
7332
7337
  {
7333
7338
  label: "less than or equal to...",
7334
- symbol: "\u2264",
7335
7339
  value: "lte",
7336
- editorType: "number"
7340
+ editorType: "number",
7341
+ expectedValueType: "single"
7337
7342
  },
7338
7343
  {
7339
7344
  label: "is empty",
7340
7345
  value: "ndef",
7341
- editorType: "empty"
7346
+ editorType: "empty",
7347
+ expectedValueType: "false"
7342
7348
  },
7343
7349
  {
7344
7350
  label: "is between...",
7345
7351
  value: "between",
7346
- editorType: "numberRange"
7352
+ editorType: "numberRange",
7353
+ expectedValueType: "between"
7347
7354
  },
7348
7355
  {
7349
7356
  label: "is not empty",
7350
7357
  value: "def",
7351
- editorType: "empty"
7358
+ editorType: "empty",
7359
+ expectedValueType: "true"
7352
7360
  }
7353
7361
  ];
7354
7362
  var DATE_OPERATORS = [
7355
7363
  {
7356
7364
  label: "is",
7357
7365
  value: "eq",
7358
- editorType: "date"
7366
+ editorType: "date",
7367
+ expectedValueType: "single"
7359
7368
  },
7360
7369
  {
7361
7370
  label: "is between...",
7362
7371
  value: "between",
7363
- editorType: "dateRange"
7372
+ editorType: "dateRange",
7373
+ expectedValueType: "between"
7364
7374
  },
7365
7375
  {
7366
7376
  label: "is before...",
7367
7377
  value: "lt",
7368
- editorType: "date"
7378
+ editorType: "date",
7379
+ expectedValueType: "single"
7369
7380
  },
7370
7381
  {
7371
7382
  label: "is after...",
7372
7383
  value: "gt",
7373
- editorType: "date"
7384
+ editorType: "date",
7385
+ expectedValueType: "single"
7374
7386
  },
7375
7387
  {
7376
7388
  label: "is on or before...",
7377
7389
  value: "lte",
7378
- editorType: "date"
7390
+ editorType: "date",
7391
+ expectedValueType: "single"
7379
7392
  },
7380
7393
  {
7381
7394
  label: "is on or after...",
7382
7395
  value: "gte",
7383
- editorType: "date"
7396
+ editorType: "date",
7397
+ expectedValueType: "single"
7384
7398
  },
7385
7399
  {
7386
7400
  label: "is empty",
7387
7401
  value: "ndef",
7388
- editorType: "empty"
7402
+ editorType: "empty",
7403
+ expectedValueType: "false"
7389
7404
  },
7390
7405
  {
7391
7406
  label: "is not",
7392
7407
  value: "neq",
7393
- editorType: "date"
7408
+ editorType: "date",
7409
+ expectedValueType: "single"
7394
7410
  },
7395
7411
  {
7396
7412
  label: "is not empty",
7397
7413
  value: "def",
7398
- editorType: "empty"
7414
+ editorType: "empty",
7415
+ expectedValueType: "true"
7399
7416
  }
7400
7417
  ];
7401
7418
  var TEXTBOX_OPERATORS = [
7402
7419
  {
7403
7420
  label: "contains...",
7404
7421
  value: "match",
7405
- editorType: "text"
7422
+ editorType: "text",
7423
+ expectedValueType: "single"
7406
7424
  },
7407
7425
  {
7408
7426
  label: "is",
7409
7427
  value: "eq",
7410
- editorType: "text"
7428
+ editorType: "text",
7429
+ expectedValueType: "single"
7411
7430
  },
7412
7431
  {
7413
7432
  label: "is empty",
7414
7433
  value: "ndef",
7415
- editorType: "empty"
7434
+ editorType: "empty",
7435
+ expectedValueType: "false"
7416
7436
  },
7417
7437
  {
7418
7438
  label: "starts with...",
7419
7439
  value: "starts",
7420
- editorType: "text"
7440
+ editorType: "text",
7441
+ expectedValueType: "single"
7421
7442
  },
7422
7443
  {
7423
7444
  label: "is not",
7424
7445
  value: "neq",
7425
- editorType: "text"
7446
+ editorType: "text",
7447
+ expectedValueType: "single"
7426
7448
  },
7427
7449
  {
7428
7450
  label: "is not empty",
7429
7451
  value: "def",
7430
- editorType: "empty"
7452
+ editorType: "empty",
7453
+ expectedValueType: "true"
7431
7454
  }
7432
7455
  ];
7433
7456
  var USER_OPERATORS = [
7434
7457
  {
7435
7458
  label: "contains...",
7436
7459
  value: "match",
7437
- editorType: "text"
7460
+ editorType: "text",
7461
+ expectedValueType: "single"
7438
7462
  },
7439
7463
  {
7440
7464
  label: "is",
7441
7465
  value: "eq",
7442
- editorType: "text"
7466
+ editorType: "text",
7467
+ expectedValueType: "single"
7443
7468
  },
7444
7469
  {
7445
7470
  label: "starts with...",
7446
7471
  value: "starts",
7447
- editorType: "text"
7472
+ editorType: "text",
7473
+ expectedValueType: "single"
7448
7474
  },
7449
7475
  {
7450
7476
  label: "is not",
7451
7477
  value: "neq",
7452
- editorType: "text"
7478
+ editorType: "text",
7479
+ expectedValueType: "single"
7453
7480
  }
7454
7481
  ];
7455
- var SYSTEM_DATE_OPERATORS = [
7482
+ var DATE_TIME_OPERATORS = [
7456
7483
  {
7457
7484
  label: "is",
7458
7485
  value: "sys-date-eq",
7459
- editorType: "date"
7486
+ editorType: "date",
7487
+ expectedValueType: "single"
7460
7488
  },
7461
7489
  {
7462
7490
  label: "is between...",
7463
7491
  value: "sys-date-between",
7464
- editorType: "dateRange"
7492
+ editorType: "dateRange",
7493
+ expectedValueType: "between"
7465
7494
  },
7466
7495
  {
7467
7496
  label: "is before...",
7468
7497
  value: "sys-date-lt",
7469
- editorType: "date"
7498
+ editorType: "date",
7499
+ expectedValueType: "single"
7470
7500
  },
7471
7501
  {
7472
7502
  label: "is after...",
7473
7503
  value: "sys-date-gt",
7474
- editorType: "date"
7504
+ editorType: "date",
7505
+ expectedValueType: "single"
7475
7506
  },
7476
7507
  {
7477
7508
  label: "is on or before...",
7478
7509
  value: "sys-date-lte",
7479
- editorType: "date"
7510
+ editorType: "date",
7511
+ expectedValueType: "single"
7480
7512
  },
7481
7513
  {
7482
7514
  label: "is on or after...",
7483
7515
  value: "sys-date-gte",
7484
- editorType: "date"
7516
+ editorType: "date",
7517
+ expectedValueType: "single"
7518
+ },
7519
+ {
7520
+ label: "is empty",
7521
+ value: "ndef",
7522
+ editorType: "empty",
7523
+ expectedValueType: "false"
7524
+ },
7525
+ {
7526
+ label: "is not empty",
7527
+ value: "def",
7528
+ editorType: "empty",
7529
+ expectedValueType: "true"
7485
7530
  }
7486
7531
  ];
7487
7532
  var RICHTEXT_OPERATORS = [
7488
7533
  {
7489
7534
  label: "contains...",
7490
7535
  value: "match",
7491
- editorType: "text"
7536
+ editorType: "text",
7537
+ expectedValueType: "single"
7492
7538
  },
7493
7539
  {
7494
7540
  label: "is empty",
7495
7541
  value: "ndef",
7496
- editorType: "empty"
7542
+ editorType: "empty",
7543
+ expectedValueType: "false"
7497
7544
  },
7498
7545
  {
7499
7546
  label: "starts with...",
7500
7547
  value: "starts",
7501
- editorType: "text"
7548
+ editorType: "text",
7549
+ expectedValueType: "single"
7502
7550
  },
7503
7551
  {
7504
7552
  label: "is not empty",
7505
7553
  value: "def",
7506
- editorType: "empty"
7554
+ editorType: "empty",
7555
+ expectedValueType: "true"
7507
7556
  }
7508
7557
  ];
7509
7558
  var CHECKBOX_OPERATORS = [
7510
7559
  {
7511
7560
  label: "is checked",
7512
7561
  value: "def",
7513
- editorType: "empty"
7562
+ editorType: "empty",
7563
+ expectedValueType: "true"
7514
7564
  },
7515
7565
  {
7516
7566
  label: "is not checked",
7517
7567
  value: "ndef",
7518
- editorType: "empty"
7568
+ editorType: "empty",
7569
+ expectedValueType: "false"
7519
7570
  }
7520
7571
  ];
7521
7572
  var SYSTEM_FIELD_OPERATORS = [
7522
7573
  {
7523
7574
  label: "is",
7524
7575
  value: "eq",
7525
- editorType: "singleChoice"
7576
+ editorType: "singleChoice",
7577
+ expectedValueType: "single"
7526
7578
  },
7527
7579
  {
7528
7580
  label: "is any of...",
7529
7581
  value: "in",
7530
- editorType: "multiChoice"
7582
+ editorType: "multiChoice",
7583
+ expectedValueType: "array"
7531
7584
  },
7532
7585
  {
7533
7586
  label: "is not",
7534
7587
  value: "neq",
7535
- editorType: "singleChoice"
7588
+ editorType: "singleChoice",
7589
+ expectedValueType: "single"
7536
7590
  },
7537
7591
  {
7538
7592
  label: "is none of...",
7539
7593
  value: "nin",
7540
- editorType: "multiChoice"
7594
+ editorType: "multiChoice",
7595
+ expectedValueType: "array"
7541
7596
  }
7542
7597
  ];
7543
7598
  var OPTIONAL_SYSTEM_FIELD_OPERATORS = [
7544
7599
  {
7545
7600
  label: "is",
7546
7601
  value: "eq",
7547
- editorType: "singleChoice"
7602
+ editorType: "singleChoice",
7603
+ expectedValueType: "single"
7548
7604
  },
7549
7605
  {
7550
7606
  label: "is any of...",
7551
7607
  value: "in",
7552
- editorType: "multiChoice"
7608
+ editorType: "multiChoice",
7609
+ expectedValueType: "array"
7553
7610
  },
7554
7611
  {
7555
7612
  label: "is empty",
7556
7613
  value: "ndef",
7557
- editorType: "empty"
7614
+ editorType: "empty",
7615
+ expectedValueType: "false"
7558
7616
  },
7559
7617
  {
7560
7618
  label: "is not",
7561
7619
  value: "neq",
7562
- editorType: "singleChoice"
7620
+ editorType: "singleChoice",
7621
+ expectedValueType: "single"
7563
7622
  },
7564
7623
  {
7565
7624
  label: "is none of...",
7566
7625
  value: "nin",
7567
- editorType: "multiChoice"
7626
+ editorType: "multiChoice",
7627
+ expectedValueType: "array"
7568
7628
  },
7569
7629
  {
7570
7630
  label: "is not empty",
7571
7631
  value: "def",
7572
- editorType: "empty"
7632
+ editorType: "empty",
7633
+ expectedValueType: "true"
7573
7634
  }
7574
7635
  ];
7575
7636
  var PUBLISH_STATUS_FIELD_OPERATORS = [
7576
7637
  {
7577
7638
  label: "is",
7578
7639
  value: "eq",
7579
- editorType: "statusSingleChoice"
7640
+ editorType: "statusSingleChoice",
7641
+ expectedValueType: "single"
7580
7642
  },
7581
7643
  {
7582
7644
  label: "is any of...",
7583
7645
  value: "in",
7584
- editorType: "statusMultiChoice"
7646
+ editorType: "statusMultiChoice",
7647
+ expectedValueType: "array"
7585
7648
  },
7586
7649
  {
7587
7650
  label: "is not",
7588
7651
  value: "neq",
7589
- editorType: "statusSingleChoice"
7652
+ editorType: "statusSingleChoice",
7653
+ expectedValueType: "single"
7590
7654
  },
7591
7655
  {
7592
7656
  label: "is none of...",
7593
7657
  value: "nin",
7594
- editorType: "statusMultiChoice"
7658
+ editorType: "statusMultiChoice",
7659
+ expectedValueType: "array"
7595
7660
  }
7596
7661
  ];
7597
7662
  var SELECT_OPERATORS = [
7598
7663
  {
7599
7664
  label: "is",
7600
7665
  value: "eq",
7601
- editorType: "singleChoice"
7666
+ editorType: "singleChoice",
7667
+ expectedValueType: "single"
7602
7668
  },
7603
7669
  {
7604
7670
  label: "is any of...",
7605
7671
  value: "in",
7606
- editorType: "multiChoice"
7672
+ editorType: "multiChoice",
7673
+ expectedValueType: "array"
7607
7674
  },
7608
7675
  {
7609
7676
  label: "is empty",
7610
7677
  value: "ndef",
7611
- editorType: "empty"
7678
+ editorType: "empty",
7679
+ expectedValueType: "false"
7612
7680
  },
7613
7681
  {
7614
7682
  label: "contains...",
7615
7683
  value: "match",
7616
- editorType: "text"
7684
+ editorType: "text",
7685
+ expectedValueType: "single"
7617
7686
  },
7618
7687
  {
7619
7688
  label: "starts with...",
7620
7689
  value: "starts",
7621
- editorType: "text"
7690
+ editorType: "text",
7691
+ expectedValueType: "single"
7622
7692
  },
7623
7693
  {
7624
7694
  label: "is not",
7625
7695
  value: "neq",
7626
- editorType: "singleChoice"
7696
+ editorType: "singleChoice",
7697
+ expectedValueType: "single"
7627
7698
  },
7628
7699
  {
7629
7700
  label: "is none of...",
7630
7701
  value: "nin",
7631
- editorType: "multiChoice"
7702
+ editorType: "multiChoice",
7703
+ expectedValueType: "array"
7632
7704
  },
7633
7705
  {
7634
7706
  label: "is not empty",
7635
7707
  value: "def",
7636
- editorType: "empty"
7708
+ editorType: "empty",
7709
+ expectedValueType: "true"
7637
7710
  }
7638
7711
  ];
7639
7712
  var MULTI_SELECT_OPERATORS = [
7640
7713
  {
7641
7714
  label: "is",
7642
7715
  value: "eq",
7643
- editorType: "singleChoice"
7716
+ editorType: "singleChoice",
7717
+ expectedValueType: "single"
7644
7718
  },
7645
7719
  {
7646
7720
  label: "is any of...",
7647
7721
  value: "in",
7648
- editorType: "multiChoice"
7722
+ editorType: "multiChoice",
7723
+ expectedValueType: "array"
7649
7724
  },
7650
7725
  {
7651
7726
  label: "is empty",
7652
7727
  value: "ndef",
7653
- editorType: "empty"
7728
+ editorType: "empty",
7729
+ expectedValueType: "false"
7654
7730
  },
7655
7731
  {
7656
7732
  label: "is not",
7657
7733
  value: "neq",
7658
- editorType: "singleChoice"
7734
+ editorType: "singleChoice",
7735
+ expectedValueType: "single"
7659
7736
  },
7660
7737
  {
7661
7738
  label: "is none of...",
7662
7739
  value: "nin",
7663
- editorType: "multiChoice"
7740
+ editorType: "multiChoice",
7741
+ expectedValueType: "array"
7664
7742
  },
7665
7743
  {
7666
7744
  label: "is not empty",
7667
7745
  value: "def",
7668
- editorType: "empty"
7746
+ editorType: "empty",
7747
+ expectedValueType: "true"
7669
7748
  }
7670
7749
  ];
7671
7750
 
@@ -8245,7 +8324,7 @@ var TextMultiChoiceEditor = ({
8245
8324
  };
8246
8325
 
8247
8326
  // src/components/SearchAndFilter/FilterButton.tsx
8248
- import { Counter as Counter2, Icon as Icon6 } from "@uniformdev/design-system";
8327
+ import { Counter as Counter2, customIcons, Icon as Icon6 } from "@uniformdev/design-system";
8249
8328
 
8250
8329
  // src/components/SearchAndFilter/styles/SearchAndFilter.styles.ts
8251
8330
  import { css as css38 } from "@emotion/react";
@@ -8315,13 +8394,16 @@ var ConditionalInputRow = css38`
8315
8394
  ${cq("764px")} {
8316
8395
  align-items: flex-start;
8317
8396
  display: grid;
8318
- grid-template-columns: 200px 160px 1fr 32px;
8397
+ grid-template-columns: 250px 160px 1fr 32px;
8319
8398
 
8320
8399
  & > div:nth-child(n) {
8321
8400
  width: auto;
8322
8401
  }
8323
8402
  }
8324
8403
  `;
8404
+ var ConditionalInputRowEmpty = css38`
8405
+ flex-wrap: nowrap;
8406
+ `;
8325
8407
  var SearchInput = css38`
8326
8408
  max-height: 40px;
8327
8409
  min-height: unset;
@@ -8364,7 +8446,8 @@ var FilterButton = css38`
8364
8446
  gap: var(--spacing-sm);
8365
8447
  padding: var(--spacing-sm) var(--spacing-base);
8366
8448
  max-height: 40px;
8367
- transition: color var(--duration-fast) var(--timing-ease-out),
8449
+ transition:
8450
+ color var(--duration-fast) var(--timing-ease-out),
8368
8451
  background-color var(--duration-fast) var(--timing-ease-out),
8369
8452
  border-color var(--duration-fast) var(--timing-ease-out),
8370
8453
  box-shadow var(--duration-fast) var(--timing-ease-out);
@@ -8459,6 +8542,9 @@ var ResetConditionsBtn = css38`
8459
8542
  &:focus {
8460
8543
  color: var(--action-destructive-hover);
8461
8544
  }
8545
+ &:disabled {
8546
+ color: var(--gray-400);
8547
+ }
8462
8548
  `;
8463
8549
  var IconBtn = css38`
8464
8550
  align-self: center;
@@ -8494,7 +8580,7 @@ var SearchAndFilterButtonGroup = css38`
8494
8580
  import { jsx as jsx81, jsxs as jsxs44 } from "@emotion/react/jsx-runtime";
8495
8581
  var FilterButton2 = ({
8496
8582
  text = "Filters",
8497
- icon = "filter-add",
8583
+ icon = customIcons["filter-add"],
8498
8584
  filterCount,
8499
8585
  hasSelectedValue,
8500
8586
  dataTestId,
@@ -8522,9 +8608,10 @@ var FilterButton2 = ({
8522
8608
 
8523
8609
  // src/components/SearchAndFilter/FilterControls.tsx
8524
8610
  import { CgClose as CgClose5 } from "@react-icons/all-files/cg/CgClose";
8611
+ import { hasReferencedVariables as hasReferencedVariables3 } from "@uniformdev/canvas";
8525
8612
  import { Icon as Icon7, InputKeywordSearch as InputKeywordSearch2 } from "@uniformdev/design-system";
8526
8613
  import { CLEAR_EDITOR_COMMAND as CLEAR_EDITOR_COMMAND2 } from "lexical";
8527
- import { useEffect as useEffect22, useRef as useRef16, useState as useState25 } from "react";
8614
+ import { useEffect as useEffect22, useRef as useRef15, useState as useState25 } from "react";
8528
8615
  import { useDebounce as useDebounce9 } from "react-use";
8529
8616
  import { v4 as v43 } from "uuid";
8530
8617
 
@@ -8563,7 +8650,7 @@ var filterMapper = {
8563
8650
  statusSingleChoice: StatusSingleEditor,
8564
8651
  empty: null
8565
8652
  };
8566
- function withInputVariables(WrappedComponent) {
8653
+ function withInputVariables(WrappedComponent, noSwapping = false) {
8567
8654
  const WithInputVariables = (props) => {
8568
8655
  if (Array.isArray(props.value) || !props.bindable || props.disabled || props.readOnly) {
8569
8656
  return /* @__PURE__ */ jsx82(WrappedComponent, { ...props });
@@ -8576,7 +8663,7 @@ function withInputVariables(WrappedComponent) {
8576
8663
  onChange: (newValue) => props.onChange(newValue != null ? newValue : ""),
8577
8664
  value: props.value,
8578
8665
  disabled: props.disabled,
8579
- inputWhenNoVariables: /* @__PURE__ */ jsx82(WrappedComponent, { ...props })
8666
+ inputWhenNoVariables: noSwapping ? void 0 : /* @__PURE__ */ jsx82(WrappedComponent, { ...props })
8580
8667
  }
8581
8668
  );
8582
8669
  };
@@ -8606,7 +8693,7 @@ var bindableFiltersMapper = {
8606
8693
  multiChoice: withInputVariablesForMultiValue(FilterMultiChoiceEditor),
8607
8694
  singleChoice: withInputVariables(FilterSingleChoiceEditor),
8608
8695
  date: withInputVariables(DateEditor),
8609
- text: withInputVariables(TextEditor),
8696
+ text: withInputVariables(TextEditor, true),
8610
8697
  number: withInputVariables(NumberEditor)
8611
8698
  };
8612
8699
 
@@ -8638,6 +8725,7 @@ var SearchAndFilterProvider = ({
8638
8725
  filters,
8639
8726
  filterOptions,
8640
8727
  filterVisible = false,
8728
+ alwaysVisible = false,
8641
8729
  defaultSearchTerm = "",
8642
8730
  onSearchChange,
8643
8731
  onChange,
@@ -8649,7 +8737,7 @@ var SearchAndFilterProvider = ({
8649
8737
  }) => {
8650
8738
  const [searchTerm, setSearchTerm] = useState24(defaultSearchTerm);
8651
8739
  const deferredSearchTerm = useDeferredValue2(searchTerm);
8652
- const [filterVisibility, setFilterVisibility] = useState24(filterVisible);
8740
+ const [filterVisibility, setFilterVisibility] = useState24(alwaysVisible || filterVisible);
8653
8741
  const handleSearchTerm = useCallback6(
8654
8742
  (term) => {
8655
8743
  setSearchTerm(term);
@@ -8658,8 +8746,13 @@ var SearchAndFilterProvider = ({
8658
8746
  [setSearchTerm, onSearchChange]
8659
8747
  );
8660
8748
  const handleToggleFilterVisibility = useCallback6(
8661
- (visible) => setFilterVisibility(visible),
8662
- [setFilterVisibility]
8749
+ (visible) => {
8750
+ if (alwaysVisible) {
8751
+ return;
8752
+ }
8753
+ setFilterVisibility(visible);
8754
+ },
8755
+ [alwaysVisible]
8663
8756
  );
8664
8757
  const handleAddFilter = useCallback6(() => {
8665
8758
  onChange([...filters, { field: "", operator: "", value: "" }]);
@@ -8685,7 +8778,7 @@ var SearchAndFilterProvider = ({
8685
8778
  if (filterVisibility) {
8686
8779
  const handleEscKeyFilterClose = (e) => {
8687
8780
  if (e.key === "Escape") {
8688
- setFilterVisibility(false);
8781
+ handleToggleFilterVisibility(false);
8689
8782
  }
8690
8783
  };
8691
8784
  document.addEventListener("keydown", (e) => handleEscKeyFilterClose(e));
@@ -8693,7 +8786,7 @@ var SearchAndFilterProvider = ({
8693
8786
  document.removeEventListener("keydown", (e) => handleEscKeyFilterClose(e));
8694
8787
  };
8695
8788
  }
8696
- }, [filterVisibility]);
8789
+ }, [filterVisibility, handleToggleFilterVisibility]);
8697
8790
  return /* @__PURE__ */ jsx83(
8698
8791
  SearchAndFilterContext.Provider,
8699
8792
  {
@@ -8736,8 +8829,8 @@ var FilterControls = ({
8736
8829
  searchTerm,
8737
8830
  allowBindingSearchTerm
8738
8831
  } = useSearchAndFilter();
8739
- const editorRef = useRef16(null);
8740
- const hasVariableInSearchTerm = hasReferencedVariables(searchTerm);
8832
+ const editorRef = useRef15(null);
8833
+ const variableRefernceCountInSearchTerm = hasReferencedVariables3(searchTerm);
8741
8834
  const [idToResetInputVariables, setIdToResetInputVariables] = useState25("data-resource-search-term-input");
8742
8835
  const [localeSearchTerm, setLocaleSearchTerm] = useState25(searchTerm);
8743
8836
  useDebounce9(
@@ -8791,7 +8884,7 @@ var FilterControls = ({
8791
8884
  )
8792
8885
  }
8793
8886
  ),
8794
- hasVariableInSearchTerm ? /* @__PURE__ */ jsx84("div", { css: ClearSearchButtonContainer, children: /* @__PURE__ */ jsx84(
8887
+ variableRefernceCountInSearchTerm ? /* @__PURE__ */ jsx84("div", { css: ClearSearchButtonContainer, children: /* @__PURE__ */ jsx84(
8795
8888
  "button",
8796
8889
  {
8797
8890
  css: ClearSearchButtonStyles,
@@ -8814,89 +8907,28 @@ var FilterControls = ({
8814
8907
  };
8815
8908
 
8816
8909
  // src/components/SearchAndFilter/FilterItem.tsx
8910
+ import { CgTrash as CgTrash2 } from "@react-icons/all-files/cg/CgTrash";
8817
8911
  import { Icon as Icon8, InputComboBox as InputComboBox5 } from "@uniformdev/design-system";
8818
8912
  import { useMemo as useMemo23 } from "react";
8819
8913
 
8820
- // src/components/SearchAndFilter/FilterMenu.tsx
8821
- import { HorizontalRhythm as HorizontalRhythm8, VerticalRhythm as VerticalRhythm6 } from "@uniformdev/design-system";
8822
- import React13, { useEffect as useEffect23 } from "react";
8823
- import { jsx as jsx85, jsxs as jsxs46 } from "@emotion/react/jsx-runtime";
8824
- var SearchAndFilterOptionsContainer2 = ({
8825
- buttonRow,
8826
- additionalFiltersContainer,
8827
- children
8828
- }) => {
8829
- return /* @__PURE__ */ jsxs46("div", { css: SearchAndFilterOptionsContainer, children: [
8830
- /* @__PURE__ */ jsx85("div", { css: SearchAndFilterOptionsInnerContainer, children }),
8831
- buttonRow ? /* @__PURE__ */ jsx85(
8832
- HorizontalRhythm8,
8833
- {
8834
- css: SearchAndFilterButtonGroup,
8835
- gap: "sm",
8836
- align: "center",
8837
- justify: "space-between",
8838
- children: buttonRow
8839
- }
8840
- ) : null,
8841
- additionalFiltersContainer ? /* @__PURE__ */ jsx85("div", { children: additionalFiltersContainer }) : null
8842
- ] });
8843
- };
8844
- var FilterMenu = ({
8845
- id,
8846
- filterTitle = "Show results",
8847
- menuControls,
8848
- additionalFiltersContainer,
8849
- children,
8850
- dataTestId,
8851
- resetButtonText = "reset"
8852
- }) => {
8853
- const { filterVisibility, setFilterVisibility, handleResetFilters, filters } = useSearchAndFilter();
8854
- const innerMenuRef = React13.useRef(null);
8855
- useEffect23(() => {
8856
- var _a;
8857
- if (filterVisibility) {
8858
- (_a = innerMenuRef.current) == null ? void 0 : _a.focus();
8859
- }
8860
- }, [filterVisibility]);
8861
- return /* @__PURE__ */ jsx85(VerticalRhythm6, { gap: "sm", "aria-haspopup": "true", id, "data-testid": dataTestId, children: filterVisibility ? /* @__PURE__ */ jsxs46(
8862
- SearchAndFilterOptionsContainer2,
8863
- {
8864
- buttonRow: menuControls,
8865
- additionalFiltersContainer,
8866
- children: [
8867
- /* @__PURE__ */ jsxs46(HorizontalRhythm8, { gap: "sm", align: "center", justify: "space-between", children: [
8868
- filterTitle ? /* @__PURE__ */ jsx85("span", { css: Title, ref: innerMenuRef, tabIndex: 0, children: filterTitle }) : null,
8869
- (filters == null ? void 0 : filters.length) && resetButtonText ? /* @__PURE__ */ jsx85(
8870
- "button",
8871
- {
8872
- type: "button",
8873
- css: ResetConditionsBtn,
8874
- onClick: () => {
8875
- handleResetFilters();
8876
- setFilterVisibility(false);
8877
- },
8878
- "data-testid": "reset-filters",
8879
- children: resetButtonText
8880
- }
8881
- ) : null
8882
- ] }),
8883
- children
8884
- ]
8885
- }
8886
- ) : null });
8887
- };
8914
+ // src/components/SearchAndFilter/util/isFilterBindable.ts
8915
+ function isFilterBindable(filter, operator) {
8916
+ var _a, _b;
8917
+ return (_b = (_a = operator == null ? void 0 : operator.bindable) != null ? _a : filter == null ? void 0 : filter.bindable) != null ? _b : false;
8918
+ }
8888
8919
 
8889
8920
  // src/components/SearchAndFilter/FilterItem.tsx
8890
- import { jsx as jsx86, jsxs as jsxs47 } from "@emotion/react/jsx-runtime";
8921
+ import { jsx as jsx85, jsxs as jsxs46 } from "@emotion/react/jsx-runtime";
8891
8922
  var FilterItem = ({
8892
8923
  index,
8893
- paramOptions,
8894
8924
  operatorOptions,
8895
8925
  valueOptions,
8896
- onParamChange,
8926
+ onFilterOptionChange,
8927
+ onFilterDynamicChange,
8897
8928
  onOperatorChange,
8898
8929
  onValueChange,
8899
- initialCriteriaTitle = "Where"
8930
+ initialCriteriaTitle = "Where",
8931
+ criteriaGroupOperator = "and"
8900
8932
  }) => {
8901
8933
  var _a, _b;
8902
8934
  const { filters, handleDeleteFilter, filterOptions } = useSearchAndFilter();
@@ -8906,23 +8938,24 @@ var FilterItem = ({
8906
8938
  const metaDataPossibleOptions = (_b = (_a = operatorOptions.find((op) => filters[index].operator === op.value)) == null ? void 0 : _a.editorType) != null ? _b : "singleChoice";
8907
8939
  const { selectedFieldValue, selectedOperatorValue, selectedMetaValue, readOnly, bindable } = useMemo23(() => {
8908
8940
  var _a2;
8909
- const currentSelectedFilter = filterOptions.find((item) => {
8941
+ const currentSelectedFilterGroup = filterOptions.find((item) => {
8910
8942
  var _a3;
8911
8943
  return (_a3 = item.options) == null ? void 0 : _a3.find((op) => op.value === filters[index].field);
8912
8944
  });
8913
- const selectedFieldValue2 = (_a2 = currentSelectedFilter == null ? void 0 : currentSelectedFilter.options) == null ? void 0 : _a2.find((item) => {
8945
+ const selectedFilterOption = (_a2 = currentSelectedFilterGroup == null ? void 0 : currentSelectedFilterGroup.options) == null ? void 0 : _a2.find((item) => {
8914
8946
  return filters[index].field === item.value;
8915
8947
  });
8916
- const isCurrentFieldReadOnly = selectedFieldValue2 == null ? void 0 : selectedFieldValue2.readOnly;
8948
+ const isCurrentFieldReadOnly = selectedFilterOption == null ? void 0 : selectedFilterOption.readOnly;
8917
8949
  const selectedOperatorValue2 = operatorOptions == null ? void 0 : operatorOptions.find((item) => {
8918
8950
  return filters[index].operator === item.value;
8919
8951
  });
8952
+ const bindable2 = isFilterBindable(selectedFilterOption, selectedOperatorValue2);
8920
8953
  return {
8921
- selectedFieldValue: selectedFieldValue2,
8954
+ selectedFieldValue: selectedFilterOption,
8922
8955
  selectedOperatorValue: selectedOperatorValue2 != null ? selectedOperatorValue2 : void 0,
8923
8956
  selectedMetaValue: filters[index].value,
8924
8957
  readOnly: isCurrentFieldReadOnly,
8925
- bindable: selectedFieldValue2 == null ? void 0 : selectedFieldValue2.bindable
8958
+ bindable: bindable2
8926
8959
  };
8927
8960
  }, [filters, filterOptions, index, operatorOptions]);
8928
8961
  const readOnlyProps = readOnly ? {
@@ -8931,17 +8964,29 @@ var FilterItem = ({
8931
8964
  menuIsOpen: false,
8932
8965
  isClearable: false
8933
8966
  } : {};
8934
- return /* @__PURE__ */ jsxs47("div", { css: ConditionalFilterRow, "data-testid": "filter-item", children: [
8935
- /* @__PURE__ */ jsx86("span", { children: index === 0 ? initialCriteriaTitle : "and" }),
8936
- /* @__PURE__ */ jsxs47("div", { css: ConditionalInputRow, children: [
8937
- /* @__PURE__ */ jsx86(
8967
+ const CustomLeftHandComponent = selectedFieldValue == null ? void 0 : selectedFieldValue.leftHandSideComponentWhenSelected;
8968
+ const isEmptyOperator = metaDataPossibleOptions === "empty";
8969
+ return /* @__PURE__ */ jsxs46("div", { css: ConditionalFilterRow, "data-testid": "filter-item", children: [
8970
+ /* @__PURE__ */ jsx85("span", { children: index === 0 ? initialCriteriaTitle : criteriaGroupOperator }),
8971
+ /* @__PURE__ */ jsxs46("div", { css: [ConditionalInputRow, isEmptyOperator ? ConditionalInputRowEmpty : null], children: [
8972
+ CustomLeftHandComponent ? /* @__PURE__ */ jsx85(
8973
+ CustomLeftHandComponent,
8974
+ {
8975
+ filterOption: selectedFieldValue,
8976
+ filter: filters[index],
8977
+ setFilterDynamicValue: onFilterDynamicChange,
8978
+ deselectFilterOption: () => {
8979
+ onFilterOptionChange("");
8980
+ }
8981
+ }
8982
+ ) : /* @__PURE__ */ jsx85(
8938
8983
  InputComboBox5,
8939
8984
  {
8940
8985
  "aria-label": label,
8941
- options: paramOptions,
8986
+ options: filterOptions,
8942
8987
  onChange: (e) => {
8943
8988
  var _a2;
8944
- onParamChange((_a2 = e == null ? void 0 : e.value) != null ? _a2 : "");
8989
+ onFilterOptionChange((_a2 = e == null ? void 0 : e.value) != null ? _a2 : "");
8945
8990
  },
8946
8991
  isOptionDisabled: (option) => {
8947
8992
  var _a2;
@@ -8961,7 +9006,7 @@ var FilterItem = ({
8961
9006
  name: `filter-field-${index}`
8962
9007
  }
8963
9008
  ),
8964
- /* @__PURE__ */ jsx86(
9009
+ /* @__PURE__ */ jsx85(
8965
9010
  InputComboBox5,
8966
9011
  {
8967
9012
  "aria-label": operatorLabel,
@@ -8985,7 +9030,7 @@ var FilterItem = ({
8985
9030
  name: `filter-operator-${index}`
8986
9031
  }
8987
9032
  ),
8988
- /* @__PURE__ */ jsx86(
9033
+ /* @__PURE__ */ jsx85(
8989
9034
  FilterEditorRenderer,
8990
9035
  {
8991
9036
  "aria-label": metaDataLabel,
@@ -8999,7 +9044,7 @@ var FilterItem = ({
8999
9044
  valueTestId: "filter-value"
9000
9045
  }
9001
9046
  ),
9002
- readOnly ? null : /* @__PURE__ */ jsx86(
9047
+ readOnly ? null : /* @__PURE__ */ jsx85(
9003
9048
  "button",
9004
9049
  {
9005
9050
  type: "button",
@@ -9008,35 +9053,185 @@ var FilterItem = ({
9008
9053
  css: IconBtn,
9009
9054
  "data-testid": "delete-filter",
9010
9055
  disabled: filters.length === 1,
9011
- children: /* @__PURE__ */ jsx86(Icon8, { icon: "trash", iconColor: filters.length === 1 ? "gray" : "red", size: "1rem" })
9056
+ children: /* @__PURE__ */ jsx85(Icon8, { icon: CgTrash2, iconColor: filters.length === 1 ? "gray" : "red", size: "1rem" })
9012
9057
  }
9013
9058
  )
9014
9059
  ] })
9015
9060
  ] });
9016
9061
  };
9017
- var singleValuedOperators = /* @__PURE__ */ new Set([
9018
- "eq",
9019
- "neq",
9020
- "lt",
9021
- "gt",
9022
- "is",
9023
- "!is",
9024
- "has",
9025
- "!has",
9026
- "startswith",
9027
- "!startswith",
9028
- "endswith",
9029
- "!endswith"
9030
- ]);
9031
- var arrayValuedOperators = /* @__PURE__ */ new Set(["in", "nin", "is$", "!is$"]);
9032
- var clearValueOnChangeAwayFromOperators = /* @__PURE__ */ new Set(["def", "ndef", "empty", "!empty", "between"]);
9033
- var noValueOperators = /* @__PURE__ */ new Set(["empty", "!empty"]);
9062
+
9063
+ // src/components/SearchAndFilter/FilterItems.tsx
9064
+ import { CgMathPlus } from "@react-icons/all-files/cg/CgMathPlus";
9065
+ import { Icon as Icon9 } from "@uniformdev/design-system";
9066
+
9067
+ // src/components/SearchAndFilter/FilterMenu.tsx
9068
+ import { HorizontalRhythm as HorizontalRhythm8, VerticalRhythm as VerticalRhythm6 } from "@uniformdev/design-system";
9069
+ import React13, { useEffect as useEffect23 } from "react";
9070
+ import { jsx as jsx86, jsxs as jsxs47 } from "@emotion/react/jsx-runtime";
9071
+ var SearchAndFilterOptionsContainer2 = ({
9072
+ buttonRow,
9073
+ additionalFiltersContainer,
9074
+ children
9075
+ }) => {
9076
+ return /* @__PURE__ */ jsxs47("div", { css: SearchAndFilterOptionsContainer, children: [
9077
+ /* @__PURE__ */ jsx86("div", { css: SearchAndFilterOptionsInnerContainer, children }),
9078
+ buttonRow ? /* @__PURE__ */ jsx86(
9079
+ HorizontalRhythm8,
9080
+ {
9081
+ css: SearchAndFilterButtonGroup,
9082
+ gap: "sm",
9083
+ align: "center",
9084
+ justify: "space-between",
9085
+ children: buttonRow
9086
+ }
9087
+ ) : null,
9088
+ additionalFiltersContainer ? /* @__PURE__ */ jsx86("div", { children: additionalFiltersContainer }) : null
9089
+ ] });
9090
+ };
9091
+ var FilterMenu = ({
9092
+ id,
9093
+ filterTitle = "Show results",
9094
+ menuControls,
9095
+ additionalFiltersContainer,
9096
+ children,
9097
+ dataTestId,
9098
+ resetButtonText = "reset"
9099
+ }) => {
9100
+ const { filterVisibility, setFilterVisibility, handleResetFilters, filters } = useSearchAndFilter();
9101
+ const innerMenuRef = React13.useRef(null);
9102
+ useEffect23(() => {
9103
+ var _a;
9104
+ if (filterVisibility) {
9105
+ (_a = innerMenuRef.current) == null ? void 0 : _a.focus();
9106
+ }
9107
+ }, [filterVisibility]);
9108
+ return /* @__PURE__ */ jsx86(VerticalRhythm6, { gap: "sm", "aria-haspopup": "true", id, "data-testid": dataTestId, children: filterVisibility ? /* @__PURE__ */ jsxs47(
9109
+ SearchAndFilterOptionsContainer2,
9110
+ {
9111
+ buttonRow: menuControls,
9112
+ additionalFiltersContainer,
9113
+ children: [
9114
+ /* @__PURE__ */ jsxs47(HorizontalRhythm8, { gap: "sm", align: "center", justify: "space-between", children: [
9115
+ filterTitle ? /* @__PURE__ */ jsx86("span", { css: Title, ref: innerMenuRef, tabIndex: 0, children: filterTitle }) : null,
9116
+ (filters == null ? void 0 : filters.length) && resetButtonText ? /* @__PURE__ */ jsx86(
9117
+ "button",
9118
+ {
9119
+ type: "button",
9120
+ css: ResetConditionsBtn,
9121
+ disabled: filters.every((f) => !f.field),
9122
+ onClick: () => {
9123
+ handleResetFilters();
9124
+ setFilterVisibility(false);
9125
+ },
9126
+ "data-testid": "reset-filters",
9127
+ children: resetButtonText
9128
+ }
9129
+ ) : null
9130
+ ] }),
9131
+ children
9132
+ ]
9133
+ }
9134
+ ) : null });
9135
+ };
9136
+
9137
+ // src/components/SearchAndFilter/util/getNewFilterValueAfterOperatorChange.ts
9138
+ import { hasReferencedVariables as hasReferencedVariables4 } from "@uniformdev/canvas";
9139
+ function getNewFilterValueAfterOperatorChange({
9140
+ newOperatorId,
9141
+ currentFilter,
9142
+ filterOptions
9143
+ }) {
9144
+ var _a, _b, _c;
9145
+ if (Array.isArray(newOperatorId)) {
9146
+ throw new Error("Operator value must be a single string");
9147
+ }
9148
+ const result = {
9149
+ ...currentFilter,
9150
+ operator: newOperatorId,
9151
+ value: ""
9152
+ };
9153
+ const currentOperatorId = currentFilter.operator;
9154
+ let currentValue = currentFilter.value;
9155
+ const currentFieldDefinition = filterOptions.flatMap((group) => {
9156
+ var _a2;
9157
+ return (_a2 = group.options) != null ? _a2 : [];
9158
+ }).find((filter) => filter.value === currentFilter.field);
9159
+ const currentOperator = (_a = currentFieldDefinition == null ? void 0 : currentFieldDefinition.operatorOptions) == null ? void 0 : _a.find(
9160
+ (op) => op.value === currentOperatorId
9161
+ );
9162
+ const newOperator = (_b = currentFieldDefinition == null ? void 0 : currentFieldDefinition.operatorOptions) == null ? void 0 : _b.find((op) => op.value === newOperatorId);
9163
+ if (!currentOperator || !newOperator) {
9164
+ result.value = "";
9165
+ return result;
9166
+ } else {
9167
+ const currentOperatorValueType = currentOperator.expectedValueType;
9168
+ const newOperatorValueType = newOperator.expectedValueType;
9169
+ if (!isFilterBindable(currentFieldDefinition, newOperator) && hasBindings(currentValue)) {
9170
+ currentValue = "";
9171
+ }
9172
+ if (isHardcodedOperatorValue(currentOperatorValueType)) {
9173
+ result.value = isHardcodedOperatorValue(newOperatorValueType) ? newOperatorValueType : "";
9174
+ return result;
9175
+ }
9176
+ switch (newOperatorValueType) {
9177
+ case "single":
9178
+ if (Array.isArray(currentValue)) {
9179
+ if (currentOperatorValueType === "between") {
9180
+ result.value = "";
9181
+ } else {
9182
+ result.value = (_c = currentValue[0]) != null ? _c : "";
9183
+ }
9184
+ } else {
9185
+ result.value = currentValue;
9186
+ }
9187
+ return result;
9188
+ case "array":
9189
+ if (currentOperatorValueType === "between") {
9190
+ result.value = "";
9191
+ } else if (Array.isArray(currentValue)) {
9192
+ result.value = currentValue;
9193
+ } else {
9194
+ result.value = currentValue ? [currentValue] : [];
9195
+ }
9196
+ return result;
9197
+ case "between":
9198
+ if (Array.isArray(currentValue)) {
9199
+ result.value = "";
9200
+ } else {
9201
+ result.value = [currentValue, ""];
9202
+ }
9203
+ return result;
9204
+ case "none":
9205
+ result.value = "";
9206
+ return result;
9207
+ default:
9208
+ result.value = newOperatorValueType;
9209
+ return result;
9210
+ }
9211
+ }
9212
+ }
9213
+ function isHardcodedOperatorValue(valueType) {
9214
+ return valueType !== void 0 && valueType !== "array" && valueType !== "between" && valueType !== "none" && valueType !== "single";
9215
+ }
9216
+ function hasBindings(currentValue) {
9217
+ if (currentValue === void 0) {
9218
+ return false;
9219
+ }
9220
+ if (Array.isArray(currentValue)) {
9221
+ return currentValue.some((value) => hasReferencedVariables4(value));
9222
+ }
9223
+ return hasReferencedVariables4(currentValue) > 0;
9224
+ }
9225
+
9226
+ // src/components/SearchAndFilter/FilterItems.tsx
9227
+ import { jsx as jsx87, jsxs as jsxs48 } from "@emotion/react/jsx-runtime";
9034
9228
  var FilterItems = ({
9035
9229
  addButtonText = "add condition",
9036
9230
  additionalFiltersContainer,
9037
9231
  filterTitle,
9038
9232
  resetButtonText,
9039
- initialCriteriaTitle
9233
+ initialCriteriaTitle,
9234
+ criteriaGroupOperator
9040
9235
  }) => {
9041
9236
  const { filterOptions, filters, setFilters, handleAddFilter } = useSearchAndFilter();
9042
9237
  const handleUpdateFilter = (index, prop, value) => {
@@ -9044,32 +9239,16 @@ var FilterItems = ({
9044
9239
  const next = [...filters];
9045
9240
  next[index] = { ...next[index], [prop]: value };
9046
9241
  if (prop === "operator") {
9047
- const newOperator = value;
9048
- const currentValue = next[index].value;
9049
- if (Array.isArray(newOperator)) {
9050
- throw new Error("Operator value must be a single string");
9051
- }
9052
- if (singleValuedOperators.has(newOperator) && Array.isArray(currentValue)) {
9053
- next[index].value = next[index].value[0];
9054
- }
9055
- if (arrayValuedOperators.has(newOperator) && Array.isArray(currentValue) === false) {
9056
- next[index].value = currentValue ? [currentValue] : [];
9057
- }
9058
- if (clearValueOnChangeAwayFromOperators.has(filters[index].operator)) {
9059
- next[index].value = "";
9060
- }
9061
- if (noValueOperators.has(newOperator)) {
9062
- next[index].value = "";
9063
- }
9064
- if (newOperator === "between" && Array.isArray(currentValue) === false) {
9065
- next[index].value = [currentValue, ""];
9066
- }
9067
- if (value === "def" || value === "true") {
9068
- next[index].value = "true";
9069
- }
9070
- if (value === "ndef" || value === "false") {
9071
- next[index].value = "false";
9242
+ const newOperatorId = value;
9243
+ const currentFilter = next[index];
9244
+ if (!newOperatorId) {
9245
+ throw new Error("you bad");
9072
9246
  }
9247
+ next[index] = getNewFilterValueAfterOperatorChange({
9248
+ newOperatorId,
9249
+ currentFilter,
9250
+ filterOptions
9251
+ });
9073
9252
  }
9074
9253
  if (prop === "field") {
9075
9254
  const firstOperatorInAvailableOperators = (_e = (_d = (_c = (_b = (_a = filterOptions.find((fo) => {
@@ -9078,15 +9257,16 @@ var FilterItems = ({
9078
9257
  })) == 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";
9079
9258
  next[index].operator = firstOperatorInAvailableOperators;
9080
9259
  next[index].value = "";
9260
+ next[index].dynamicField = void 0;
9081
9261
  }
9082
9262
  setFilters(next);
9083
9263
  };
9084
- return /* @__PURE__ */ jsx86(
9264
+ return /* @__PURE__ */ jsx87(
9085
9265
  FilterMenu,
9086
9266
  {
9087
9267
  id: "search-and-filter-options",
9088
9268
  dataTestId: "search-and-filter-options",
9089
- menuControls: /* @__PURE__ */ jsxs47(
9269
+ menuControls: /* @__PURE__ */ jsxs48(
9090
9270
  "button",
9091
9271
  {
9092
9272
  type: "button",
@@ -9094,7 +9274,7 @@ var FilterItems = ({
9094
9274
  onClick: handleAddFilter,
9095
9275
  "data-testid": "add-filter",
9096
9276
  children: [
9097
- /* @__PURE__ */ jsx86(Icon8, { icon: "math-plus", iconColor: "currentColor", size: "1rem" }),
9277
+ /* @__PURE__ */ jsx87(Icon9, { icon: CgMathPlus, iconColor: "currentColor", size: "1rem" }),
9098
9278
  addButtonText
9099
9279
  ]
9100
9280
  }
@@ -9110,17 +9290,18 @@ var FilterItems = ({
9110
9290
  })) == null ? void 0 : _a.options) != null ? _b : [];
9111
9291
  const possibleValueOptions = (_d = (_c = availableTypeOptions == null ? void 0 : availableTypeOptions.find((op) => op.value === item.field)) == null ? void 0 : _c.valueOptions) != null ? _d : [];
9112
9292
  const possibleOperators = (_f = (_e = availableTypeOptions == null ? void 0 : availableTypeOptions.find((op) => op.value === item.field)) == null ? void 0 : _e.operatorOptions) != null ? _f : [];
9113
- return /* @__PURE__ */ jsx86(
9293
+ return /* @__PURE__ */ jsx87(
9114
9294
  FilterItem,
9115
9295
  {
9116
9296
  index: i,
9117
- paramOptions: filterOptions,
9118
- onParamChange: (e) => handleUpdateFilter(i, "field", e),
9297
+ onFilterOptionChange: (e) => handleUpdateFilter(i, "field", e),
9119
9298
  operatorOptions: possibleOperators,
9120
9299
  onOperatorChange: (e) => handleUpdateFilter(i, "operator", e),
9121
9300
  onValueChange: (e) => handleUpdateFilter(i, "value", e),
9301
+ onFilterDynamicChange: (e) => handleUpdateFilter(i, "dynamicField", e),
9122
9302
  valueOptions: possibleValueOptions,
9123
- initialCriteriaTitle
9303
+ initialCriteriaTitle,
9304
+ criteriaGroupOperator
9124
9305
  },
9125
9306
  i
9126
9307
  );
@@ -9134,7 +9315,7 @@ import { VerticalRhythm as VerticalRhythm7 } from "@uniformdev/design-system";
9134
9315
 
9135
9316
  // src/components/SearchAndFilter/SearchAndFilterResultContainer.tsx
9136
9317
  import { Button as Button6, Callout as Callout6, HorizontalRhythm as HorizontalRhythm9, Paragraph } from "@uniformdev/design-system";
9137
- import { Fragment as Fragment17, jsx as jsx87, jsxs as jsxs48 } from "@emotion/react/jsx-runtime";
9318
+ import { Fragment as Fragment17, jsx as jsx88, jsxs as jsxs49 } from "@emotion/react/jsx-runtime";
9138
9319
  var SearchAndFilterResultContainer = ({
9139
9320
  buttonText,
9140
9321
  clearButtonLabel = "clear",
@@ -9164,18 +9345,18 @@ var SearchAndFilterResultContainer = ({
9164
9345
  handleResetFilters();
9165
9346
  }
9166
9347
  };
9167
- return /* @__PURE__ */ jsxs48(Fragment17, { children: [
9168
- /* @__PURE__ */ jsxs48(HorizontalRhythm9, { children: [
9169
- /* @__PURE__ */ jsxs48("span", { children: [
9348
+ return /* @__PURE__ */ jsxs49(Fragment17, { children: [
9349
+ /* @__PURE__ */ jsxs49(HorizontalRhythm9, { children: [
9350
+ /* @__PURE__ */ jsxs49("span", { children: [
9170
9351
  totalResults,
9171
9352
  " results ",
9172
9353
  searchTerm ? `for "${searchTerm}"` : null
9173
9354
  ] }),
9174
- !searchTerm || hideClearButton ? null : /* @__PURE__ */ jsx87(Button6, { buttonType: "ghostDestructive", size: "zero", onClick: handleClearSearch, children: clearButtonLabel })
9355
+ !searchTerm || hideClearButton ? null : /* @__PURE__ */ jsx88(Button6, { buttonType: "ghostDestructive", size: "zero", onClick: handleClearSearch, children: clearButtonLabel })
9175
9356
  ] }),
9176
- totalResults === 0 ? /* @__PURE__ */ jsxs48(Callout6, { title: calloutTitle != null ? calloutTitle : automateCalloutTitle(), type: "note", children: [
9177
- calloutText ? /* @__PURE__ */ jsx87(Paragraph, { children: calloutText }) : null,
9178
- hideClearButton ? null : /* @__PURE__ */ jsx87(
9357
+ totalResults === 0 ? /* @__PURE__ */ jsxs49(Callout6, { title: calloutTitle != null ? calloutTitle : automateCalloutTitle(), type: "note", children: [
9358
+ calloutText ? /* @__PURE__ */ jsx88(Paragraph, { children: calloutText }) : null,
9359
+ hideClearButton ? null : /* @__PURE__ */ jsx88(
9179
9360
  Button6,
9180
9361
  {
9181
9362
  buttonType: "tertiaryOutline",
@@ -9190,14 +9371,14 @@ var SearchAndFilterResultContainer = ({
9190
9371
  };
9191
9372
 
9192
9373
  // src/components/SearchAndFilter/SearchAndFilter.tsx
9193
- import { jsx as jsx88, jsxs as jsxs49 } from "@emotion/react/jsx-runtime";
9374
+ import { jsx as jsx89, jsxs as jsxs50 } from "@emotion/react/jsx-runtime";
9194
9375
  var SearchAndFilter = ({
9195
9376
  filters,
9196
9377
  filterOptions,
9197
9378
  filterVisible,
9198
9379
  filterControls,
9199
9380
  viewSwitchControls,
9200
- resultsContainerView = /* @__PURE__ */ jsx88(SearchAndFilterResultContainer, {}),
9381
+ resultsContainerView = /* @__PURE__ */ jsx89(SearchAndFilterResultContainer, {}),
9201
9382
  filterMapper: filterMapper2 = filterMapper,
9202
9383
  additionalFiltersContainer,
9203
9384
  onChange,
@@ -9207,7 +9388,7 @@ var SearchAndFilter = ({
9207
9388
  allowBindingSearchTerm = false,
9208
9389
  resetFilterValues = []
9209
9390
  }) => {
9210
- return /* @__PURE__ */ jsx88(
9391
+ return /* @__PURE__ */ jsx89(
9211
9392
  SearchAndFilterProvider,
9212
9393
  {
9213
9394
  filters,
@@ -9220,18 +9401,18 @@ var SearchAndFilter = ({
9220
9401
  resetFilterValues,
9221
9402
  filterMapper: filterMapper2,
9222
9403
  allowBindingSearchTerm,
9223
- children: /* @__PURE__ */ jsxs49(VerticalRhythm7, { "data-testid": "search-and-filter", children: [
9224
- /* @__PURE__ */ jsxs49("div", { css: SearchAndFilterOutterControlWrapper(viewSwitchControls ? "1fr auto" : "1fr"), children: [
9225
- /* @__PURE__ */ jsx88(
9404
+ children: /* @__PURE__ */ jsxs50(VerticalRhythm7, { "data-testid": "search-and-filter", children: [
9405
+ /* @__PURE__ */ jsxs50("div", { css: SearchAndFilterOutterControlWrapper(viewSwitchControls ? "1fr auto" : "1fr"), children: [
9406
+ /* @__PURE__ */ jsx89(
9226
9407
  "div",
9227
9408
  {
9228
9409
  css: SearchAndFilterControlsWrapper(viewSwitchControls ? "auto 1fr 0.05fr" : "auto 1fr"),
9229
- children: !filterControls ? /* @__PURE__ */ jsx88(FilterControls, { hideSearchInput: !onSearchChange }) : filterControls
9410
+ children: !filterControls ? /* @__PURE__ */ jsx89(FilterControls, { hideSearchInput: !onSearchChange }) : filterControls
9230
9411
  }
9231
9412
  ),
9232
9413
  viewSwitchControls
9233
9414
  ] }),
9234
- /* @__PURE__ */ jsx88(FilterItems, { additionalFiltersContainer }),
9415
+ /* @__PURE__ */ jsx89(FilterItems, { additionalFiltersContainer }),
9235
9416
  resultsContainerView
9236
9417
  ] })
9237
9418
  }
@@ -9242,7 +9423,7 @@ var SearchAndFilter = ({
9242
9423
  import { InputKeywordSearch as InputKeywordSearch3 } from "@uniformdev/design-system";
9243
9424
  import { createContext as createContext7, useState as useState26 } from "react";
9244
9425
  import { useDebounce as useDebounce10 } from "react-use";
9245
- import { jsx as jsx89 } from "@emotion/react/jsx-runtime";
9426
+ import { jsx as jsx90 } from "@emotion/react/jsx-runtime";
9246
9427
  var SearchOnlyContext = createContext7({
9247
9428
  searchTerm: "",
9248
9429
  setSearchTerm: () => {
@@ -9259,14 +9440,14 @@ var SearchOnlyFilter = ({ onSearchChange, maxWidth }) => {
9259
9440
  300,
9260
9441
  [localeSearchTerm]
9261
9442
  );
9262
- return /* @__PURE__ */ jsx89(
9443
+ return /* @__PURE__ */ jsx90(
9263
9444
  SearchOnlyContext.Provider,
9264
9445
  {
9265
9446
  value: {
9266
9447
  searchTerm,
9267
9448
  setSearchTerm: setLocaleSearchTerm
9268
9449
  },
9269
- children: /* @__PURE__ */ jsx89("div", { css: { maxWidth: maxWidth != null ? maxWidth : "712px" }, children: /* @__PURE__ */ jsx89(
9450
+ children: /* @__PURE__ */ jsx90("div", { css: { maxWidth: maxWidth != null ? maxWidth : "712px" }, children: /* @__PURE__ */ jsx90(
9270
9451
  InputKeywordSearch3,
9271
9452
  {
9272
9453
  placeholder: "Search...",
@@ -9361,7 +9542,8 @@ var FilterButton3 = css39`
9361
9542
  gap: var(--spacing-sm);
9362
9543
  padding: var(--spacing-sm) var(--spacing-base);
9363
9544
  max-height: 40px;
9364
- transition: color var(--duration-fast) var(--timing-ease-out),
9545
+ transition:
9546
+ color var(--duration-fast) var(--timing-ease-out),
9365
9547
  background-color var(--duration-fast) var(--timing-ease-out),
9366
9548
  border-color var(--duration-fast) var(--timing-ease-out),
9367
9549
  box-shadow var(--duration-fast) var(--timing-ease-out);
@@ -9517,7 +9699,7 @@ var InputVariableWrapper = css39`
9517
9699
  `;
9518
9700
 
9519
9701
  // src/components/SearchAndFilter/SortItems.tsx
9520
- import { jsx as jsx90, jsxs as jsxs50 } from "@emotion/react/jsx-runtime";
9702
+ import { jsx as jsx91, jsxs as jsxs51 } from "@emotion/react/jsx-runtime";
9521
9703
  var SortItems = ({
9522
9704
  sortByLabel = "Sort by",
9523
9705
  localeLabel = "Show locale",
@@ -9539,11 +9721,11 @@ var SortItems = ({
9539
9721
  return (_a2 = item.options) == null ? void 0 : _a2.find((option) => option.value === sortField);
9540
9722
  })) == null ? void 0 : _a.options) == null ? void 0 : _b.find((nestedOption) => nestedOption.value === sortField);
9541
9723
  const localeLabelValue = sortOptions.length > 1 ? localeLabel : `${localeLabel}s`;
9542
- return /* @__PURE__ */ jsxs50("div", { css: [SortFilterWrapper(hideLocaleOptions)], "data-testid": "sorting-options", children: [
9543
- /* @__PURE__ */ jsxs50(VerticalRhythm8, { gap: "xs", children: [
9544
- /* @__PURE__ */ jsx90("span", { css: Title2, children: sortByLabel }),
9545
- /* @__PURE__ */ jsxs50("div", { css: SortFilterInputRow, children: [
9546
- /* @__PURE__ */ jsx90(
9724
+ return /* @__PURE__ */ jsxs51("div", { css: [SortFilterWrapper(hideLocaleOptions)], "data-testid": "sorting-options", children: [
9725
+ /* @__PURE__ */ jsxs51(VerticalRhythm8, { gap: "xs", children: [
9726
+ /* @__PURE__ */ jsx91("span", { css: Title2, children: sortByLabel }),
9727
+ /* @__PURE__ */ jsxs51("div", { css: SortFilterInputRow, children: [
9728
+ /* @__PURE__ */ jsx91(
9547
9729
  InputVariables,
9548
9730
  {
9549
9731
  disableInlineMenu: disableSortBinding,
@@ -9551,7 +9733,7 @@ var SortItems = ({
9551
9733
  value: sortField,
9552
9734
  valueToResetTo: "created_at",
9553
9735
  onChange: (e) => onSortChange(`${e}_${sortDirection}`),
9554
- inputWhenNoVariables: /* @__PURE__ */ jsx90(
9736
+ inputWhenNoVariables: /* @__PURE__ */ jsx91(
9555
9737
  InputComboBox6,
9556
9738
  {
9557
9739
  id: "sort-by-field",
@@ -9574,7 +9756,7 @@ var SortItems = ({
9574
9756
  )
9575
9757
  }
9576
9758
  ),
9577
- /* @__PURE__ */ jsx90(
9759
+ /* @__PURE__ */ jsx91(
9578
9760
  InputVariables,
9579
9761
  {
9580
9762
  disableInlineMenu: disableSortBinding,
@@ -9582,7 +9764,7 @@ var SortItems = ({
9582
9764
  valueToResetTo: "DESC",
9583
9765
  showMenuPosition: disableSortBinding ? void 0 : "inline-right",
9584
9766
  onChange: (e) => onSortChange(`${sortField}_${e}`),
9585
- inputWhenNoVariables: /* @__PURE__ */ jsx90(
9767
+ inputWhenNoVariables: /* @__PURE__ */ jsx91(
9586
9768
  SegmentedControl,
9587
9769
  {
9588
9770
  noCheckmark: true,
@@ -9614,14 +9796,14 @@ var SortItems = ({
9614
9796
  )
9615
9797
  ] })
9616
9798
  ] }),
9617
- hideLocaleOptions ? null : /* @__PURE__ */ jsx90(VerticalRhythm8, { gap: "xs", css: InputVariableWrapper, children: /* @__PURE__ */ jsx90(
9799
+ hideLocaleOptions ? null : /* @__PURE__ */ jsx91(VerticalRhythm8, { gap: "xs", css: InputVariableWrapper, children: /* @__PURE__ */ jsx91(
9618
9800
  InputVariables,
9619
9801
  {
9620
9802
  label: localeLabelValue,
9621
9803
  value: localeValue,
9622
9804
  showMenuPosition: "inline-right",
9623
9805
  onChange: (e) => onLocaleChange(e != null ? e : ""),
9624
- inputWhenNoVariables: /* @__PURE__ */ jsx90(
9806
+ inputWhenNoVariables: /* @__PURE__ */ jsx91(
9625
9807
  InputSelect8,
9626
9808
  {
9627
9809
  name: "localeReturned",
@@ -9652,14 +9834,14 @@ function createLocationValidator(setValue, validate) {
9652
9834
 
9653
9835
  // src/utils/useContentDataResourceLocaleInfo.ts
9654
9836
  import { bindVariables as bindVariables2, createVariableReference as createVariableReference4, LOCALE_DYNAMIC_INPUT_NAME as LOCALE_DYNAMIC_INPUT_NAME2 } from "@uniformdev/canvas";
9655
- import { useEffect as useEffect24, useRef as useRef17 } from "react";
9837
+ import { useEffect as useEffect24, useRef as useRef16 } from "react";
9656
9838
  function useContentDataResourceLocaleInfo({
9657
9839
  locale,
9658
9840
  setLocale,
9659
9841
  dynamicInputs
9660
9842
  }) {
9661
9843
  var _a;
9662
- const setLocaleRef = useRef17(setLocale);
9844
+ const setLocaleRef = useRef16(setLocale);
9663
9845
  setLocaleRef.current = setLocale;
9664
9846
  const { flatVariables } = useVariables();
9665
9847
  const effectiveLocale = locale != null ? locale : dynamicInputs[LOCALE_DYNAMIC_INPUT_NAME2] ? createVariableReference4(LOCALE_DYNAMIC_INPUT_NAME2) : "";
@@ -9720,6 +9902,7 @@ export {
9720
9902
  Callout7 as Callout,
9721
9903
  ControlledValuePlugin,
9722
9904
  DATE_OPERATORS,
9905
+ DATE_TIME_OPERATORS,
9723
9906
  DISCONNECT_VARIABLE_COMMAND,
9724
9907
  DamSelectedItem,
9725
9908
  DataRefreshButton,
@@ -9813,7 +9996,6 @@ export {
9813
9996
  RequestUrlInput,
9814
9997
  ResolvableLoadingValue,
9815
9998
  SELECT_OPERATORS,
9816
- SYSTEM_DATE_OPERATORS,
9817
9999
  SYSTEM_FIELD_OPERATORS,
9818
10000
  ScrollableList2 as ScrollableList,
9819
10001
  ScrollableListItem,
@@ -9875,7 +10057,7 @@ export {
9875
10057
  entrySearchSelectOption,
9876
10058
  entrySearchWrapper,
9877
10059
  filterMapper,
9878
- hasReferencedVariables,
10060
+ hasReferencedVariables2 as hasReferencedVariables,
9879
10061
  prettifyBindExpression,
9880
10062
  productSearchRowActiveIcon,
9881
10063
  productSearchRowCategory,
@@ -9910,6 +10092,7 @@ export {
9910
10092
  selectedItemIcon,
9911
10093
  selectedItemInner,
9912
10094
  selectedItemTitle,
10095
+ serializeVariablesEditorSerializedState,
9913
10096
  serializeVariablesEditorState,
9914
10097
  setVariablesEditorValue,
9915
10098
  urlEncodeRequestParameter,