@uniformdev/mesh-sdk-react 18.35.1-alpha.18 → 18.35.1-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
@@ -50,7 +50,6 @@ __export(src_exports, {
50
50
  InputSelect: () => import_design_system34.InputSelect,
51
51
  InputToggle: () => import_design_system34.InputToggle,
52
52
  InputVariables: () => InputVariables,
53
- KeywordSearchInput: () => import_design_system34.InputKeywordSearch,
54
53
  Label: () => import_design_system34.Label,
55
54
  LinkButton: () => LinkButton,
56
55
  LoadingIndicator: () => import_design_system34.LoadingIndicator,
@@ -106,10 +105,6 @@ __export(src_exports, {
106
105
  TextVariableRenderer: () => TextVariableRenderer,
107
106
  Textarea: () => import_design_system34.Textarea,
108
107
  Theme: () => import_design_system34.Theme,
109
- UniformMeshLocationContext: () => UniformMeshLocationContext,
110
- UniformMeshLocationContextProvider: () => UniformMeshLocationContextProvider,
111
- UniformMeshSdkContext: () => UniformMeshSdkContext,
112
- UniformMeshSdkContextProvider: () => UniformMeshSdkContextProvider,
113
108
  VariableEditor: () => VariableEditor,
114
109
  VariablesList: () => VariablesList,
115
110
  VariablesProvider: () => VariablesProvider,
@@ -178,7 +173,6 @@ __export(src_exports, {
178
173
  selectedItemTitle: () => selectedItemTitle,
179
174
  urlEncodeRequestParameter: () => urlEncodeRequestParameter,
180
175
  urlEncodeRequestUrl: () => urlEncodeRequestUrl,
181
- useInitializeUniformMeshSdk: () => useInitializeUniformMeshSdk,
182
176
  useMeshLocation: () => useMeshLocation,
183
177
  useObjectSearchContext: () => useObjectSearchContext,
184
178
  useParameterShell: () => import_design_system33.useParameterShell,
@@ -187,10 +181,7 @@ __export(src_exports, {
187
181
  useRequest: () => useRequest,
188
182
  useRequestHeader: () => useRequestHeader,
189
183
  useRequestParameter: () => useRequestParameter,
190
- useUniformMeshLocation: () => useUniformMeshLocation,
191
- useUniformMeshLocationContext: () => useUniformMeshLocationContext,
192
184
  useUniformMeshSdk: () => useUniformMeshSdk,
193
- useUniformMeshSdkContext: () => useUniformMeshSdkContext,
194
185
  useVariables: () => useVariables,
195
186
  variablesToList: () => variablesToList
196
187
  });
@@ -1085,7 +1076,7 @@ var ProductPreviewList = ({
1085
1076
  import_design_system3.scrollbarStyles
1086
1077
  ],
1087
1078
  children: products == null ? void 0 : products.map((product, index) => {
1088
- var _a, _b;
1079
+ var _a;
1089
1080
  const [category] = (product == null ? void 0 : product.categories) || [];
1090
1081
  const categoryName = typeof category === "undefined" || !categories ? void 0 : (_a = categories.find((c) => c.id === category.id)) == null ? void 0 : _a.name;
1091
1082
  return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("li", { css: productPreviewListItem, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
@@ -1098,13 +1089,13 @@ var ProductPreviewList = ({
1098
1089
  "img",
1099
1090
  {
1100
1091
  src: product.thumbnailUrl,
1101
- alt: typeof product.title === "string" ? product.title : product.name || `Product ${index}`,
1092
+ alt: typeof product.title === "string" ? product.title : `Product ${index}`,
1102
1093
  css: productPreviewListImage,
1103
1094
  "data-test-id": "product-image"
1104
1095
  }
1105
1096
  ) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { css: productPreviewListImageDefault }),
1106
1097
  /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("h4", { css: productPreviewListTitle, "data-test-id": "product-name", children: [
1107
- product.title || product.name,
1098
+ product.title,
1108
1099
  categoryName && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { css: productPreviewListCategoryText, children: categoryName })
1109
1100
  ] }),
1110
1101
  product && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
@@ -1117,12 +1108,12 @@ var ProductPreviewList = ({
1117
1108
  "Price: ",
1118
1109
  product.price
1119
1110
  ] }) : null,
1120
- product.editLink || product.url ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1111
+ product.editLink ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1121
1112
  "a",
1122
1113
  {
1123
1114
  css: productPreviewListLinkBtn,
1124
- href: (_b = product.editLink) != null ? _b : product.url,
1125
- title: `Go to ${product.title || product.name}`,
1115
+ href: product.editLink,
1116
+ title: `Go to ${product.title}`,
1126
1117
  target: "_blank",
1127
1118
  rel: "noopener noreferrer",
1128
1119
  "data-test-id": "edit-product-button",
@@ -2837,18 +2828,6 @@ var import_design_system13 = require("@uniformdev/design-system");
2837
2828
  var import_react25 = require("react");
2838
2829
  var import_jsx_runtime26 = require("@emotion/react/jsx-runtime");
2839
2830
  var UniformMeshSdkContext = (0, import_react25.createContext)(void 0);
2840
- var UniformMeshSdkContextProvider = ({ children }) => {
2841
- let value = void 0;
2842
- if (typeof window !== "undefined" && typeof window.UniformMeshSDK !== "undefined") {
2843
- value = {
2844
- sdk: window.UniformMeshSDK
2845
- };
2846
- }
2847
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(UniformMeshSdkContext.Provider, { value, children: [
2848
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_design_system13.Theme, {}),
2849
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(UniformMeshLocationContextProvider, { children })
2850
- ] });
2851
- };
2852
2831
  var useUniformMeshSdkContext = () => {
2853
2832
  const context = (0, import_react25.useContext)(UniformMeshSdkContext);
2854
2833
  if (!context) {
@@ -2865,9 +2844,7 @@ function useUniformMeshSdk() {
2865
2844
 
2866
2845
  // src/components/UniformMeshLocationContext.tsx
2867
2846
  var import_jsx_runtime27 = require("@emotion/react/jsx-runtime");
2868
- var UniformMeshLocationContext = (0, import_react26.createContext)(
2869
- void 0
2870
- );
2847
+ var UniformMeshLocationContext = (0, import_react26.createContext)(void 0);
2871
2848
  var UniformMeshLocationContextProvider = ({
2872
2849
  children
2873
2850
  }) => {
@@ -2898,20 +2875,9 @@ var useUniformMeshLocationContext = () => {
2898
2875
  };
2899
2876
 
2900
2877
  // src/hooks/useMeshLocation.ts
2901
- var legacyWarned = false;
2902
2878
  function useMeshLocation(expectedLocation) {
2903
2879
  const { location } = useUniformMeshLocationContext();
2904
- let effectiveExpected = expectedLocation;
2905
- if (expectedLocation === "dataTypeInstance") {
2906
- effectiveExpected = "dataResource";
2907
- if (!legacyWarned) {
2908
- console.warn(
2909
- "`dataTypeInstance` mesh location is deprecated, please switch to `dataResource` instead."
2910
- );
2911
- legacyWarned = true;
2912
- }
2913
- }
2914
- if (effectiveExpected && location.type !== effectiveExpected) {
2880
+ if (expectedLocation && location.type !== expectedLocation) {
2915
2881
  throw new Error(`Expected location type ${expectedLocation} but got ${location.type}`);
2916
2882
  }
2917
2883
  const backdoorLocation = (0, import_react27.useRef)(location);
@@ -2934,9 +2900,35 @@ function useMeshLocation(expectedLocation) {
2934
2900
  var import_design_system16 = require("@uniformdev/design-system");
2935
2901
  var React11 = __toESM(require("react"));
2936
2902
 
2903
+ // src/components/Variables/insertVariableIntoText.ts
2904
+ function insertVariableIntoText({
2905
+ variableName: variableName2,
2906
+ variablePrefix,
2907
+ variableSuffix = "",
2908
+ value,
2909
+ selectionStart = null,
2910
+ selectionEnd = null
2911
+ }) {
2912
+ const variableExpression = `${variablePrefix}${variableName2}${variableSuffix}`;
2913
+ if (selectionStart !== null && selectionEnd !== null && selectionStart !== selectionEnd) {
2914
+ return `${value.substring(0, selectionStart)}${variableExpression}${value.substring(selectionEnd)}`;
2915
+ }
2916
+ const hasCursorPosition = selectionStart !== null;
2917
+ let startOffset = 0;
2918
+ if (hasCursorPosition && value.substring(selectionStart - variablePrefix.length, selectionStart) === variablePrefix) {
2919
+ startOffset = variablePrefix.length;
2920
+ }
2921
+ if (hasCursorPosition) {
2922
+ return `${value.substring(0, selectionStart - startOffset)}${variableExpression}${value.substring(
2923
+ selectionStart
2924
+ )}`;
2925
+ }
2926
+ return `${value}${variableExpression}`;
2927
+ }
2928
+
2937
2929
  // src/components/Variables/InsertVariableMenu.tsx
2938
2930
  var import_design_system15 = require("@uniformdev/design-system");
2939
- var import_react30 = require("react");
2931
+ var import_react31 = require("react");
2940
2932
 
2941
2933
  // src/components/Variables/styles/InsertVariableMenu.styles.ts
2942
2934
  var import_react28 = require("@emotion/react");
@@ -2966,12 +2958,18 @@ var variablesTipText = import_react28.css`
2966
2958
  padding: 0 var(--spacing-sm);
2967
2959
  `;
2968
2960
 
2961
+ // src/components/Variables/useOnVariableUpdated.ts
2962
+ var import_react30 = require("react");
2963
+
2969
2964
  // src/components/Variables/VariablesProvider.tsx
2965
+ var import_mitt = __toESM(require("mitt"));
2970
2966
  var React10 = __toESM(require("react"));
2971
2967
 
2972
2968
  // src/components/Variables/VariableEditor.tsx
2969
+ var import_zod = require("@hookform/resolvers/zod");
2973
2970
  var import_design_system14 = require("@uniformdev/design-system");
2974
- var import_formik = require("formik");
2971
+ var import_react_hook_form = require("react-hook-form");
2972
+ var import_zod2 = require("zod");
2975
2973
 
2976
2974
  // src/components/Variables/InputVariables.styles.ts
2977
2975
  var import_react29 = require("@emotion/react");
@@ -2987,57 +2985,90 @@ var variablesFormBtnGroup = import_react29.css`
2987
2985
 
2988
2986
  // src/components/Variables/VariableEditor.tsx
2989
2987
  var import_jsx_runtime28 = require("@emotion/react/jsx-runtime");
2990
- function VariableEditor({ variable, onSubmit, onCancel }) {
2991
- var _a, _b, _c, _d, _e, _f, _g, _h, _i;
2988
+ var schema = import_zod2.z.object({
2989
+ name: import_zod2.z.string().nonempty("Name can't be empty").regex(/^[^${}]+$/, "$, {, and } are reserved characters and cannot be used in a variable name"),
2990
+ default: import_zod2.z.string(),
2991
+ displayName: import_zod2.z.string().optional(),
2992
+ helpText: import_zod2.z.string().optional(),
2993
+ order: import_zod2.z.number().optional(),
2994
+ type: import_zod2.z.string().optional()
2995
+ });
2996
+ function VariableEditor({ variable, onSubmit, onCancel, disableMeshTip }) {
2997
+ var _a, _b, _c, _d, _e, _f, _g;
2992
2998
  const { variables } = useVariables();
2993
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2994
- import_formik.Formik,
2995
- {
2996
- initialValues: {
2997
- name: variable,
2998
- default: (_b = (_a = variables[variable]) == null ? void 0 : _a.default) != null ? _b : "",
2999
- displayName: (_d = (_c = variables[variable]) == null ? void 0 : _c.displayName) != null ? _d : "",
3000
- helpText: (_f = (_e = variables[variable]) == null ? void 0 : _e.helpText) != null ? _f : "",
3001
- order: (_g = variables[variable]) == null ? void 0 : _g.order,
3002
- type: (_i = (_h = variables[variable]) == null ? void 0 : _h.type) != null ? _i : ""
3003
- },
3004
- onSubmit: (values) => {
3005
- const finalValue = {
3006
- ...values,
3007
- helpText: values.helpText || void 0,
3008
- type: values.type || void 0,
3009
- displayName: values.displayName || void 0
3010
- };
3011
- return onSubmit(finalValue);
3012
- },
3013
- children: ({ getFieldProps, initialValues }) => {
3014
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_formik.Form, { css: variablesFormContainer, children: [
3015
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
3016
- import_design_system14.Input,
3017
- {
3018
- ...getFieldProps("name"),
3019
- label: "Name",
3020
- disabled: initialValues.name !== "",
3021
- caption: "This cannot change once created."
3022
- }
3023
- ),
3024
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
3025
- import_design_system14.Input,
3026
- {
3027
- ...getFieldProps("helpText"),
3028
- label: "Help Text",
3029
- caption: "Appears in the composition data resource when entering a value for this variable.",
3030
- autoComplete: "off"
3031
- }
3032
- ),
3033
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_design_system14.Input, { ...getFieldProps("default"), label: "Default Value", autoComplete: "off" }),
3034
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { css: variablesFormBtnGroup, children: [
3035
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_design_system14.Button, { type: "submit", children: "OK" }),
3036
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_design_system14.Button, { type: "button", buttonType: "ghost", onClick: onCancel, children: "Cancel" })
3037
- ] })
3038
- ] });
3039
- }
3040
- }
2999
+ const currentVariable = variables[variable];
3000
+ const { register, handleSubmit, formState } = (0, import_react_hook_form.useForm)({
3001
+ defaultValues: {
3002
+ name: variable,
3003
+ default: (_a = currentVariable == null ? void 0 : currentVariable.default) != null ? _a : "",
3004
+ displayName: (_b = currentVariable == null ? void 0 : currentVariable.displayName) != null ? _b : "",
3005
+ helpText: (_c = currentVariable == null ? void 0 : currentVariable.helpText) != null ? _c : "",
3006
+ order: currentVariable == null ? void 0 : currentVariable.order,
3007
+ type: (_d = currentVariable == null ? void 0 : currentVariable.type) != null ? _d : ""
3008
+ },
3009
+ resolver: (0, import_zod.zodResolver)(schema)
3010
+ });
3011
+ const submitHandler = handleSubmit((values) => {
3012
+ const finalValue = {
3013
+ ...values,
3014
+ helpText: values.helpText || void 0,
3015
+ type: values.type || void 0,
3016
+ displayName: values.displayName || void 0
3017
+ };
3018
+ return onSubmit(finalValue);
3019
+ });
3020
+ (0, import_design_system14.useShortcut)({
3021
+ shortcut: "enter",
3022
+ handler: () => {
3023
+ submitHandler();
3024
+ },
3025
+ activeWhenEditing: true
3026
+ });
3027
+ return (
3028
+ // NOTE: this is intentionally NOT a <form> because it's regularly used in a nested modal and that can make it bubble
3029
+ // up a submit to its 'parent form' which is not what we want.
3030
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { css: variablesFormContainer, children: [
3031
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
3032
+ import_design_system14.Input,
3033
+ {
3034
+ ...register("name"),
3035
+ label: "Name",
3036
+ disabled: variable !== "",
3037
+ caption: "This cannot change once created.",
3038
+ errorMessage: (_e = formState.errors.name) == null ? void 0 : _e.message,
3039
+ "data-af": "1"
3040
+ }
3041
+ ),
3042
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
3043
+ import_design_system14.Input,
3044
+ {
3045
+ ...register("helpText"),
3046
+ label: "Help Text",
3047
+ caption: "Appears when entering a value for this variable.",
3048
+ autoComplete: "off",
3049
+ errorMessage: (_f = formState.errors.helpText) == null ? void 0 : _f.message
3050
+ }
3051
+ ),
3052
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
3053
+ import_design_system14.Input,
3054
+ {
3055
+ ...register("default"),
3056
+ label: "Default Value",
3057
+ autoComplete: "off",
3058
+ errorMessage: (_g = formState.errors.default) == null ? void 0 : _g.message
3059
+ }
3060
+ ),
3061
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { css: variablesFormBtnGroup, children: [
3062
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_design_system14.Button, { type: "button", onClick: submitHandler, children: "OK" }),
3063
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_design_system14.Button, { type: "button", buttonType: "ghost", onClick: onCancel, children: "Cancel" })
3064
+ ] }),
3065
+ disableMeshTip ? null : /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_design_system14.Callout, { type: "tip", title: "Customized User Interfaces", children: [
3066
+ "Developers can create customized user interfaces for variable editing by building a Uniform mesh integration. Get started quickly with our",
3067
+ " ",
3068
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("a", { href: "https://docs.uniform.app", target: "_blank", rel: "noopener noreferrer", children: "Mesh SDK" }),
3069
+ "."
3070
+ ] })
3071
+ ] })
3041
3072
  );
3042
3073
  }
3043
3074
 
@@ -3051,6 +3082,7 @@ function VariablesProvider({
3051
3082
  children
3052
3083
  }) {
3053
3084
  const [editing, setEditing] = React10.useState();
3085
+ const events = React10.useMemo(() => (0, import_mitt.default)(), []);
3054
3086
  const Editor = editVariableComponent != null ? editVariableComponent : VariableEditor;
3055
3087
  const contextValue = {
3056
3088
  dispatch: (event) => {
@@ -3072,7 +3104,9 @@ function VariablesProvider({
3072
3104
  throw new Error(`Unknown event ${JSON.stringify(event)}`);
3073
3105
  }
3074
3106
  },
3075
- variables: value
3107
+ variables: value,
3108
+ isEditing: typeof editing !== "undefined",
3109
+ events
3076
3110
  };
3077
3111
  return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(VariablesContext.Provider, { value: contextValue, children: [
3078
3112
  children,
@@ -3083,6 +3117,7 @@ function VariablesProvider({
3083
3117
  setEditing(void 0);
3084
3118
  const { name, ...varValue } = val;
3085
3119
  onChange({ ...value, [name]: varValue });
3120
+ events.emit("update", name);
3086
3121
  },
3087
3122
  onCancel: () => setEditing(void 0),
3088
3123
  variable: editing
@@ -3098,51 +3133,106 @@ function useVariables() {
3098
3133
  return context;
3099
3134
  }
3100
3135
 
3136
+ // src/components/Variables/useOnVariableUpdated.ts
3137
+ function useOnVariableUpdated(fn, disabled) {
3138
+ const { variables, events } = useVariables();
3139
+ (0, import_react30.useEffect)(() => {
3140
+ if (disabled) {
3141
+ return;
3142
+ }
3143
+ events.on("update", fn);
3144
+ return () => events.off("update", fn);
3145
+ }, [disabled, events, fn, variables]);
3146
+ }
3147
+
3148
+ // src/components/Variables/variablesToList.ts
3149
+ function variablesToList(variables) {
3150
+ return Object.entries(variables || {}).sort(([aKey, a], [bKey, b]) => {
3151
+ var _a, _b;
3152
+ if (a.order && b.order) {
3153
+ return a.order - b.order;
3154
+ } else if (a.order) {
3155
+ return 1;
3156
+ } else if (b.order) {
3157
+ return -1;
3158
+ }
3159
+ return ((_a = a.displayName) != null ? _a : aKey).localeCompare((_b = b.displayName) != null ? _b : bKey);
3160
+ }).map(([name, definition]) => ({
3161
+ name,
3162
+ ...definition
3163
+ }));
3164
+ }
3165
+
3101
3166
  // src/components/Variables/InsertVariableMenu.tsx
3102
3167
  var import_jsx_runtime30 = require("@emotion/react/jsx-runtime");
3103
3168
  var InsertVariableMenu = ({
3104
- onVariableClick,
3169
+ onSelectVariable,
3105
3170
  children,
3106
3171
  textValue,
3107
3172
  trigger = "${",
3108
- showAddVariableMenuOption = false
3173
+ showAddVariableMenuOption = false,
3174
+ disabled = false,
3175
+ forceVisible
3109
3176
  }) => {
3110
- const { variables, dispatch } = useVariables();
3111
- const btnRef = (0, import_react30.useRef)(null);
3112
- const tip = "Tip: access this list by typing ${";
3113
- (0, import_react30.useEffect)(() => {
3177
+ const { variables, dispatch, isEditing } = useVariables();
3178
+ const btnRef = (0, import_react31.useRef)(null);
3179
+ const tip = `Tip: access this list by typing ${trigger}`;
3180
+ (0, import_react31.useEffect)(() => {
3114
3181
  if (textValue === trigger && btnRef.current && btnRef.current.getAttribute("aria-expanded") === "false") {
3115
3182
  btnRef.current.click();
3116
3183
  }
3117
3184
  }, [textValue, btnRef, trigger]);
3185
+ const [openedAdd, setOpenedAdd] = (0, import_react31.useState)(false);
3186
+ useOnVariableUpdated((varName) => {
3187
+ onSelectVariable == null ? void 0 : onSelectVariable({ name: varName, default: "" });
3188
+ }, !openedAdd);
3189
+ (0, import_react31.useEffect)(() => {
3190
+ if (openedAdd && !isEditing) {
3191
+ setOpenedAdd(false);
3192
+ }
3193
+ }, [isEditing, openedAdd]);
3194
+ if (disabled) {
3195
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_jsx_runtime30.Fragment, { children });
3196
+ }
3197
+ const variablesList = variablesToList(variables);
3118
3198
  return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { css: menuContainer, children: [
3119
3199
  children,
3120
3200
  /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
3121
3201
  import_design_system15.Menu,
3122
3202
  {
3123
3203
  placement: "bottom-start",
3204
+ forceVisible,
3124
3205
  menuTrigger: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("button", { ref: btnRef, css: menuBtn, type: "button", title: "Insert variable", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_design_system15.Icon, { icon: "usb-c", iconColor: "currentColor" }) }),
3125
3206
  menuLabel: "Insert variable",
3126
3207
  children: [
3127
- Object.entries(variables).map(([key, value]) => {
3128
- const { helpText } = value;
3208
+ variablesList.map((variable) => {
3209
+ const { name, helpText } = variable;
3129
3210
  return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
3130
3211
  import_design_system15.MenuItem,
3131
3212
  {
3132
- id: key,
3213
+ id: name,
3133
3214
  css: menuItemTextGroup,
3134
- onClick: () => onVariableClick(decodeURI(`\${${key}}`)),
3215
+ onClick: () => onSelectVariable == null ? void 0 : onSelectVariable(variable),
3135
3216
  children: [
3136
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: key }),
3217
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: name }),
3137
3218
  helpText ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("small", { css: smallText, children: helpText }) : null
3138
3219
  ]
3139
3220
  },
3140
- key
3221
+ name
3141
3222
  );
3142
3223
  }),
3143
3224
  showAddVariableMenuOption ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
3144
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_design_system15.MenuItemSeparator, {}),
3145
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_design_system15.MenuItem, { onClick: () => dispatch({ type: "edit", variable: "" }), children: "Add Variable" })
3225
+ variablesList.length ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_design_system15.MenuItemSeparator, {}) : null,
3226
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3227
+ import_design_system15.MenuItem,
3228
+ {
3229
+ onClick: () => {
3230
+ setOpenedAdd(true);
3231
+ dispatch({ type: "edit", variable: "" });
3232
+ },
3233
+ children: "Add Variable"
3234
+ }
3235
+ )
3146
3236
  ] }) : null,
3147
3237
  Object.entries(variables).length || showAddVariableMenuOption ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_design_system15.MenuItemSeparator, {}) : null,
3148
3238
  /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("i", { css: variablesTipText, children: tip })
@@ -3157,13 +3247,15 @@ var import_jsx_runtime31 = require("@emotion/react/jsx-runtime");
3157
3247
  function InputVariables({
3158
3248
  "aria-label": ariaLabel,
3159
3249
  value,
3160
- // disableVariables,
3250
+ disableVariables,
3161
3251
  onChange,
3162
3252
  onPaste,
3163
- onVariableClick,
3164
3253
  showAddVariableMenuOption,
3254
+ variablePrefix = "${",
3255
+ variableSuffix = "}",
3165
3256
  ...inputProps
3166
3257
  }) {
3258
+ var _a, _b;
3167
3259
  const { variables, dispatch } = useVariables();
3168
3260
  const currentVariables = React11.useRef(variables);
3169
3261
  const currentDispatch = React11.useRef(dispatch);
@@ -3178,21 +3270,40 @@ function InputVariables({
3178
3270
  React11.useEffect(() => {
3179
3271
  currentSetValue.current = onChange;
3180
3272
  }, [onChange]);
3181
- React11.useEffect(() => {
3182
- var _a, _b;
3183
- if (((_a = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _a.value) && onPaste) {
3184
- onPaste((_b = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _b.value);
3185
- }
3186
- });
3273
+ const onPasteHandler = () => {
3274
+ setTimeout(() => {
3275
+ if (!inputRef.current) {
3276
+ return;
3277
+ }
3278
+ onPaste == null ? void 0 : onPaste(inputRef.current.value);
3279
+ });
3280
+ };
3281
+ const handleInsertVariable = (variable) => {
3282
+ var _a2, _b2;
3283
+ handleSetValue(
3284
+ insertVariableIntoText({
3285
+ variableName: variable.name,
3286
+ value,
3287
+ variablePrefix,
3288
+ variableSuffix,
3289
+ selectionEnd: (_a2 = inputRef.current) == null ? void 0 : _a2.selectionEnd,
3290
+ selectionStart: (_b2 = inputRef.current) == null ? void 0 : _b2.selectionStart
3291
+ })
3292
+ );
3293
+ };
3187
3294
  const handleSetValue = (rawValue) => {
3188
3295
  currentSetValue.current(rawValue);
3189
3296
  };
3297
+ const currentCursor = (_b = (_a = inputRef.current) == null ? void 0 : _a.selectionStart) != null ? _b : value.length;
3298
+ const forceMenu = value.substring(currentCursor - 2, currentCursor) === "${";
3190
3299
  return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3191
3300
  InsertVariableMenu,
3192
3301
  {
3193
3302
  showAddVariableMenuOption,
3194
3303
  textValue: value,
3195
- onVariableClick,
3304
+ onSelectVariable: handleInsertVariable,
3305
+ disabled: disableVariables,
3306
+ forceVisible: forceMenu || void 0,
3196
3307
  children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3197
3308
  import_design_system16.Input,
3198
3309
  {
@@ -3201,6 +3312,7 @@ function InputVariables({
3201
3312
  showLabel: false,
3202
3313
  value,
3203
3314
  onChange: (e) => handleSetValue(e.currentTarget.value),
3315
+ onPaste: onPasteHandler,
3204
3316
  ...inputProps
3205
3317
  }
3206
3318
  )
@@ -3209,13 +3321,13 @@ function InputVariables({
3209
3321
  }
3210
3322
 
3211
3323
  // src/components/Variables/VariablesList.tsx
3212
- var import_react32 = require("@emotion/react");
3324
+ var import_react33 = require("@emotion/react");
3213
3325
  var import_design_system17 = require("@uniformdev/design-system");
3214
3326
  var import_react_beautiful_dnd2 = require("react-beautiful-dnd");
3215
3327
 
3216
3328
  // src/components/Variables/styles/VariablesList.styles.ts
3217
- var import_react31 = require("@emotion/react");
3218
- var tableRow = (isDragging) => import_react31.css`
3329
+ var import_react32 = require("@emotion/react");
3330
+ var tableRow = (isDragging) => import_react32.css`
3219
3331
  position: relative;
3220
3332
  ${isDragging ? `
3221
3333
  display: table;
@@ -3223,7 +3335,7 @@ var tableRow = (isDragging) => import_react31.css`
3223
3335
  top: auto !important;
3224
3336
  ` : void 0}
3225
3337
  `;
3226
- var tableCellDragIcon = import_react31.css`
3338
+ var tableCellDragIcon = import_react32.css`
3227
3339
  &::after {
3228
3340
  content: '';
3229
3341
  display: block;
@@ -3241,7 +3353,7 @@ var tableCellDragIcon = import_react31.css`
3241
3353
  opacity: 1;
3242
3354
  }
3243
3355
  `;
3244
- var variableName = import_react31.css`
3356
+ var variableName = import_react32.css`
3245
3357
  border: none;
3246
3358
  color: var(--brand-secondary-5);
3247
3359
  font-weight: var(--fw-medium);
@@ -3252,31 +3364,13 @@ var variableName = import_react31.css`
3252
3364
  white-space: nowrap;
3253
3365
  max-width: 20ch;
3254
3366
  `;
3255
- var variableValue = import_react31.css`
3367
+ var variableValue = import_react32.css`
3256
3368
  overflow: hidden;
3257
3369
  text-overflow: ellipsis;
3258
3370
  white-space: nowrap;
3259
3371
  max-width: 20ch;
3260
3372
  `;
3261
3373
 
3262
- // src/components/Variables/variablesToList.ts
3263
- function variablesToList(variables) {
3264
- return Object.entries(variables || {}).sort(([aKey, a], [bKey, b]) => {
3265
- var _a, _b;
3266
- if (a.order && b.order) {
3267
- return a.order - b.order;
3268
- } else if (a.order) {
3269
- return 1;
3270
- } else if (b.order) {
3271
- return -1;
3272
- }
3273
- return ((_a = a.displayName) != null ? _a : aKey).localeCompare((_b = b.displayName) != null ? _b : bKey);
3274
- }).map(([name, definition]) => ({
3275
- name,
3276
- ...definition
3277
- }));
3278
- }
3279
-
3280
3374
  // src/components/Variables/VariablesList.tsx
3281
3375
  var import_jsx_runtime32 = require("@emotion/react/jsx-runtime");
3282
3376
  function VariablesList() {
@@ -3346,7 +3440,7 @@ function VariablesList() {
3346
3440
  title: `delete ${text}`,
3347
3441
  css: [
3348
3442
  import_design_system17.button,
3349
- import_react32.css`
3443
+ import_react33.css`
3350
3444
  background: transparent;
3351
3445
  `
3352
3446
  ],
@@ -3388,7 +3482,7 @@ function DataResourceVariablesList({
3388
3482
  const {
3389
3483
  value,
3390
3484
  metadata: { dataType }
3391
- } = useMeshLocation("dataTypeInstance");
3485
+ } = useMeshLocation("dataResource");
3392
3486
  const variableDefinitions = variablesToList(dataType.variables);
3393
3487
  if (variableDefinitions.length === 0) {
3394
3488
  if (NoVariablesComponent) {
@@ -3441,9 +3535,9 @@ function TextVariableRenderer({ definition, value, setValue }) {
3441
3535
  }
3442
3536
 
3443
3537
  // src/components/Request/RequestBody.tsx
3444
- var import_react34 = require("@emotion/react");
3538
+ var import_react35 = require("@emotion/react");
3445
3539
  var import_design_system19 = require("@uniformdev/design-system");
3446
- var import_react35 = require("react");
3540
+ var import_react36 = require("react");
3447
3541
 
3448
3542
  // src/components/Request/RequestProvider.tsx
3449
3543
  var React12 = __toESM(require("react"));
@@ -3527,11 +3621,11 @@ function useRequest() {
3527
3621
  }
3528
3622
 
3529
3623
  // src/components/Request/styles/Request.styles.ts
3530
- var import_react33 = require("@emotion/react");
3531
- var innerContentStyles = import_react33.css`
3624
+ var import_react34 = require("@emotion/react");
3625
+ var innerContentStyles = import_react34.css`
3532
3626
  background: var(--white);
3533
3627
  `;
3534
- var requestTypeContainer = (bgColor) => import_react33.css`
3628
+ var requestTypeContainer = (bgColor) => import_react34.css`
3535
3629
  align-items: start;
3536
3630
  background: ${bgColor};
3537
3631
  display: grid;
@@ -3569,11 +3663,11 @@ var LANGUAGE_TO_CONTENT_TYPE = {
3569
3663
  };
3570
3664
  function RequestBody() {
3571
3665
  const { request, dispatch } = useRequest();
3572
- const [language, setLanguage] = (0, import_react35.useState)("json");
3666
+ const [language, setLanguage] = (0, import_react36.useState)("json");
3573
3667
  return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
3574
3668
  "div",
3575
3669
  {
3576
- css: import_react34.css`
3670
+ css: import_react35.css`
3577
3671
  background: var(--white);
3578
3672
  `,
3579
3673
  children: [
@@ -3581,7 +3675,7 @@ function RequestBody() {
3581
3675
  RequestTypeContainer,
3582
3676
  {
3583
3677
  bgColor: "var(--gray-100)",
3584
- css: import_react34.css`
3678
+ css: import_react35.css`
3585
3679
  padding: var(--spacing-sm) var(--spacing-base);
3586
3680
  `,
3587
3681
  children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
@@ -3688,7 +3782,8 @@ function RequestHeaders({ disableVariables }) {
3688
3782
  {
3689
3783
  value: header.value,
3690
3784
  onChange: (value) => handleUpdateParamFromMenu({ key: header.key, value, index }),
3691
- onVariableClick: (value) => handleUpdateParamFromMenu({ key: header.key, value, index }),
3785
+ disableVariables,
3786
+ showAddVariableMenuOption: true,
3692
3787
  "data-test-id": "header-value"
3693
3788
  }
3694
3789
  ) : null })
@@ -3787,12 +3882,9 @@ function RequestParameters({ disableVariables }) {
3787
3882
  value: selectedVariable,
3788
3883
  index
3789
3884
  }),
3790
- onVariableClick: (selectedVariable) => handleUpdateParamFromMenu({
3791
- key: parameter.key,
3792
- value: selectedVariable,
3793
- index
3794
- }),
3795
- "data-test-id": "parameter-value"
3885
+ disableVariables,
3886
+ "data-test-id": "parameter-value",
3887
+ showAddVariableMenuOption: true
3796
3888
  }
3797
3889
  ) : null })
3798
3890
  ] }, index);
@@ -3802,8 +3894,8 @@ function RequestParameters({ disableVariables }) {
3802
3894
  }
3803
3895
 
3804
3896
  // src/components/Request/RequestUrl.tsx
3805
- var import_react36 = require("@emotion/react");
3806
- var import_react37 = require("react");
3897
+ var import_react37 = require("@emotion/react");
3898
+ var import_react38 = require("react");
3807
3899
 
3808
3900
  // src/components/Request/urlEncodeRequestParameter.ts
3809
3901
  function urlEncodeRequestUrl(url, varValues) {
@@ -3829,7 +3921,7 @@ function RequestUrl() {
3829
3921
  var _a, _b;
3830
3922
  const { variables } = useVariables();
3831
3923
  const { request } = useRequest();
3832
- const mergedParameters = (0, import_react37.useMemo)(() => {
3924
+ const mergedParameters = (0, import_react38.useMemo)(() => {
3833
3925
  var _a2;
3834
3926
  if (!((_a2 = request.baseRequest) == null ? void 0 : _a2.parameters)) {
3835
3927
  return request.parameters;
@@ -3839,7 +3931,7 @@ function RequestUrl() {
3839
3931
  return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
3840
3932
  "small",
3841
3933
  {
3842
- css: import_react36.css`
3934
+ css: import_react37.css`
3843
3935
  display: inline-block;
3844
3936
  margin-bottom: var(--spacing-xs);
3845
3937
  word-break: break-word;
@@ -3899,9 +3991,6 @@ function RequestUrlInput(props) {
3899
3991
  onChange: (value) => {
3900
3992
  dispatch({ type: "setRelativeUrl", relativeUrl: value });
3901
3993
  },
3902
- onVariableClick: (selectedValue) => {
3903
- dispatch({ type: "setRelativeUrl", relativeUrl: request.relativeUrl.concat(selectedValue) });
3904
- },
3905
3994
  showAddVariableMenuOption: true
3906
3995
  }
3907
3996
  );
@@ -4054,12 +4143,12 @@ var import_design_system23 = require("@uniformdev/design-system");
4054
4143
 
4055
4144
  // src/hooks/useInitializeUniformMeshSdk.ts
4056
4145
  var import_mesh_sdk = require("@uniformdev/mesh-sdk");
4057
- var import_react38 = require("react");
4146
+ var import_react39 = require("react");
4058
4147
  var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
4059
- const [error, setError] = (0, import_react38.useState)();
4060
- const [sdk, setSdk] = (0, import_react38.useState)();
4061
- const initializationInProgress = (0, import_react38.useRef)(false);
4062
- (0, import_react38.useEffect)(
4148
+ const [error, setError] = (0, import_react39.useState)();
4149
+ const [sdk, setSdk] = (0, import_react39.useState)();
4150
+ const initializationInProgress = (0, import_react39.useRef)(false);
4151
+ (0, import_react39.useEffect)(
4063
4152
  () => {
4064
4153
  if (typeof window === "undefined" || sdk) {
4065
4154
  return;
@@ -4117,7 +4206,7 @@ var MeshApp = ({
4117
4206
  };
4118
4207
 
4119
4208
  // src/components/ObjectSearch/DataRefreshButton.tsx
4120
- var import_react39 = require("@emotion/react");
4209
+ var import_react40 = require("@emotion/react");
4121
4210
  var import_design_system24 = require("@uniformdev/design-system");
4122
4211
  var import_jsx_runtime45 = require("@emotion/react/jsx-runtime");
4123
4212
  var DataRefreshButton = ({
@@ -4130,7 +4219,7 @@ var DataRefreshButton = ({
4130
4219
  !isLoading ? null : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
4131
4220
  import_design_system24.LoadingIndicator,
4132
4221
  {
4133
- css: import_react39.css`
4222
+ css: import_react40.css`
4134
4223
  ${isLoading ? "opacity: 0.2;" : void 0}
4135
4224
  `
4136
4225
  }
@@ -4158,12 +4247,12 @@ var ObjectSearchContainer = ({
4158
4247
 
4159
4248
  // src/components/ObjectSearch/ObjectSearchFilter.tsx
4160
4249
  var import_design_system26 = require("@uniformdev/design-system");
4161
- var import_react42 = require("react");
4250
+ var import_react43 = require("react");
4162
4251
 
4163
4252
  // src/components/ObjectSearch/hooks/ObjectSearchContext.tsx
4164
- var import_react40 = require("react");
4253
+ var import_react41 = require("react");
4165
4254
  var import_jsx_runtime47 = require("@emotion/react/jsx-runtime");
4166
- var ObjectSearchContext = (0, import_react40.createContext)({
4255
+ var ObjectSearchContext = (0, import_react41.createContext)({
4167
4256
  onSetQuery: () => {
4168
4257
  },
4169
4258
  onSelectItem: () => {
@@ -4180,14 +4269,14 @@ var ObjectSearchContext = (0, import_react40.createContext)({
4180
4269
  }
4181
4270
  });
4182
4271
  var ObjectSearchProvider = ({ currentlySelectedItems, children }) => {
4183
- const [query, setQuery] = (0, import_react40.useState)({
4272
+ const [query, setQuery] = (0, import_react41.useState)({
4184
4273
  contentType: "",
4185
4274
  keyword: ""
4186
4275
  });
4187
- const querySearchDeferred = (0, import_react40.useDeferredValue)(query);
4188
- const [selectedItems, setSelectedItems] = (0, import_react40.useState)(currentlySelectedItems != null ? currentlySelectedItems : []);
4189
- const [list, setList] = (0, import_react40.useState)({});
4190
- const onSetQuery = (0, import_react40.useCallback)(
4276
+ const querySearchDeferred = (0, import_react41.useDeferredValue)(query);
4277
+ const [selectedItems, setSelectedItems] = (0, import_react41.useState)(currentlySelectedItems != null ? currentlySelectedItems : []);
4278
+ const [list, setList] = (0, import_react41.useState)({});
4279
+ const onSetQuery = (0, import_react41.useCallback)(
4191
4280
  (value) => {
4192
4281
  if (Array.isArray(value.contentType) && value.contentType.length > 0) {
4193
4282
  return setQuery({
@@ -4199,7 +4288,7 @@ var ObjectSearchProvider = ({ currentlySelectedItems, children }) => {
4199
4288
  },
4200
4289
  [setQuery]
4201
4290
  );
4202
- const onSelectItem = (0, import_react40.useCallback)(
4291
+ const onSelectItem = (0, import_react41.useCallback)(
4203
4292
  (selectedResult) => {
4204
4293
  if (Array.isArray(selectedResult)) {
4205
4294
  setSelectedItems(selectedResult);
@@ -4213,10 +4302,10 @@ var ObjectSearchProvider = ({ currentlySelectedItems, children }) => {
4213
4302
  },
4214
4303
  [setSelectedItems, selectedItems]
4215
4304
  );
4216
- const onRemoveAllSelectedItems = (0, import_react40.useCallback)(() => {
4305
+ const onRemoveAllSelectedItems = (0, import_react41.useCallback)(() => {
4217
4306
  setSelectedItems([]);
4218
4307
  }, [setSelectedItems]);
4219
- const onSetList = (0, import_react40.useCallback)(
4308
+ const onSetList = (0, import_react41.useCallback)(
4220
4309
  (value) => {
4221
4310
  setList(value);
4222
4311
  },
@@ -4239,13 +4328,13 @@ var ObjectSearchProvider = ({ currentlySelectedItems, children }) => {
4239
4328
  );
4240
4329
  };
4241
4330
  var useObjectSearchContext = () => {
4242
- const contextValues = (0, import_react40.useContext)(ObjectSearchContext);
4331
+ const contextValues = (0, import_react41.useContext)(ObjectSearchContext);
4243
4332
  return { ...contextValues };
4244
4333
  };
4245
4334
 
4246
4335
  // src/components/ObjectSearch/styles/ObjectSearchFilterContainer.styles.ts
4247
- var import_react41 = require("@emotion/react");
4248
- var ObjectSearchFilterContainerLabel = import_react41.css`
4336
+ var import_react42 = require("@emotion/react");
4337
+ var ObjectSearchFilterContainerLabel = import_react42.css`
4249
4338
  align-items: center;
4250
4339
  display: flex;
4251
4340
  font-size: var(--fs-sm);
@@ -4253,14 +4342,14 @@ var ObjectSearchFilterContainerLabel = import_react41.css`
4253
4342
  line-height: 1rem;
4254
4343
  margin-bottom: var(--spacing-sm);
4255
4344
  `;
4256
- var ObjectSearchFilterContainer = import_react41.css`
4345
+ var ObjectSearchFilterContainer = import_react42.css`
4257
4346
  display: grid;
4258
4347
  gap: var(--spacing-base);
4259
4348
  `;
4260
- var ObjectSearchFilterDropdownAndTextSearch = import_react41.css`
4349
+ var ObjectSearchFilterDropdownAndTextSearch = import_react42.css`
4261
4350
  grid-template-columns: 0.5fr 1fr;
4262
4351
  `;
4263
- var ObjectSearchFilterGrid = (gridColumns) => import_react41.css`
4352
+ var ObjectSearchFilterGrid = (gridColumns) => import_react42.css`
4264
4353
  display: grid;
4265
4354
  grid-template-columns: ${gridColumns};
4266
4355
  gap: var(--spacing-base);
@@ -4277,7 +4366,7 @@ var ObjectSearchFilter = ({
4277
4366
  selectOptions
4278
4367
  }) => {
4279
4368
  const { query, onSetQuery } = useObjectSearchContext();
4280
- const [searchState, setSearchState] = (0, import_react42.useState)({
4369
+ const [searchState, setSearchState] = (0, import_react43.useState)({
4281
4370
  contentType: "",
4282
4371
  keyword: ""
4283
4372
  });
@@ -4331,9 +4420,9 @@ var ObjectSearchFilterContainer2 = ({ label, children }) => {
4331
4420
  var import_design_system28 = require("@uniformdev/design-system");
4332
4421
 
4333
4422
  // src/components/ObjectSearch/styles/ObjectSearchListItem.styles.ts
4334
- var import_react43 = require("@emotion/react");
4423
+ var import_react44 = require("@emotion/react");
4335
4424
  var import_design_system27 = require("@uniformdev/design-system");
4336
- var ObjectListItemContainer = import_react43.css`
4425
+ var ObjectListItemContainer = import_react44.css`
4337
4426
  align-items: center;
4338
4427
  border: 1px solid var(--gray-300);
4339
4428
  border-radius: var(--rounded-base);
@@ -4346,7 +4435,7 @@ var ObjectListItemContainer = import_react43.css`
4346
4435
  display: none;
4347
4436
  }
4348
4437
  `;
4349
- var ObjectListItemLoading = import_react43.css`
4438
+ var ObjectListItemLoading = import_react44.css`
4350
4439
  animation: ${import_design_system27.skeletonLoading} 1s linear infinite alternate;
4351
4440
  border-color: transparent;
4352
4441
  min-height: 42px;
@@ -4370,31 +4459,31 @@ var ObjectListItemLoading = import_react43.css`
4370
4459
  width: 1rem;
4371
4460
  }
4372
4461
  `;
4373
- var ObjectListItemHeadingGroup = import_react43.css`
4462
+ var ObjectListItemHeadingGroup = import_react44.css`
4374
4463
  align-items: center;
4375
4464
  display: grid;
4376
4465
  `;
4377
- var ObjectListItemTitle = import_react43.css`
4466
+ var ObjectListItemTitle = import_react44.css`
4378
4467
  color: var(--brand-secondary-1);
4379
4468
  display: block;
4380
4469
  font-size: var(--fs-sm);
4381
4470
  `;
4382
- var ObjectListItemSubtitle = import_react43.css`
4471
+ var ObjectListItemSubtitle = import_react44.css`
4383
4472
  color: var(--gray-500);
4384
4473
  display: block;
4385
4474
  font-size: var(--fs-xs);
4386
4475
  line-height: 1;
4387
4476
  `;
4388
- var ObjectListItemInfoContainer = import_react43.css`
4477
+ var ObjectListItemInfoContainer = import_react44.css`
4389
4478
  align-items: center;
4390
4479
  display: flex;
4391
4480
  justify-content: center;
4392
4481
  `;
4393
- var ObjectListItemControlledContent = import_react43.css`
4482
+ var ObjectListItemControlledContent = import_react44.css`
4394
4483
  display: flex;
4395
4484
  gap: var(--spacing-sm);
4396
4485
  `;
4397
- var ObjectListItemUnControlledContent = import_react43.css`
4486
+ var ObjectListItemUnControlledContent = import_react44.css`
4398
4487
  margin-top: var(--spacing-sm);
4399
4488
  grid-column: 1 / -1;
4400
4489
  `;
@@ -4445,9 +4534,9 @@ var import_design_system30 = require("@uniformdev/design-system");
4445
4534
  var import_timeago3 = require("timeago.js");
4446
4535
 
4447
4536
  // src/components/ObjectSearch/styles/ObjectSearchResultItemButton.styles.ts
4448
- var import_react44 = require("@emotion/react");
4537
+ var import_react45 = require("@emotion/react");
4449
4538
  var import_design_system29 = require("@uniformdev/design-system");
4450
- var ButtonStyles = import_react44.css`
4539
+ var ButtonStyles = import_react45.css`
4451
4540
  ${import_design_system29.button}
4452
4541
  background: transparent;
4453
4542
  border: 1px solid var(--brand-secondary-1);
@@ -4474,7 +4563,7 @@ var ButtonStyles = import_react44.css`
4474
4563
  text-decoration: none;
4475
4564
  }
4476
4565
  `;
4477
- var ButtonIcon = import_react44.css`
4566
+ var ButtonIcon = import_react45.css`
4478
4567
  width: 1rem;
4479
4568
  height: 1rem;
4480
4569
  `;
@@ -4503,8 +4592,8 @@ var LinkButton = ({
4503
4592
  };
4504
4593
 
4505
4594
  // src/components/ObjectSearch/styles/ObjectSearchResultItem.styles.ts
4506
- var import_react45 = require("@emotion/react");
4507
- var ObjectSearchResultItemContainer = import_react45.css`
4595
+ var import_react46 = require("@emotion/react");
4596
+ var ObjectSearchResultItemContainer = import_react46.css`
4508
4597
  align-items: center;
4509
4598
  border: 1px solid var(--gray-300);
4510
4599
  border-radius: var(--rounded-base);
@@ -4520,7 +4609,7 @@ var ObjectSearchResultItemContainer = import_react45.css`
4520
4609
  }
4521
4610
  }
4522
4611
  `;
4523
- var ObjectSearchDragHandle = import_react45.css`
4612
+ var ObjectSearchDragHandle = import_react46.css`
4524
4613
  border-left: 2px dotted var(--gray-300);
4525
4614
  border-right: 2px dotted var(--gray-300);
4526
4615
  position: absolute;
@@ -4529,35 +4618,35 @@ var ObjectSearchDragHandle = import_react45.css`
4529
4618
  transition: opacity var(--duration-fast) var(--timing-ease-out);
4530
4619
  opacity: 0;
4531
4620
  `;
4532
- var ObjectSearchResultItemSubtitle = import_react45.css`
4621
+ var ObjectSearchResultItemSubtitle = import_react46.css`
4533
4622
  color: var(--gray-500);
4534
4623
  display: block;
4535
4624
  font-size: var(--fs-xs);
4536
4625
  line-height: 1;
4537
4626
  `;
4538
- var ObjectSearchResultItemTitle = import_react45.css`
4627
+ var ObjectSearchResultItemTitle = import_react46.css`
4539
4628
  align-items: center;
4540
4629
  color: var(--brand-secondary-1);
4541
4630
  display: flex;
4542
4631
  gap: var(--spacing-xs);
4543
4632
  `;
4544
- var ObjectSearchResultItemTimeStamp = import_react45.css`
4633
+ var ObjectSearchResultItemTimeStamp = import_react46.css`
4545
4634
  color: var(--gray-500);
4546
4635
  font-size: var(--fs-xs);
4547
4636
  `;
4548
- var ObjectSearchAuthorStateGroup = import_react45.css`
4637
+ var ObjectSearchAuthorStateGroup = import_react46.css`
4549
4638
  align-items: center;
4550
4639
  display: flex;
4551
4640
  gap: var(--spacing-sm);
4552
4641
  `;
4553
- var ObjectSearchUpdateGroup = import_react45.css`
4642
+ var ObjectSearchUpdateGroup = import_react46.css`
4554
4643
  display: grid;
4555
4644
  `;
4556
- var ObjectSearchContentContainer = import_react45.css`
4645
+ var ObjectSearchContentContainer = import_react46.css`
4557
4646
  display: flex;
4558
4647
  gap: var(--spacing-base);
4559
4648
  `;
4560
- var ObjectSearchImage = import_react45.css`
4649
+ var ObjectSearchImage = import_react46.css`
4561
4650
  width: 56px;
4562
4651
  object-fit: contain;
4563
4652
  `;
@@ -4625,22 +4714,22 @@ var import_design_system31 = require("@uniformdev/design-system");
4625
4714
  var import_react_beautiful_dnd3 = require("react-beautiful-dnd");
4626
4715
 
4627
4716
  // src/components/ObjectSearch/styles/ObjectSearchResultList.styles.ts
4628
- var import_react46 = require("@emotion/react");
4629
- var ObjectSearchResultListContainer = import_react46.css`
4717
+ var import_react47 = require("@emotion/react");
4718
+ var ObjectSearchResultListContainer = import_react47.css`
4630
4719
  align-items: center;
4631
4720
  display: flex;
4632
4721
  gap: var(--spacing-sm);
4633
4722
  justify-content: space-between;
4634
4723
  `;
4635
- var ObjectSearchDragContainer = import_react46.css`
4724
+ var ObjectSearchDragContainer = import_react47.css`
4636
4725
  margin: 0 0 var(--spacing-sm);
4637
4726
  `;
4638
- var ObjectSearchResultListCounterContainer = import_react46.css`
4727
+ var ObjectSearchResultListCounterContainer = import_react47.css`
4639
4728
  align-items: center;
4640
4729
  display: flex;
4641
4730
  gap: var(--spacing-sm);
4642
4731
  `;
4643
- var ObjectSearchResultListTitle = import_react46.css`
4732
+ var ObjectSearchResultListTitle = import_react47.css`
4644
4733
  font-weight: var(--fw-bold);
4645
4734
  line-height: 1;
4646
4735
  `;
@@ -4715,7 +4804,7 @@ var ObjectSearchResultList = ({
4715
4804
 
4716
4805
  // src/components/ObjectSearch/QueryFilter.tsx
4717
4806
  var import_design_system32 = require("@uniformdev/design-system");
4718
- var import_react47 = require("react");
4807
+ var import_react48 = require("react");
4719
4808
  var import_jsx_runtime54 = require("@emotion/react/jsx-runtime");
4720
4809
  var QueryFilter = ({
4721
4810
  requireContentType,
@@ -4746,7 +4835,7 @@ var QueryFilter = ({
4746
4835
  }) => {
4747
4836
  var _a, _b;
4748
4837
  const { query, onSetQuery } = useObjectSearchContext();
4749
- const [queryState, setQueryState] = (0, import_react47.useState)({
4838
+ const [queryState, setQueryState] = (0, import_react48.useState)({
4750
4839
  contentType: "",
4751
4840
  keyword: "",
4752
4841
  count: countValue != null ? countValue : 5,
@@ -4757,7 +4846,7 @@ var QueryFilter = ({
4757
4846
  setQueryState((prev) => ({ ...prev, ...value }));
4758
4847
  onSetQuery({ ...query, ...value });
4759
4848
  };
4760
- (0, import_react47.useEffect)(() => {
4849
+ (0, import_react48.useEffect)(() => {
4761
4850
  onSetQuery(queryState);
4762
4851
  }, [onSetQuery, queryState]);
4763
4852
  return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("fieldset", { children: [
@@ -4841,12 +4930,6 @@ var QueryFilter = ({
4841
4930
  ] });
4842
4931
  };
4843
4932
 
4844
- // src/hooks/useUniformMeshLocation.ts
4845
- function useUniformMeshLocation() {
4846
- const { location } = useUniformMeshLocationContext();
4847
- return location;
4848
- }
4849
-
4850
4933
  // src/hooks/index.ts
4851
4934
  var import_design_system33 = require("@uniformdev/design-system");
4852
4935
 
@@ -4882,7 +4965,6 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
4882
4965
  InputSelect,
4883
4966
  InputToggle,
4884
4967
  InputVariables,
4885
- KeywordSearchInput,
4886
4968
  Label,
4887
4969
  LinkButton,
4888
4970
  LoadingIndicator,
@@ -4938,10 +5020,6 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
4938
5020
  TextVariableRenderer,
4939
5021
  Textarea,
4940
5022
  Theme,
4941
- UniformMeshLocationContext,
4942
- UniformMeshLocationContextProvider,
4943
- UniformMeshSdkContext,
4944
- UniformMeshSdkContextProvider,
4945
5023
  VariableEditor,
4946
5024
  VariablesList,
4947
5025
  VariablesProvider,
@@ -5010,7 +5088,6 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
5010
5088
  selectedItemTitle,
5011
5089
  urlEncodeRequestParameter,
5012
5090
  urlEncodeRequestUrl,
5013
- useInitializeUniformMeshSdk,
5014
5091
  useMeshLocation,
5015
5092
  useObjectSearchContext,
5016
5093
  useParameterShell,
@@ -5019,10 +5096,7 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
5019
5096
  useRequest,
5020
5097
  useRequestHeader,
5021
5098
  useRequestParameter,
5022
- useUniformMeshLocation,
5023
- useUniformMeshLocationContext,
5024
5099
  useUniformMeshSdk,
5025
- useUniformMeshSdkContext,
5026
5100
  useVariables,
5027
5101
  variablesToList
5028
5102
  });