@uniformdev/mesh-sdk-react 19.3.0 → 19.6.0

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
@@ -36,7 +36,9 @@ __export(src_exports, {
36
36
  Callout: () => import_design_system34.Callout,
37
37
  DamSelectedItem: () => DamSelectedItem,
38
38
  DataRefreshButton: () => DataRefreshButton,
39
+ DataResourceDynamicInputProvider: () => DataResourceDynamicInputProvider,
39
40
  DataResourceVariablesList: () => DataResourceVariablesList,
41
+ DataResourceVariablesListExplicit: () => DataResourceVariablesListExplicit,
40
42
  DataSourceEditor: () => DataSourceEditor,
41
43
  DataTypeEditor: () => DataTypeEditor,
42
44
  DefaultSearchRow: () => DefaultSearchRow,
@@ -183,6 +185,9 @@ __export(src_exports, {
183
185
  useRequestParameter: () => useRequestParameter,
184
186
  useUniformMeshSdk: () => useUniformMeshSdk,
185
187
  useVariables: () => useVariables,
188
+ variableExpression: () => variableExpression,
189
+ variablePrefix: () => variablePrefix,
190
+ variableSuffix: () => variableSuffix,
186
191
  variablesToList: () => variablesToList
187
192
  });
188
193
  module.exports = __toCommonJS(src_exports);
@@ -541,7 +546,7 @@ var SelectionField = ({
541
546
  {
542
547
  value: selectedValue,
543
548
  loading,
544
- text: (_a2 = values.find((v) => v.id === selectedValue)) == null ? void 0 : _a2.name
549
+ text: (_a2 = values.find((v2) => v2.id === selectedValue)) == null ? void 0 : _a2.name
545
550
  }
546
551
  ) }),
547
552
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
@@ -640,9 +645,9 @@ var ProductQuery = ({
640
645
  ];
641
646
  }, [categoryOptions]);
642
647
  const brandOptions = (0, import_react5.useMemo)(() => {
643
- return (brands == null ? void 0 : brands.map((b) => ({
644
- id: b.id.toString(),
645
- name: b.name
648
+ return (brands == null ? void 0 : brands.map((b2) => ({
649
+ id: b2.id.toString(),
650
+ name: b2.name
646
651
  }))) || [];
647
652
  }, [brands]);
648
653
  const handleAddProductCategory = (category) => {
@@ -657,7 +662,7 @@ var ProductQuery = ({
657
662
  const handleRemoveProductCategory = (category) => {
658
663
  var _a2;
659
664
  setFormState({
660
- categories: (_a2 = value == null ? void 0 : value.categories) == null ? void 0 : _a2.filter((c) => c !== category)
665
+ categories: (_a2 = value == null ? void 0 : value.categories) == null ? void 0 : _a2.filter((c2) => c2 !== category)
661
666
  });
662
667
  };
663
668
  const handleBrandChange = (e) => {
@@ -1078,7 +1083,7 @@ var ProductPreviewList = ({
1078
1083
  children: products == null ? void 0 : products.map((product, index) => {
1079
1084
  var _a;
1080
1085
  const [category] = (product == null ? void 0 : product.categories) || [];
1081
- const categoryName = typeof category === "undefined" || !categories ? void 0 : (_a = categories.find((c) => c.id === category.id)) == null ? void 0 : _a.name;
1086
+ const categoryName = typeof category === "undefined" || !categories ? void 0 : (_a = categories.find((c2) => c2.id === category.id)) == null ? void 0 : _a.name;
1082
1087
  return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("li", { css: productPreviewListItem, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1083
1088
  "div",
1084
1089
  {
@@ -1969,7 +1974,7 @@ var EntrySearch = ({
1969
1974
  ResolvedNoResultsComponent,
1970
1975
  {
1971
1976
  searchText: textInput || textInput,
1972
- selectedContentType: (_b = (_a = contentTypes == null ? void 0 : contentTypes.find((t) => t.id === contentTypeSelected)) == null ? void 0 : _a.name) != null ? _b : contentTypeSelected
1977
+ selectedContentType: (_b = (_a = contentTypes == null ? void 0 : contentTypes.find((t2) => t2.id === contentTypeSelected)) == null ? void 0 : _a.name) != null ? _b : contentTypeSelected
1973
1978
  }
1974
1979
  ),
1975
1980
  !resultsLoading && typeof totalResults !== "undefined" && results && (results == null ? void 0 : results.length) < totalResults && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { type: "button", css: entrySearchLoadMoreBtn, onClick: handleLoadMoreClick, children: !loadingMore ? "Load More" : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_design_system7.LoadingIndicator, {}) })
@@ -2159,7 +2164,7 @@ function ProductSearchRow({
2159
2164
  var _a;
2160
2165
  const { categories, logoIcon } = useProductSearchContext();
2161
2166
  const [category] = result.categories || [{ id: "", name: "" }];
2162
- const categoryName = typeof category === "undefined" || !categories ? void 0 : (_a = categories.find((c) => c.id === category.id)) == null ? void 0 : _a.name;
2167
+ const categoryName = typeof category === "undefined" || !categories ? void 0 : (_a = categories.find((c2) => c2.id === category.id)) == null ? void 0 : _a.name;
2163
2168
  return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2164
2169
  "div",
2165
2170
  {
@@ -2294,7 +2299,7 @@ function ProductSelectedItem({
2294
2299
  var _a;
2295
2300
  const { categories, logoIcon } = useProductSearchContext();
2296
2301
  const [category] = selectedItem.categories || [{ id: "", name: "" }];
2297
- const categoryName = typeof category === "undefined" || !categories ? void 0 : (_a = categories.find((c) => c.id === category.id)) == null ? void 0 : _a.name;
2302
+ const categoryName = typeof category === "undefined" || !categories ? void 0 : (_a = categories.find((c2) => c2.id === category.id)) == null ? void 0 : _a.name;
2298
2303
  return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { css: [productSelectedItemContainer], children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("article", { css: [productSelectedItemDetails], children: [
2299
2304
  /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { css: [productSelectedItemContent], children: [
2300
2305
  selectedItem.thumbnailUrl ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
@@ -2440,7 +2445,7 @@ function ProductSearch({
2440
2445
  } = (0, import_react_use3.useAsync)(async () => {
2441
2446
  return await onGetCategories();
2442
2447
  }, [onGetCategories]);
2443
- const categoryIds = categories == null ? void 0 : categories.map((c) => c.id).join(",");
2448
+ const categoryIds = categories == null ? void 0 : categories.map((c2) => c2.id).join(",");
2444
2449
  const categoryOptions = (0, import_react21.useMemo)(
2445
2450
  () => {
2446
2451
  if (!categories) {
@@ -2814,9 +2819,6 @@ function DefaultDamItemRenderer({ item }) {
2814
2819
  ] }) : null;
2815
2820
  }
2816
2821
 
2817
- // src/components/DataResourceVariablesList.tsx
2818
- var import_design_system18 = require("@uniformdev/design-system");
2819
-
2820
2822
  // src/hooks/useMeshLocation.ts
2821
2823
  var import_react27 = require("react");
2822
2824
 
@@ -2899,50 +2901,20 @@ function useMeshLocation(expectedLocation) {
2899
2901
  // src/components/Variables/InputVariables.tsx
2900
2902
  var import_design_system16 = require("@uniformdev/design-system");
2901
2903
  var React11 = __toESM(require("react"));
2904
+ var import_uuid2 = require("uuid");
2902
2905
 
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
-
2929
- // src/components/Variables/InsertVariableMenu.tsx
2906
+ // src/components/Variables/SelectVariableMenu.tsx
2930
2907
  var import_design_system15 = require("@uniformdev/design-system");
2931
2908
  var import_react31 = require("react");
2909
+ var import_cg5 = require("react-icons/cg");
2932
2910
 
2933
2911
  // src/components/Variables/styles/InsertVariableMenu.styles.ts
2934
2912
  var import_react28 = require("@emotion/react");
2935
- var menuContainer = import_react28.css`
2936
- position: relative;
2937
- `;
2938
2913
  var menuBtn = import_react28.css`
2939
2914
  background: none;
2940
2915
  border: none;
2941
2916
  color: var(--gray-300);
2942
2917
  padding: 0;
2943
- position: absolute;
2944
- bottom: 25%;
2945
- right: var(--spacing-sm);
2946
2918
  `;
2947
2919
  var menuItemTextGroup = import_react28.css`
2948
2920
  align-items: flex-start;
@@ -2971,7 +2943,7 @@ var import_design_system14 = require("@uniformdev/design-system");
2971
2943
  var import_react_hook_form = require("react-hook-form");
2972
2944
  var import_zod2 = require("zod");
2973
2945
 
2974
- // src/components/Variables/InputVariables.styles.ts
2946
+ // src/components/Variables/styles/VariableEditor.styles.ts
2975
2947
  var import_react29 = require("@emotion/react");
2976
2948
  var variablesFormContainer = import_react29.css`
2977
2949
  > * {
@@ -3085,6 +3057,7 @@ function VariablesProvider({
3085
3057
  const events = React10.useMemo(() => (0, import_mitt.default)(), []);
3086
3058
  const Editor = editVariableComponent != null ? editVariableComponent : VariableEditor;
3087
3059
  const contextValue = {
3060
+ flatVariables: flattenVariables(value),
3088
3061
  dispatch: (event) => {
3089
3062
  if (event.type === "set") {
3090
3063
  const { name, ...varValue } = event.variable;
@@ -3106,7 +3079,8 @@ function VariablesProvider({
3106
3079
  },
3107
3080
  variables: value,
3108
3081
  isEditing: typeof editing !== "undefined",
3109
- events
3082
+ events,
3083
+ canDispatch: true
3110
3084
  };
3111
3085
  return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(VariablesContext.Provider, { value: contextValue, children: [
3112
3086
  children,
@@ -3125,63 +3099,76 @@ function VariablesProvider({
3125
3099
  ) : null
3126
3100
  ] });
3127
3101
  }
3128
- function useVariables() {
3102
+ function useVariables(returnEmptyWithoutProvider = false) {
3129
3103
  const context = React10.useContext(VariablesContext);
3130
3104
  if (!context) {
3105
+ if (returnEmptyWithoutProvider) {
3106
+ return {
3107
+ flatVariables: {},
3108
+ dispatch: () => {
3109
+ throw new Error("No VariablesProvider present");
3110
+ },
3111
+ events: (0, import_mitt.default)(),
3112
+ isEditing: false,
3113
+ variables: {},
3114
+ canDispatch: false
3115
+ };
3116
+ }
3131
3117
  throw new Error("No VariablesProvider present");
3132
3118
  }
3133
3119
  return context;
3134
3120
  }
3121
+ function flattenVariables(variables) {
3122
+ const flatVariables = {};
3123
+ Object.entries(variables).forEach(([key, value]) => {
3124
+ flatVariables[key] = value.default;
3125
+ });
3126
+ return flatVariables;
3127
+ }
3135
3128
 
3136
3129
  // src/components/Variables/useOnVariableUpdated.ts
3137
- function useOnVariableUpdated(fn, disabled) {
3130
+ function useOnVariableUpdated(fn2, disabled) {
3138
3131
  const { variables, events } = useVariables();
3139
3132
  (0, import_react30.useEffect)(() => {
3140
3133
  if (disabled) {
3141
3134
  return;
3142
3135
  }
3143
- events.on("update", fn);
3144
- return () => events.off("update", fn);
3145
- }, [disabled, events, fn, variables]);
3136
+ events.on("update", fn2);
3137
+ return () => events.off("update", fn2);
3138
+ }, [disabled, events, fn2, variables]);
3146
3139
  }
3147
3140
 
3148
3141
  // src/components/Variables/variablesToList.ts
3149
3142
  function variablesToList(variables) {
3150
- return Object.entries(variables || {}).sort(([aKey, a], [bKey, b]) => {
3143
+ return Object.entries(variables || {}).sort(([aKey, a2], [bKey, b2]) => {
3151
3144
  var _a, _b;
3152
- if (a.order && b.order) {
3153
- return a.order - b.order;
3154
- } else if (a.order) {
3145
+ if (a2.order && b2.order) {
3146
+ return a2.order - b2.order;
3147
+ } else if (a2.order) {
3155
3148
  return 1;
3156
- } else if (b.order) {
3149
+ } else if (b2.order) {
3157
3150
  return -1;
3158
3151
  }
3159
- return ((_a = a.displayName) != null ? _a : aKey).localeCompare((_b = b.displayName) != null ? _b : bKey);
3152
+ return ((_a = a2.displayName) != null ? _a : aKey).localeCompare((_b = b2.displayName) != null ? _b : bKey);
3160
3153
  }).map(([name, definition]) => ({
3161
3154
  name,
3162
3155
  ...definition
3163
3156
  }));
3164
3157
  }
3165
3158
 
3166
- // src/components/Variables/InsertVariableMenu.tsx
3159
+ // src/components/Variables/SelectVariableMenu.tsx
3167
3160
  var import_jsx_runtime30 = require("@emotion/react/jsx-runtime");
3168
- var InsertVariableMenu = ({
3161
+ var SelectVariableMenu = ({
3169
3162
  onSelectVariable,
3170
- children,
3171
- textValue,
3172
- trigger = "${",
3163
+ onResetVariables,
3173
3164
  showAddVariableMenuOption = false,
3174
- disabled = false,
3175
- forceVisible
3165
+ forceVisible,
3166
+ buttonCss,
3167
+ buttonProps,
3168
+ tip
3176
3169
  }) => {
3177
- const { variables, dispatch, isEditing } = useVariables();
3170
+ const { variables, dispatch, isEditing, canDispatch } = useVariables();
3178
3171
  const btnRef = (0, import_react31.useRef)(null);
3179
- const tip = `Tip: access this list by typing ${trigger}`;
3180
- (0, import_react31.useEffect)(() => {
3181
- if (textValue === trigger && btnRef.current && btnRef.current.getAttribute("aria-expanded") === "false") {
3182
- btnRef.current.click();
3183
- }
3184
- }, [textValue, btnRef, trigger]);
3185
3172
  const [openedAdd, setOpenedAdd] = (0, import_react31.useState)(false);
3186
3173
  useOnVariableUpdated((varName) => {
3187
3174
  onSelectVariable == null ? void 0 : onSelectVariable({ name: varName, default: "" });
@@ -3191,143 +3178,312 @@ var InsertVariableMenu = ({
3191
3178
  setOpenedAdd(false);
3192
3179
  }
3193
3180
  }, [isEditing, openedAdd]);
3194
- if (disabled) {
3195
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_jsx_runtime30.Fragment, { children });
3196
- }
3197
3181
  const variablesList = variablesToList(variables);
3198
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { css: menuContainer, children: [
3199
- children,
3200
- /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
3201
- import_design_system15.Menu,
3202
- {
3203
- placement: "bottom-start",
3204
- forceVisible,
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" }) }),
3206
- menuLabel: "Insert variable",
3207
- children: [
3208
- variablesList.map((variable) => {
3209
- const { name, helpText } = variable;
3210
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
3211
- import_design_system15.MenuItem,
3212
- {
3213
- id: name,
3214
- css: menuItemTextGroup,
3215
- onClick: () => onSelectVariable == null ? void 0 : onSelectVariable(variable),
3216
- children: [
3217
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: name }),
3218
- helpText ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("small", { css: smallText, children: helpText }) : null
3219
- ]
3182
+ const menuHasVariableOptions = Object.entries(variables).length || showAddVariableMenuOption;
3183
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
3184
+ import_design_system15.Menu,
3185
+ {
3186
+ placement: "bottom-start",
3187
+ forceVisible,
3188
+ menuTrigger: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3189
+ "button",
3190
+ {
3191
+ title: "Insert variable",
3192
+ ...buttonProps,
3193
+ ref: btnRef,
3194
+ css: [menuBtn, buttonCss],
3195
+ type: "button",
3196
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_cg5.CgUsbC, { size: "1.4rem" })
3197
+ }
3198
+ ),
3199
+ menuLabel: "Insert variable",
3200
+ children: [
3201
+ variablesList.map((variable) => {
3202
+ const { name, helpText } = variable;
3203
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
3204
+ import_design_system15.MenuItem,
3205
+ {
3206
+ id: name,
3207
+ css: menuItemTextGroup,
3208
+ onClick: () => onSelectVariable == null ? void 0 : onSelectVariable(variable),
3209
+ children: [
3210
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: name }),
3211
+ helpText ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("small", { css: smallText, children: helpText }) : null
3212
+ ]
3213
+ },
3214
+ name
3215
+ );
3216
+ }),
3217
+ showAddVariableMenuOption && canDispatch ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
3218
+ variablesList.length ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_design_system15.MenuItemSeparator, {}) : null,
3219
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3220
+ import_design_system15.MenuItem,
3221
+ {
3222
+ onClick: () => {
3223
+ setOpenedAdd(true);
3224
+ dispatch({ type: "edit", variable: "" });
3220
3225
  },
3221
- name
3222
- );
3223
- }),
3224
- showAddVariableMenuOption ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
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
- )
3236
- ] }) : null,
3237
- Object.entries(variables).length || showAddVariableMenuOption ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_design_system15.MenuItemSeparator, {}) : null,
3238
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("i", { css: variablesTipText, children: tip })
3239
- ]
3240
- }
3241
- )
3242
- ] });
3226
+ children: "Add Variable"
3227
+ }
3228
+ )
3229
+ ] }) : null,
3230
+ menuHasVariableOptions && onResetVariables ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_design_system15.MenuItemSeparator, {}) : null,
3231
+ onResetVariables ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_design_system15.MenuItem, { onClick: onResetVariables, css: { color: "var(--brand-secondary-5)" }, children: "Reset" }) : null,
3232
+ tip && (menuHasVariableOptions || onResetVariables) ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_design_system15.MenuItemSeparator, {}) : null,
3233
+ tip ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("i", { css: variablesTipText, children: tip }) : null
3234
+ ]
3235
+ }
3236
+ );
3243
3237
  };
3244
3238
 
3245
- // src/components/Variables/InputVariables.tsx
3239
+ // src/components/Variables/styles/InputVariables.styles.ts
3240
+ var import_react32 = require("@emotion/react");
3241
+ var menuContainer = import_react32.css`
3242
+ position: relative;
3243
+ `;
3244
+ var menuBtn2 = import_react32.css`
3245
+ position: absolute;
3246
+ bottom: 25%;
3247
+ right: var(--spacing-sm);
3248
+ `;
3249
+
3250
+ // src/components/Variables/util/variableExpression.ts
3251
+ var variableExpression = /(?<!\\)\${([^}]+)}/g;
3252
+ var variablePrefix = "${";
3253
+ var variableSuffix = "}";
3254
+
3255
+ // src/components/Variables/util/getReferencedVariables.ts
3256
+ function getReferencedVariables(value) {
3257
+ const result = [];
3258
+ for (const match of value.matchAll(variableExpression)) {
3259
+ result.push(match[1]);
3260
+ }
3261
+ return result;
3262
+ }
3263
+
3264
+ // src/components/Variables/util/insertVariableIntoText.ts
3265
+ function insertVariableIntoText({
3266
+ variableName: variableName2,
3267
+ value,
3268
+ selectionStart = null,
3269
+ selectionEnd = null
3270
+ }) {
3271
+ const variableExpression2 = `${variablePrefix}${variableName2}${variableSuffix}`;
3272
+ if (selectionStart !== null && selectionEnd !== null && selectionStart !== selectionEnd) {
3273
+ return `${value.substring(0, selectionStart)}${variableExpression2}${value.substring(selectionEnd)}`;
3274
+ }
3275
+ const hasCursorPosition = selectionStart !== null;
3276
+ let startOffset = 0;
3277
+ if (hasCursorPosition && value.substring(selectionStart - variablePrefix.length, selectionStart) === variablePrefix) {
3278
+ startOffset = variablePrefix.length;
3279
+ }
3280
+ if (hasCursorPosition) {
3281
+ return `${value.substring(0, selectionStart - startOffset)}${variableExpression2}${value.substring(
3282
+ selectionStart
3283
+ )}`;
3284
+ }
3285
+ return `${value}${variableExpression2}`;
3286
+ }
3287
+
3288
+ // src/components/Variables/styles/VariableField.styles.ts
3289
+ var import_react33 = require("@emotion/react");
3290
+ var labelText = import_react33.css`
3291
+ align-items: center;
3292
+ display: flex;
3293
+ gap: var(--spacing-xs);
3294
+ font-weight: var(--fw-regular);
3295
+ margin: 0 0 var(--spacing-xs);
3296
+ `;
3297
+ var variableBindButton = import_react33.css`
3298
+ align-items: center;
3299
+ border: none;
3300
+ border-radius: var(--rounded-base);
3301
+ background: none;
3302
+ display: flex;
3303
+ height: 1.2rem;
3304
+ padding: var(--spacing-2xs);
3305
+ transition: background var(--duration-fast) var(--timing-ease-out),
3306
+ color var(--duration-fast) var(--timing-ease-out);
3307
+ width: 1.2rem;
3308
+
3309
+ &:hover,
3310
+ &[aria-pressed='true']:not(:disabled) {
3311
+ background: var(--brand-secondary-3);
3312
+ color: var(--white);
3313
+ }
3314
+
3315
+ &[aria-disabled='true'] {
3316
+ background: none;
3317
+ color: currentColor;
3318
+ }
3319
+ `;
3320
+
3321
+ // src/components/Variables/VariableField.tsx
3246
3322
  var import_jsx_runtime31 = require("@emotion/react/jsx-runtime");
3323
+ function VariableField({
3324
+ label,
3325
+ selectVariableMenuOptions,
3326
+ children,
3327
+ id,
3328
+ isActive,
3329
+ disableVariables
3330
+ }) {
3331
+ const { variables } = useVariables(true);
3332
+ const varCount = Object.keys(variables).length;
3333
+ const variableSelector = varCount > 0 && (selectVariableMenuOptions == null ? void 0 : selectVariableMenuOptions.onSelectVariable) && !disableVariables ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3334
+ SelectVariableMenu,
3335
+ {
3336
+ ...selectVariableMenuOptions,
3337
+ buttonCss: [variableBindButton, selectVariableMenuOptions == null ? void 0 : selectVariableMenuOptions.buttonCss],
3338
+ buttonProps: isActive ? { "aria-pressed": "true" } : void 0
3339
+ }
3340
+ ) : null;
3341
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { children: [
3342
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { htmlFor: id, css: labelText, children: [
3343
+ variableSelector,
3344
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: label })
3345
+ ] }),
3346
+ children
3347
+ ] });
3348
+ }
3349
+
3350
+ // src/components/Variables/InputVariables.tsx
3351
+ var import_jsx_runtime32 = require("@emotion/react/jsx-runtime");
3247
3352
  function InputVariables({
3353
+ id,
3248
3354
  "aria-label": ariaLabel,
3355
+ label,
3249
3356
  value,
3250
3357
  disableVariables,
3358
+ disableReset,
3359
+ disableInlineMenu,
3251
3360
  onChange,
3252
3361
  onPaste,
3253
3362
  showAddVariableMenuOption,
3254
- variablePrefix = "${",
3255
- variableSuffix = "}",
3363
+ inputWhenNoVariables,
3364
+ caption,
3365
+ errorMessage,
3366
+ warningMessage,
3367
+ infoMessage,
3256
3368
  ...inputProps
3257
3369
  }) {
3258
3370
  var _a, _b;
3259
- const { variables, dispatch } = useVariables();
3260
- const currentVariables = React11.useRef(variables);
3261
- const currentDispatch = React11.useRef(dispatch);
3262
- const currentSetValue = React11.useRef(onChange);
3371
+ const { variables } = useVariables(true);
3263
3372
  const inputRef = React11.useRef(null);
3264
- React11.useEffect(() => {
3265
- currentVariables.current = variables;
3266
- }, [variables]);
3267
- React11.useEffect(() => {
3268
- currentDispatch.current = dispatch;
3269
- }, [dispatch]);
3270
- React11.useEffect(() => {
3271
- currentSetValue.current = onChange;
3272
- }, [onChange]);
3273
- const onPasteHandler = () => {
3274
- setTimeout(() => {
3275
- if (!inputRef.current) {
3276
- return;
3277
- }
3278
- onPaste == null ? void 0 : onPaste(inputRef.current.value);
3279
- });
3373
+ const [finalId] = React11.useState(id != null ? id : () => (0, import_uuid2.v4)());
3374
+ const onPasteHandler = (e) => {
3375
+ var _a2, _b2, _c;
3376
+ if (!onPaste) {
3377
+ return;
3378
+ }
3379
+ const pastedValue = (_a2 = e.clipboardData) == null ? void 0 : _a2.getData("text/plain");
3380
+ if (!pastedValue || !e.currentTarget) {
3381
+ return;
3382
+ }
3383
+ const selectionStart = (_b2 = e.currentTarget.selectionStart) != null ? _b2 : 0;
3384
+ const selectionEnd = (_c = e.currentTarget.selectionEnd) != null ? _c : 0;
3385
+ const newValue = e.currentTarget.value.substring(0, selectionStart) + pastedValue + e.currentTarget.value.substring(selectionEnd);
3386
+ onPaste(newValue);
3387
+ e.preventDefault();
3280
3388
  };
3389
+ const currentCursor = (_b = (_a = inputRef.current) == null ? void 0 : _a.selectionStart) != null ? _b : value.length;
3390
+ const forceMenu = value.substring(currentCursor - 2, currentCursor) === variablePrefix;
3391
+ const hasVariablesInValue = getReferencedVariables(value).length > 0;
3392
+ const [hadVariablesInValue, setHadVariablesInValue] = React11.useState(hasVariablesInValue);
3393
+ React11.useEffect(() => {
3394
+ if (hasVariablesInValue) {
3395
+ setHadVariablesInValue(true);
3396
+ }
3397
+ }, [hasVariablesInValue]);
3398
+ const disableVariablesForReals = disableVariables || Object.keys(variables).length === 0 && !showAddVariableMenuOption;
3399
+ const disableInlineVariablesForReals = disableVariablesForReals || disableInlineMenu;
3281
3400
  const handleInsertVariable = (variable) => {
3282
3401
  var _a2, _b2;
3402
+ const baseValue = inputWhenNoVariables && !hasVariablesInValue ? "" : value;
3283
3403
  handleSetValue(
3284
3404
  insertVariableIntoText({
3285
3405
  variableName: variable.name,
3286
- value,
3287
- variablePrefix,
3288
- variableSuffix,
3406
+ value: baseValue,
3289
3407
  selectionEnd: (_a2 = inputRef.current) == null ? void 0 : _a2.selectionEnd,
3290
3408
  selectionStart: (_b2 = inputRef.current) == null ? void 0 : _b2.selectionStart
3291
3409
  })
3292
3410
  );
3293
3411
  };
3294
3412
  const handleSetValue = (rawValue) => {
3295
- currentSetValue.current(rawValue);
3413
+ onChange(rawValue);
3296
3414
  };
3297
- const currentCursor = (_b = (_a = inputRef.current) == null ? void 0 : _a.selectionStart) != null ? _b : value.length;
3298
- const forceMenu = value.substring(currentCursor - 2, currentCursor) === "${";
3299
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3300
- InsertVariableMenu,
3301
- {
3302
- showAddVariableMenuOption,
3303
- textValue: value,
3304
- onSelectVariable: handleInsertVariable,
3305
- disabled: disableVariables,
3306
- forceVisible: forceMenu || void 0,
3307
- children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3308
- import_design_system16.Input,
3309
- {
3310
- ref: inputRef,
3311
- label: ariaLabel,
3312
- showLabel: false,
3313
- value,
3314
- onChange: (e) => handleSetValue(e.currentTarget.value),
3315
- onPaste: onPasteHandler,
3316
- ...inputProps
3317
- }
3318
- )
3319
- }
3320
- );
3415
+ const sharedMenuProps = {
3416
+ onSelectVariable: handleInsertVariable,
3417
+ showAddVariableMenuOption,
3418
+ onResetVariables: hadVariablesInValue && !disableReset ? () => {
3419
+ handleSetValue("");
3420
+ setHadVariablesInValue(false);
3421
+ } : void 0
3422
+ };
3423
+ const input = /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { children: [
3424
+ inputWhenNoVariables && !hadVariablesInValue ? inputWhenNoVariables : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3425
+ InputVariablesShell,
3426
+ {
3427
+ ...sharedMenuProps,
3428
+ disabled: disableInlineVariablesForReals,
3429
+ forceVisible: forceMenu || void 0,
3430
+ children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3431
+ import_design_system16.Input,
3432
+ {
3433
+ id: finalId,
3434
+ ref: inputRef,
3435
+ label: ariaLabel,
3436
+ showLabel: false,
3437
+ value,
3438
+ onChange: (e) => handleSetValue(e.currentTarget.value),
3439
+ onPaste: onPasteHandler,
3440
+ ...inputProps
3441
+ }
3442
+ )
3443
+ }
3444
+ ),
3445
+ caption ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system16.Caption, { children: caption }) : null,
3446
+ errorMessage ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system16.ErrorMessage, { message: errorMessage }) : null,
3447
+ warningMessage ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system16.WarningMessage, { message: warningMessage }) : null,
3448
+ infoMessage ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system16.InfoMessage, { message: infoMessage }) : null
3449
+ ] });
3450
+ if (label) {
3451
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3452
+ VariableField,
3453
+ {
3454
+ label,
3455
+ selectVariableMenuOptions: sharedMenuProps,
3456
+ id: finalId,
3457
+ isActive: hadVariablesInValue,
3458
+ disableVariables: disableVariablesForReals,
3459
+ children: input
3460
+ }
3461
+ );
3462
+ }
3463
+ return input;
3464
+ }
3465
+ function InputVariablesShell({
3466
+ children,
3467
+ disabled,
3468
+ ...props
3469
+ }) {
3470
+ if (disabled) {
3471
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_jsx_runtime32.Fragment, { children });
3472
+ }
3473
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { css: menuContainer, children: [
3474
+ children,
3475
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(SelectVariableMenu, { ...props, tip: "Tip: access this list by typing ${", buttonCss: menuBtn2 })
3476
+ ] });
3321
3477
  }
3322
3478
 
3323
3479
  // src/components/Variables/VariablesList.tsx
3324
- var import_react33 = require("@emotion/react");
3480
+ var import_react35 = require("@emotion/react");
3325
3481
  var import_design_system17 = require("@uniformdev/design-system");
3326
3482
  var import_react_beautiful_dnd2 = require("react-beautiful-dnd");
3327
3483
 
3328
3484
  // src/components/Variables/styles/VariablesList.styles.ts
3329
- var import_react32 = require("@emotion/react");
3330
- var tableRow = (isDragging) => import_react32.css`
3485
+ var import_react34 = require("@emotion/react");
3486
+ var tableRow = (isDragging) => import_react34.css`
3331
3487
  position: relative;
3332
3488
  ${isDragging ? `
3333
3489
  display: table;
@@ -3335,7 +3491,7 @@ var tableRow = (isDragging) => import_react32.css`
3335
3491
  top: auto !important;
3336
3492
  ` : void 0}
3337
3493
  `;
3338
- var tableCellDragIcon = import_react32.css`
3494
+ var tableCellDragIcon = import_react34.css`
3339
3495
  &::after {
3340
3496
  content: '';
3341
3497
  display: block;
@@ -3353,7 +3509,7 @@ var tableCellDragIcon = import_react32.css`
3353
3509
  opacity: 1;
3354
3510
  }
3355
3511
  `;
3356
- var variableName = import_react32.css`
3512
+ var variableName = import_react34.css`
3357
3513
  border: none;
3358
3514
  color: var(--brand-secondary-5);
3359
3515
  font-weight: var(--fw-medium);
@@ -3364,7 +3520,7 @@ var variableName = import_react32.css`
3364
3520
  white-space: nowrap;
3365
3521
  max-width: 20ch;
3366
3522
  `;
3367
- var variableValue = import_react32.css`
3523
+ var variableValue = import_react34.css`
3368
3524
  overflow: hidden;
3369
3525
  text-overflow: ellipsis;
3370
3526
  white-space: nowrap;
@@ -3372,7 +3528,7 @@ var variableValue = import_react32.css`
3372
3528
  `;
3373
3529
 
3374
3530
  // src/components/Variables/VariablesList.tsx
3375
- var import_jsx_runtime32 = require("@emotion/react/jsx-runtime");
3531
+ var import_jsx_runtime33 = require("@emotion/react/jsx-runtime");
3376
3532
  function VariablesList() {
3377
3533
  const { variables, dispatch } = useVariables();
3378
3534
  const sorted = variablesToList(variables);
@@ -3393,23 +3549,23 @@ function VariablesList() {
3393
3549
  return result;
3394
3550
  }
3395
3551
  };
3396
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
3397
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_beautiful_dnd2.DragDropContext, { onDragEnd: (res) => onDragEnd(res), children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_beautiful_dnd2.Droppable, { droppableId: "variables-table", children: (provided) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_design_system17.Table, { ...provided.droppableProps, ref: provided.innerRef, children: [
3398
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system17.TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_design_system17.TableRow, { children: [
3399
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system17.TableCellHead, { children: "Name" }),
3400
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system17.TableCellHead, { children: "Default Value" }),
3401
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system17.TableCellHead, {})
3552
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
3553
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_beautiful_dnd2.DragDropContext, { onDragEnd: (res) => onDragEnd(res), children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_beautiful_dnd2.Droppable, { droppableId: "variables-table", children: (provided) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_design_system17.Table, { ...provided.droppableProps, ref: provided.innerRef, children: [
3554
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system17.TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_design_system17.TableRow, { children: [
3555
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system17.TableCellHead, { children: "Name" }),
3556
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system17.TableCellHead, { children: "Default Value" }),
3557
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system17.TableCellHead, {})
3402
3558
  ] }) }),
3403
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_design_system17.TableBody, { children: [
3559
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_design_system17.TableBody, { children: [
3404
3560
  sorted.map(({ name, displayName, default: defaultValue }, index) => {
3405
3561
  const text = displayName != null ? displayName : name;
3406
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3562
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3407
3563
  import_react_beautiful_dnd2.Draggable,
3408
3564
  {
3409
3565
  draggableId: name,
3410
3566
  index,
3411
3567
  isDragDisabled: sorted.length === 1,
3412
- children: (provided2, snapshot) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
3568
+ children: (provided2, snapshot) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
3413
3569
  import_design_system17.TableRow,
3414
3570
  {
3415
3571
  ref: provided2.innerRef,
@@ -3419,7 +3575,7 @@ function VariablesList() {
3419
3575
  css: tableRow(snapshot.isDragging),
3420
3576
  "data-dragging": snapshot.isDragging,
3421
3577
  children: [
3422
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system17.TableCellData, { css: sorted.length > 1 ? tableCellDragIcon : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3578
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system17.TableCellData, { css: sorted.length > 1 ? tableCellDragIcon : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3423
3579
  "button",
3424
3580
  {
3425
3581
  css: variableName,
@@ -3432,21 +3588,21 @@ function VariablesList() {
3432
3588
  children: text
3433
3589
  }
3434
3590
  ) }),
3435
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system17.TableCellData, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { css: variableValue, title: defaultValue, children: defaultValue }) }),
3436
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system17.TableCellData, { align: "right", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3591
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system17.TableCellData, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { css: variableValue, title: defaultValue, children: defaultValue }) }),
3592
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system17.TableCellData, { align: "right", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3437
3593
  "button",
3438
3594
  {
3439
3595
  type: "button",
3440
3596
  title: `delete ${text}`,
3441
3597
  css: [
3442
3598
  import_design_system17.button,
3443
- import_react33.css`
3599
+ import_react35.css`
3444
3600
  background: transparent;
3445
3601
  `
3446
3602
  ],
3447
3603
  "aria-controls": text,
3448
3604
  onClick: () => dispatch({ type: "remove", variable: name }),
3449
- children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system17.Icon, { icon: "trash", iconColor: "red" })
3605
+ children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system17.Icon, { icon: "trash", iconColor: "red" })
3450
3606
  }
3451
3607
  ) })
3452
3608
  ]
@@ -3459,7 +3615,7 @@ function VariablesList() {
3459
3615
  provided.placeholder
3460
3616
  ] })
3461
3617
  ] }) }) }),
3462
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3618
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3463
3619
  import_design_system17.AddListButton,
3464
3620
  {
3465
3621
  onButtonClick: () => dispatch({ type: "edit", variable: "" }),
@@ -3472,28 +3628,90 @@ function VariablesList() {
3472
3628
  ] });
3473
3629
  }
3474
3630
 
3475
- // src/components/DataResourceVariablesList.tsx
3476
- var import_jsx_runtime33 = require("@emotion/react/jsx-runtime");
3477
- function DataResourceVariablesList({
3478
- setVariables,
3479
- noVariables: NoVariablesComponent,
3480
- typeRenderers
3631
+ // src/components/DataResourceDynamicInputProvider.tsx
3632
+ var import_jsx_runtime34 = require("@emotion/react/jsx-runtime");
3633
+ function DataResourceDynamicInputProvider({
3634
+ children,
3635
+ dynamicInputs
3636
+ }) {
3637
+ if (dynamicInputs) {
3638
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(DataResourceDynamicInputProviderRenderer, { dynamicInputs, children });
3639
+ }
3640
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(DataResourceDynamicInputProviderContextShim, { children });
3641
+ }
3642
+ function DataResourceDynamicInputProviderContextShim(props) {
3643
+ const {
3644
+ metadata: { dynamicInputs }
3645
+ } = useMeshLocation("dataResource");
3646
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(DataResourceDynamicInputProviderRenderer, { ...props, dynamicInputs });
3647
+ }
3648
+ function DataResourceDynamicInputProviderRenderer({
3649
+ children,
3650
+ dynamicInputs
3481
3651
  }) {
3652
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3653
+ VariablesProvider,
3654
+ {
3655
+ value: convertDynamicInputsToVariables(dynamicInputs),
3656
+ onChange: () => {
3657
+ throw new Error("Cannot change dynamic inputs. Make sure that add variable is disabled.");
3658
+ },
3659
+ editVariableComponent: () => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { children: "Cannot edit dynamic inputs." }),
3660
+ children
3661
+ }
3662
+ );
3663
+ }
3664
+ function convertDynamicInputsToVariables(dynamicInputs) {
3665
+ return Object.entries(dynamicInputs).reduce(
3666
+ (acc, [name, input]) => {
3667
+ acc[name] = {
3668
+ type: input.type,
3669
+ default: input.value,
3670
+ helpText: `${input.value}, from ${input.type === "path" ? "URL path" : "query string"}`
3671
+ };
3672
+ return acc;
3673
+ },
3674
+ {}
3675
+ );
3676
+ }
3677
+
3678
+ // src/components/DataResourceVariablesList.tsx
3679
+ var import_design_system18 = require("@uniformdev/design-system");
3680
+ var import_jsx_runtime35 = require("@emotion/react/jsx-runtime");
3681
+ function DataResourceVariablesList(props) {
3482
3682
  const {
3483
3683
  value,
3484
- metadata: { dataType }
3684
+ metadata: { dataType, dynamicInputs }
3485
3685
  } = useMeshLocation("dataResource");
3686
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
3687
+ DataResourceVariablesListExplicit,
3688
+ {
3689
+ ...props,
3690
+ value,
3691
+ dataType,
3692
+ dynamicInputs
3693
+ }
3694
+ );
3695
+ }
3696
+ function DataResourceVariablesListExplicit({
3697
+ setVariables,
3698
+ noVariables: NoVariablesComponent,
3699
+ typeRenderers,
3700
+ dataType,
3701
+ dynamicInputs,
3702
+ value
3703
+ }) {
3486
3704
  const variableDefinitions = variablesToList(dataType.variables);
3487
3705
  if (variableDefinitions.length === 0) {
3488
3706
  if (NoVariablesComponent) {
3489
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(NoVariablesComponent, {});
3707
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(NoVariablesComponent, {});
3490
3708
  }
3491
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system18.Callout, { type: "note", children: "No settings are required." });
3709
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_design_system18.Callout, { type: "note", children: "No settings are required." });
3492
3710
  }
3493
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { children: variableDefinitions.map((variableDefinition) => {
3711
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(DataResourceDynamicInputProvider, { dynamicInputs, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { children: variableDefinitions.map((variableDefinition) => {
3494
3712
  var _a, _b, _c;
3495
3713
  const VariableRenderer = variableDefinition.type ? (_a = typeRenderers == null ? void 0 : typeRenderers[variableDefinition.type]) != null ? _a : TextVariableRenderer : TextVariableRenderer;
3496
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3714
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
3497
3715
  VariableRenderer,
3498
3716
  {
3499
3717
  definition: variableDefinition,
@@ -3512,36 +3730,29 @@ function DataResourceVariablesList({
3512
3730
  }
3513
3731
  }
3514
3732
  ) }, variableDefinition.name);
3515
- }) });
3733
+ }) }) });
3516
3734
  }
3517
3735
  function TextVariableRenderer({ definition, value, setValue }) {
3518
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { children: [
3519
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3520
- import_design_system18.Input,
3521
- {
3522
- label: definition.displayName || definition.name,
3523
- value,
3524
- caption: definition.helpText,
3525
- onChange: (e) => {
3526
- setValue(e.target.value);
3527
- }
3528
- }
3529
- ),
3530
- definition.default !== "" ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("small", { children: [
3531
- "Default value: ",
3532
- definition.default
3533
- ] }) : null
3534
- ] });
3736
+ var _a;
3737
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
3738
+ InputVariables,
3739
+ {
3740
+ label: definition.displayName || definition.name,
3741
+ value: value != null ? value : "",
3742
+ caption: (_a = definition.helpText) != null ? _a : definition.default !== "" ? `Default value: ${definition.default}` : void 0,
3743
+ onChange: setValue
3744
+ }
3745
+ ) });
3535
3746
  }
3536
3747
 
3537
3748
  // src/components/Request/RequestBody.tsx
3538
- var import_react35 = require("@emotion/react");
3749
+ var import_react37 = require("@emotion/react");
3539
3750
  var import_design_system19 = require("@uniformdev/design-system");
3540
- var import_react36 = require("react");
3751
+ var import_react38 = require("react");
3541
3752
 
3542
3753
  // src/components/Request/RequestProvider.tsx
3543
3754
  var React12 = __toESM(require("react"));
3544
- var import_jsx_runtime34 = require("@emotion/react/jsx-runtime");
3755
+ var import_jsx_runtime36 = require("@emotion/react/jsx-runtime");
3545
3756
  var RequestContext = React12.createContext(null);
3546
3757
  function RequestProvider({ value, onChange, children }) {
3547
3758
  const contextValue = React12.useMemo(() => {
@@ -3610,7 +3821,7 @@ function RequestProvider({ value, onChange, children }) {
3610
3821
  request: value
3611
3822
  };
3612
3823
  }, [onChange, value]);
3613
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(RequestContext.Provider, { value: contextValue, children });
3824
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(RequestContext.Provider, { value: contextValue, children });
3614
3825
  }
3615
3826
  function useRequest() {
3616
3827
  const context = React12.useContext(RequestContext);
@@ -3621,11 +3832,11 @@ function useRequest() {
3621
3832
  }
3622
3833
 
3623
3834
  // src/components/Request/styles/Request.styles.ts
3624
- var import_react34 = require("@emotion/react");
3625
- var innerContentStyles = import_react34.css`
3835
+ var import_react36 = require("@emotion/react");
3836
+ var innerContentStyles = import_react36.css`
3626
3837
  background: var(--white);
3627
3838
  `;
3628
- var requestTypeContainer = (bgColor) => import_react34.css`
3839
+ var requestTypeContainer = (bgColor) => import_react36.css`
3629
3840
  align-items: start;
3630
3841
  background: ${bgColor};
3631
3842
  display: grid;
@@ -3634,17 +3845,17 @@ var requestTypeContainer = (bgColor) => import_react34.css`
3634
3845
  `;
3635
3846
 
3636
3847
  // src/components/Request/RequestTypeContainer.tsx
3637
- var import_jsx_runtime35 = require("@emotion/react/jsx-runtime");
3848
+ var import_jsx_runtime37 = require("@emotion/react/jsx-runtime");
3638
3849
  var RequestTypeContainer = ({
3639
3850
  bgColor = "transparent",
3640
3851
  children,
3641
3852
  ...props
3642
3853
  }) => {
3643
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { css: requestTypeContainer(bgColor), ...props, children });
3854
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { css: requestTypeContainer(bgColor), ...props, children });
3644
3855
  };
3645
3856
 
3646
3857
  // src/components/Request/RequestBody.tsx
3647
- var import_jsx_runtime36 = require("@emotion/react/jsx-runtime");
3858
+ var import_jsx_runtime38 = require("@emotion/react/jsx-runtime");
3648
3859
  var LANGUAGE_OPTIONS = [
3649
3860
  { label: "Text", value: "plaintext" },
3650
3861
  { label: "JSON", value: "json" },
@@ -3663,22 +3874,22 @@ var LANGUAGE_TO_CONTENT_TYPE = {
3663
3874
  };
3664
3875
  function RequestBody() {
3665
3876
  const { request, dispatch } = useRequest();
3666
- const [language, setLanguage] = (0, import_react36.useState)("json");
3667
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
3877
+ const [language, setLanguage] = (0, import_react38.useState)("json");
3878
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
3668
3879
  "div",
3669
3880
  {
3670
- css: import_react35.css`
3881
+ css: import_react37.css`
3671
3882
  background: var(--white);
3672
3883
  `,
3673
3884
  children: [
3674
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
3885
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
3675
3886
  RequestTypeContainer,
3676
3887
  {
3677
3888
  bgColor: "var(--gray-100)",
3678
- css: import_react35.css`
3889
+ css: import_react37.css`
3679
3890
  padding: var(--spacing-sm) var(--spacing-base);
3680
3891
  `,
3681
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
3892
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
3682
3893
  import_design_system19.InputSelect,
3683
3894
  {
3684
3895
  label: "Language",
@@ -3701,7 +3912,7 @@ function RequestBody() {
3701
3912
  )
3702
3913
  }
3703
3914
  ),
3704
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
3915
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
3705
3916
  import_design_system19.JsonEditor,
3706
3917
  {
3707
3918
  height: 200,
@@ -3720,7 +3931,7 @@ function RequestBody() {
3720
3931
 
3721
3932
  // src/components/Request/RequestHeaders.tsx
3722
3933
  var import_design_system20 = require("@uniformdev/design-system");
3723
- var import_jsx_runtime37 = require("@emotion/react/jsx-runtime");
3934
+ var import_jsx_runtime39 = require("@emotion/react/jsx-runtime");
3724
3935
  function RequestHeaders({ disableVariables }) {
3725
3936
  var _a, _b;
3726
3937
  const { dispatch, request } = useRequest();
@@ -3736,28 +3947,28 @@ function RequestHeaders({ disableVariables }) {
3736
3947
  index
3737
3948
  });
3738
3949
  };
3739
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { css: innerContentStyles, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_design_system20.Table, { children: [
3740
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_design_system20.TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_design_system20.TableRow, { children: [
3741
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_design_system20.TableCellHead, { children: "Name" }),
3742
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_design_system20.TableCellHead, { children: "Value" })
3950
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { css: innerContentStyles, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_design_system20.Table, { children: [
3951
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_design_system20.TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_design_system20.TableRow, { children: [
3952
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_design_system20.TableCellHead, { children: "Name" }),
3953
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_design_system20.TableCellHead, { children: "Value" })
3743
3954
  ] }) }),
3744
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_design_system20.TableBody, { children: [
3955
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_design_system20.TableBody, { children: [
3745
3956
  (_b = (_a = request.baseRequest) == null ? void 0 : _a.headers) == null ? void 0 : _b.map((baseHeader) => {
3746
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_design_system20.TableRow, { children: [
3747
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_design_system20.TableCellData, { width: "50%", children: [
3957
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_design_system20.TableRow, { children: [
3958
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_design_system20.TableCellData, { width: "50%", children: [
3748
3959
  baseHeader.key,
3749
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("br", {}),
3750
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("i", { css: { color: "var(--gray-500)" }, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("small", { children: "from data source" }) })
3960
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("br", {}),
3961
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("i", { css: { color: "var(--gray-500)" }, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("small", { children: "from data source" }) })
3751
3962
  ] }),
3752
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_design_system20.TableCellData, { width: "50%", children: [
3753
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("i", { css: { color: "var(--gray-500)" }, children: baseHeader.value }),
3754
- request.headers.find((p) => p.key === baseHeader.key) ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_design_system20.WarningMessage, { message: "overridden below" }) : null
3963
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_design_system20.TableCellData, { width: "50%", children: [
3964
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("i", { css: { color: "var(--gray-500)" }, children: baseHeader.value }),
3965
+ request.headers.find((p2) => p2.key === baseHeader.key) ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_design_system20.WarningMessage, { message: "overridden below" }) : null
3755
3966
  ] })
3756
3967
  ] }, baseHeader.key);
3757
3968
  }),
3758
3969
  deezHeaders.map((header, index) => {
3759
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_design_system20.TableRow, { children: [
3760
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_design_system20.TableCellData, { width: "50%", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3970
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_design_system20.TableRow, { children: [
3971
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_design_system20.TableCellData, { width: "50%", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
3761
3972
  import_design_system20.Input,
3762
3973
  {
3763
3974
  label: header.key,
@@ -3777,7 +3988,7 @@ function RequestHeaders({ disableVariables }) {
3777
3988
  "data-test-id": "header-key"
3778
3989
  }
3779
3990
  ) }),
3780
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_design_system20.TableCellData, { width: "50%", children: header.key ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3991
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_design_system20.TableCellData, { width: "50%", children: header.key ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
3781
3992
  InputVariables,
3782
3993
  {
3783
3994
  value: header.value,
@@ -3795,11 +4006,11 @@ function RequestHeaders({ disableVariables }) {
3795
4006
 
3796
4007
  // src/components/Request/RequestMethodSelect.tsx
3797
4008
  var import_design_system21 = require("@uniformdev/design-system");
3798
- var import_jsx_runtime38 = require("@emotion/react/jsx-runtime");
4009
+ var import_jsx_runtime40 = require("@emotion/react/jsx-runtime");
3799
4010
  function RequestMethodSelect(props) {
3800
4011
  var _a;
3801
4012
  const { request, dispatch } = useRequest();
3802
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
4013
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
3803
4014
  import_design_system21.InputSelect,
3804
4015
  {
3805
4016
  ...props,
@@ -3816,7 +4027,7 @@ function RequestMethodSelect(props) {
3816
4027
 
3817
4028
  // src/components/Request/RequestParameters.tsx
3818
4029
  var import_design_system22 = require("@uniformdev/design-system");
3819
- var import_jsx_runtime39 = require("@emotion/react/jsx-runtime");
4030
+ var import_jsx_runtime41 = require("@emotion/react/jsx-runtime");
3820
4031
  function RequestParameters({ disableVariables }) {
3821
4032
  var _a, _b;
3822
4033
  const { dispatch, request } = useRequest();
@@ -3832,28 +4043,28 @@ function RequestParameters({ disableVariables }) {
3832
4043
  index
3833
4044
  });
3834
4045
  };
3835
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { css: innerContentStyles, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_design_system22.Table, { children: [
3836
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_design_system22.TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_design_system22.TableRow, { children: [
3837
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_design_system22.TableCellHead, { children: "Name" }),
3838
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_design_system22.TableCellHead, { children: "Value" })
4046
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { css: innerContentStyles, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_design_system22.Table, { children: [
4047
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_design_system22.TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_design_system22.TableRow, { children: [
4048
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_design_system22.TableCellHead, { children: "Name" }),
4049
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_design_system22.TableCellHead, { children: "Value" })
3839
4050
  ] }) }),
3840
- /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_design_system22.TableBody, { children: [
4051
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_design_system22.TableBody, { children: [
3841
4052
  (_b = (_a = request.baseRequest) == null ? void 0 : _a.parameters) == null ? void 0 : _b.map((baseParameter) => {
3842
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_design_system22.TableRow, { children: [
3843
- /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_design_system22.TableCellData, { width: "50%", children: [
4053
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_design_system22.TableRow, { children: [
4054
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_design_system22.TableCellData, { width: "50%", children: [
3844
4055
  baseParameter.key,
3845
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("br", {}),
3846
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("i", { css: { color: "var(--gray-500)" }, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("small", { children: "from data source" }) })
4056
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("br", {}),
4057
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("i", { css: { color: "var(--gray-500)" }, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("small", { children: "from data source" }) })
3847
4058
  ] }),
3848
- /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_design_system22.TableCellData, { width: "50%", children: [
3849
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("i", { css: { color: "var(--gray-500)" }, children: baseParameter.value }),
3850
- request.parameters.find((p) => p.key === baseParameter.key) ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_design_system22.WarningMessage, { message: "overridden below" }) : null
4059
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_design_system22.TableCellData, { width: "50%", children: [
4060
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("i", { css: { color: "var(--gray-500)" }, children: baseParameter.value }),
4061
+ request.parameters.find((p2) => p2.key === baseParameter.key) ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_design_system22.WarningMessage, { message: "overridden below" }) : null
3851
4062
  ] })
3852
4063
  ] }, baseParameter.key);
3853
4064
  }),
3854
4065
  deezParameters.map((parameter, index) => {
3855
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_design_system22.TableRow, { children: [
3856
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_design_system22.TableCellData, { width: "50%", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
4066
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_design_system22.TableRow, { children: [
4067
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_design_system22.TableCellData, { width: "50%", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
3857
4068
  import_design_system22.Input,
3858
4069
  {
3859
4070
  label: parameter.key,
@@ -3873,7 +4084,7 @@ function RequestParameters({ disableVariables }) {
3873
4084
  "data-test-id": "parameter-key"
3874
4085
  }
3875
4086
  ) }),
3876
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_design_system22.TableCellData, { width: "50%", children: parameter.key ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
4087
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_design_system22.TableCellData, { width: "50%", children: parameter.key ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
3877
4088
  InputVariables,
3878
4089
  {
3879
4090
  value: parameter.value,
@@ -3894,8 +4105,8 @@ function RequestParameters({ disableVariables }) {
3894
4105
  }
3895
4106
 
3896
4107
  // src/components/Request/RequestUrl.tsx
3897
- var import_react37 = require("@emotion/react");
3898
- var import_react38 = require("react");
4108
+ var import_react39 = require("@emotion/react");
4109
+ var import_react40 = require("react");
3899
4110
 
3900
4111
  // src/components/Request/urlEncodeRequestParameter.ts
3901
4112
  function urlEncodeRequestUrl(url, varValues) {
@@ -3916,35 +4127,35 @@ function decodeVariablesInUrlEncodedString(string, varValues) {
3916
4127
  }
3917
4128
 
3918
4129
  // src/components/Request/RequestUrl.tsx
3919
- var import_jsx_runtime40 = require("@emotion/react/jsx-runtime");
4130
+ var import_jsx_runtime42 = require("@emotion/react/jsx-runtime");
3920
4131
  function RequestUrl() {
3921
4132
  var _a, _b;
3922
4133
  const { variables } = useVariables();
3923
4134
  const { request } = useRequest();
3924
- const mergedParameters = (0, import_react38.useMemo)(() => {
4135
+ const mergedParameters = (0, import_react40.useMemo)(() => {
3925
4136
  var _a2;
3926
4137
  if (!((_a2 = request.baseRequest) == null ? void 0 : _a2.parameters)) {
3927
4138
  return request.parameters;
3928
4139
  }
3929
- return request.baseRequest.parameters.filter((baseParam) => !request.parameters.find((p) => p.key === baseParam.key)).concat(request.parameters);
4140
+ return request.baseRequest.parameters.filter((baseParam) => !request.parameters.find((p2) => p2.key === baseParam.key)).concat(request.parameters);
3930
4141
  }, [(_a = request.baseRequest) == null ? void 0 : _a.parameters, request.parameters]);
3931
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
4142
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
3932
4143
  "small",
3933
4144
  {
3934
- css: import_react37.css`
4145
+ css: import_react39.css`
3935
4146
  display: inline-block;
3936
4147
  margin-bottom: var(--spacing-xs);
3937
4148
  word-break: break-word;
3938
4149
  `,
3939
4150
  children: [
3940
- request.baseRequest ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { children: (_b = request.baseRequest) == null ? void 0 : _b.baseUrl }) : null,
3941
- /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("span", { css: { fontWeight: request.baseRequest ? "bold" : "inherit" }, children: [
4151
+ request.baseRequest ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { children: (_b = request.baseRequest) == null ? void 0 : _b.baseUrl }) : null,
4152
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { css: { fontWeight: request.baseRequest ? "bold" : "inherit" }, children: [
3942
4153
  urlEncodeRequestUrl(request.relativeUrl, variables),
3943
- mergedParameters.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
4154
+ mergedParameters.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
3944
4155
  "?",
3945
4156
  mergedParameters.map((param, index) => {
3946
4157
  const encoded = urlEncodeRequestParameter(param, variables);
3947
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("span", { children: [
4158
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { children: [
3948
4159
  index > 0 ? "&" : null,
3949
4160
  encoded.key,
3950
4161
  "=",
@@ -3958,40 +4169,48 @@ function RequestUrl() {
3958
4169
  );
3959
4170
  }
3960
4171
 
4172
+ // src/components/Request/util/handlePastedUrl.ts
4173
+ function handlePastedUrl(value, currentRequest, dispatch) {
4174
+ var _a, _b, _c;
4175
+ const indexOfQueryString = value.indexOf("?");
4176
+ const hasQueryString = indexOfQueryString >= 0;
4177
+ let relativeUrl = hasQueryString ? value.substring(0, indexOfQueryString) : value;
4178
+ if (((_a = currentRequest.baseRequest) == null ? void 0 : _a.baseUrl) && relativeUrl.startsWith((_b = currentRequest.baseRequest) == null ? void 0 : _b.baseUrl)) {
4179
+ relativeUrl = relativeUrl.substring((_c = currentRequest.baseRequest) == null ? void 0 : _c.baseUrl.length);
4180
+ }
4181
+ dispatch({ type: "setRelativeUrl", relativeUrl });
4182
+ if (hasQueryString) {
4183
+ for (let index = currentRequest.parameters.length - 1; index >= 0; index--) {
4184
+ dispatch({ type: "removeParameter", index });
4185
+ }
4186
+ try {
4187
+ const query = new URLSearchParams(value.substring(indexOfQueryString));
4188
+ query.forEach((value2, key) => {
4189
+ dispatch({ type: "updateParameter", parameter: { key, value: value2 } });
4190
+ });
4191
+ } catch (e) {
4192
+ }
4193
+ }
4194
+ }
4195
+
3961
4196
  // src/components/Request/RequestUrlInput.tsx
3962
- var import_jsx_runtime41 = require("@emotion/react/jsx-runtime");
4197
+ var import_jsx_runtime43 = require("@emotion/react/jsx-runtime");
3963
4198
  function RequestUrlInput(props) {
3964
4199
  const { request, dispatch } = useRequest();
3965
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
4200
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
3966
4201
  InputVariables,
3967
4202
  {
4203
+ disableReset: true,
3968
4204
  ...props,
3969
4205
  value: request.relativeUrl,
3970
4206
  onPaste: (value) => {
3971
- var _a, _b, _c;
3972
- const indexOfQueryString = value.indexOf("?");
3973
- if (indexOfQueryString >= 0) {
3974
- let relativeUrl = value.substring(0, indexOfQueryString);
3975
- if (((_a = request.baseRequest) == null ? void 0 : _a.baseUrl) && relativeUrl.startsWith((_b = request.baseRequest) == null ? void 0 : _b.baseUrl)) {
3976
- relativeUrl = relativeUrl.substring((_c = request.baseRequest) == null ? void 0 : _c.baseUrl.length);
3977
- }
3978
- dispatch({ type: "setRelativeUrl", relativeUrl });
3979
- for (let index = request.parameters.length - 1; index >= 0; index--) {
3980
- dispatch({ type: "removeParameter", index });
3981
- }
3982
- try {
3983
- const query = new URLSearchParams(value.substring(indexOfQueryString));
3984
- query.forEach((value2, key) => {
3985
- dispatch({ type: "updateParameter", parameter: { key, value: value2 } });
3986
- });
3987
- } catch (e) {
3988
- }
3989
- }
4207
+ handlePastedUrl(value, request, dispatch);
3990
4208
  },
3991
4209
  onChange: (value) => {
3992
4210
  dispatch({ type: "setRelativeUrl", relativeUrl: value });
3993
4211
  },
3994
- showAddVariableMenuOption: true
4212
+ showAddVariableMenuOption: true,
4213
+ "data-test-id": "field-url"
3995
4214
  }
3996
4215
  );
3997
4216
  }
@@ -4000,7 +4219,7 @@ function RequestUrlInput(props) {
4000
4219
  function useRequestHeader(headerName) {
4001
4220
  var _a, _b;
4002
4221
  const { request, dispatch } = useRequest();
4003
- const headerIndex = request.headers.findIndex((f) => f.key === headerName);
4222
+ const headerIndex = request.headers.findIndex((f2) => f2.key === headerName);
4004
4223
  return {
4005
4224
  value: (_b = (_a = request.headers[headerIndex]) == null ? void 0 : _a.value) != null ? _b : "",
4006
4225
  update: (value) => {
@@ -4017,7 +4236,7 @@ function useRequestHeader(headerName) {
4017
4236
  function useRequestParameter(paramName) {
4018
4237
  var _a, _b;
4019
4238
  const { request, dispatch } = useRequest();
4020
- const paramIndex = request.parameters.findIndex((f) => f.key === paramName);
4239
+ const paramIndex = request.parameters.findIndex((f2) => f2.key === paramName);
4021
4240
  return {
4022
4241
  value: (_b = (_a = request.parameters[paramIndex]) == null ? void 0 : _a.value) != null ? _b : "",
4023
4242
  update: (value) => {
@@ -4031,18 +4250,18 @@ function useRequestParameter(paramName) {
4031
4250
  }
4032
4251
 
4033
4252
  // src/components/DataSourceEditor.tsx
4034
- var import_jsx_runtime42 = require("@emotion/react/jsx-runtime");
4253
+ var import_jsx_runtime44 = require("@emotion/react/jsx-runtime");
4035
4254
  function DataSourceEditor({ onChange, children, editVariableComponent }) {
4036
4255
  var _a;
4037
4256
  const { value } = useMeshLocation("dataSource");
4038
4257
  const currentRequestValue = convertDataSourceToRequestData(value);
4039
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
4258
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
4040
4259
  VariablesProvider,
4041
4260
  {
4042
4261
  value: (_a = value.variables) != null ? _a : {},
4043
4262
  onChange: (newValue) => onChange((prev) => ({ newValue: { ...prev, variables: newValue } })),
4044
4263
  editVariableComponent,
4045
- children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
4264
+ children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
4046
4265
  RequestProvider,
4047
4266
  {
4048
4267
  value: currentRequestValue,
@@ -4079,7 +4298,7 @@ function convertRequestDataToDataSource(dataSource, requestData) {
4079
4298
  }
4080
4299
 
4081
4300
  // src/components/DataTypeEditor.tsx
4082
- var import_jsx_runtime43 = require("@emotion/react/jsx-runtime");
4301
+ var import_jsx_runtime45 = require("@emotion/react/jsx-runtime");
4083
4302
  function DataTypeEditor({ onChange, children, editVariableComponent }) {
4084
4303
  var _a;
4085
4304
  const {
@@ -4087,13 +4306,13 @@ function DataTypeEditor({ onChange, children, editVariableComponent }) {
4087
4306
  metadata: { dataSource }
4088
4307
  } = useMeshLocation("dataType");
4089
4308
  const currentRequestValue = convertDataTypeToRequestData(value, dataSource);
4090
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
4309
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
4091
4310
  VariablesProvider,
4092
4311
  {
4093
4312
  value: (_a = value.variables) != null ? _a : {},
4094
4313
  onChange: (newValue) => onChange((prev) => ({ newValue: { ...prev, variables: newValue } })),
4095
4314
  editVariableComponent,
4096
- children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
4315
+ children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
4097
4316
  RequestProvider,
4098
4317
  {
4099
4318
  value: currentRequestValue,
@@ -4143,12 +4362,12 @@ var import_design_system23 = require("@uniformdev/design-system");
4143
4362
 
4144
4363
  // src/hooks/useInitializeUniformMeshSdk.ts
4145
4364
  var import_mesh_sdk = require("@uniformdev/mesh-sdk");
4146
- var import_react39 = require("react");
4365
+ var import_react41 = require("react");
4147
4366
  var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
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)(
4367
+ const [error, setError] = (0, import_react41.useState)();
4368
+ const [sdk, setSdk] = (0, import_react41.useState)();
4369
+ const initializationInProgress = (0, import_react41.useRef)(false);
4370
+ (0, import_react41.useEffect)(
4152
4371
  () => {
4153
4372
  if (typeof window === "undefined" || sdk) {
4154
4373
  return;
@@ -4181,7 +4400,7 @@ var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
4181
4400
  };
4182
4401
 
4183
4402
  // src/components/MeshApp.tsx
4184
- var import_jsx_runtime44 = require("@emotion/react/jsx-runtime");
4403
+ var import_jsx_runtime46 = require("@emotion/react/jsx-runtime");
4185
4404
  var MeshApp = ({
4186
4405
  children,
4187
4406
  loadingComponent,
@@ -4190,36 +4409,36 @@ var MeshApp = ({
4190
4409
  const { initializing, error, sdk } = useInitializeUniformMeshSdk();
4191
4410
  if (initializing || !sdk) {
4192
4411
  const LoadingComponent = loadingComponent;
4193
- return LoadingComponent ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(LoadingComponent, {}) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_design_system23.LoadingIndicator, {});
4412
+ return LoadingComponent ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(LoadingComponent, {}) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_design_system23.LoadingIndicator, {});
4194
4413
  }
4195
4414
  if (error) {
4196
4415
  const ErrorComponent = errorComponent;
4197
4416
  if (ErrorComponent) {
4198
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ErrorComponent, { error });
4417
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ErrorComponent, { error });
4199
4418
  }
4200
4419
  throw error;
4201
4420
  }
4202
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(UniformMeshSdkContext.Provider, { value: { sdk }, children: [
4203
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_design_system23.Theme, {}),
4204
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(UniformMeshLocationContextProvider, { children })
4421
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(UniformMeshSdkContext.Provider, { value: { sdk }, children: [
4422
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_design_system23.Theme, {}),
4423
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(UniformMeshLocationContextProvider, { children })
4205
4424
  ] });
4206
4425
  };
4207
4426
 
4208
4427
  // src/components/ObjectSearch/DataRefreshButton.tsx
4209
- var import_react40 = require("@emotion/react");
4428
+ var import_react42 = require("@emotion/react");
4210
4429
  var import_design_system24 = require("@uniformdev/design-system");
4211
- var import_jsx_runtime45 = require("@emotion/react/jsx-runtime");
4430
+ var import_jsx_runtime47 = require("@emotion/react/jsx-runtime");
4212
4431
  var DataRefreshButton = ({
4213
4432
  buttonText,
4214
4433
  isLoading,
4215
4434
  onRefreshData,
4216
4435
  ...props
4217
4436
  }) => {
4218
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system24.Button, { buttonType: "primaryInvert", onClick: onRefreshData, disabled: isLoading, ...props, children: [
4219
- !isLoading ? null : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
4437
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_design_system24.Button, { buttonType: "primaryInvert", onClick: onRefreshData, disabled: isLoading, ...props, children: [
4438
+ !isLoading ? null : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
4220
4439
  import_design_system24.LoadingIndicator,
4221
4440
  {
4222
- css: import_react40.css`
4441
+ css: import_react42.css`
4223
4442
  ${isLoading ? "opacity: 0.2;" : void 0}
4224
4443
  `
4225
4444
  }
@@ -4228,39 +4447,1172 @@ var DataRefreshButton = ({
4228
4447
  ] });
4229
4448
  };
4230
4449
 
4231
- // src/components/ObjectSearch/ObjectSearchContainer.tsx
4232
- var import_design_system25 = require("@uniformdev/design-system");
4233
- var import_jsx_runtime46 = require("@emotion/react/jsx-runtime");
4234
- var ObjectSearchContainer = ({
4235
- searchFilters,
4236
- resultList,
4237
- children
4238
- }) => {
4239
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_design_system25.IconsProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_design_system25.VerticalRhythm, { children: [
4240
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_design_system25.Container, { backgroundColor: "gray-50", padding: "var(--spacing-base)", border: true, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_design_system25.VerticalRhythm, { children: [
4241
- searchFilters,
4242
- !resultList ? null : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_design_system25.ScrollableList, { role: "list", children: resultList })
4243
- ] }) }),
4244
- children
4245
- ] }) });
4450
+ // ../context/dist/api/api.mjs
4451
+ var __defProp2 = Object.defineProperty;
4452
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4453
+ var __publicField = (obj, key, value) => {
4454
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4455
+ return value;
4456
+ };
4457
+ var __accessCheck = (obj, member, msg) => {
4458
+ if (!member.has(obj))
4459
+ throw TypeError("Cannot " + msg);
4460
+ };
4461
+ var __privateGet = (obj, member, getter) => {
4462
+ __accessCheck(obj, member, "read from private field");
4463
+ return getter ? getter.call(obj) : member.get(obj);
4464
+ };
4465
+ var __privateAdd = (obj, member, value) => {
4466
+ if (member.has(obj))
4467
+ throw TypeError("Cannot add the same private member more than once");
4468
+ member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
4469
+ };
4470
+ var nullLimitPolicy = async (func) => await func();
4471
+ var ApiClientError = class extends Error {
4472
+ constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
4473
+ super(
4474
+ `${errorMessage}
4475
+ ${statusCode}${statusText ? " " + statusText : ""} (${fetchMethod} ${fetchUri}${requestId ? ` Request ID: ${requestId}` : ""})`
4476
+ );
4477
+ this.errorMessage = errorMessage;
4478
+ this.fetchMethod = fetchMethod;
4479
+ this.fetchUri = fetchUri;
4480
+ this.statusCode = statusCode;
4481
+ this.statusText = statusText;
4482
+ this.requestId = requestId;
4483
+ Object.setPrototypeOf(this, ApiClientError.prototype);
4484
+ }
4485
+ };
4486
+ var ApiClient = class {
4487
+ constructor(options) {
4488
+ __publicField(this, "options");
4489
+ var _a, _b, _c, _d, _e;
4490
+ if (!options.apiKey && !options.bearerToken) {
4491
+ throw new Error("You must provide an API key or a bearer token");
4492
+ }
4493
+ let leFetch = options.fetch;
4494
+ if (!leFetch) {
4495
+ if (typeof window !== "undefined") {
4496
+ leFetch = window.fetch.bind(window);
4497
+ } else if (typeof fetch !== "undefined") {
4498
+ leFetch = fetch;
4499
+ } else {
4500
+ throw new Error("You must provide or polyfill a fetch implementation when not in a browser");
4501
+ }
4502
+ }
4503
+ this.options = {
4504
+ ...options,
4505
+ fetch: leFetch,
4506
+ apiHost: this.ensureApiHost(options.apiHost),
4507
+ apiKey: (_a = options.apiKey) != null ? _a : null,
4508
+ projectId: (_b = options.projectId) != null ? _b : null,
4509
+ bearerToken: (_c = options.bearerToken) != null ? _c : null,
4510
+ limitPolicy: (_d = options.limitPolicy) != null ? _d : nullLimitPolicy,
4511
+ bypassCache: (_e = options.bypassCache) != null ? _e : false
4512
+ };
4513
+ }
4514
+ async apiClient(fetchUri, options) {
4515
+ return this.options.limitPolicy(async () => {
4516
+ var _a;
4517
+ const coreHeaders = this.options.apiKey ? {
4518
+ "x-api-key": this.options.apiKey
4519
+ } : {
4520
+ Authorization: `Bearer ${this.options.bearerToken}`
4521
+ };
4522
+ if (this.options.bypassCache) {
4523
+ coreHeaders["x-bypass-cache"] = "true";
4524
+ }
4525
+ const callApi = () => this.options.fetch(fetchUri.toString(), {
4526
+ ...options,
4527
+ headers: {
4528
+ ...options == null ? void 0 : options.headers,
4529
+ ...coreHeaders
4530
+ }
4531
+ });
4532
+ const apiResponse = await handleRateLimits(callApi);
4533
+ if (!apiResponse.ok) {
4534
+ let message = "";
4535
+ try {
4536
+ const responseText = await apiResponse.text();
4537
+ try {
4538
+ const parsed = JSON.parse(responseText);
4539
+ if (parsed.errorMessage) {
4540
+ message = Array.isArray(parsed.errorMessage) ? parsed.errorMessage.join(", ") : parsed.errorMessage;
4541
+ } else {
4542
+ message = responseText;
4543
+ }
4544
+ } catch (e) {
4545
+ message = responseText;
4546
+ }
4547
+ } catch (e) {
4548
+ message = `General error`;
4549
+ }
4550
+ throw new ApiClientError(
4551
+ message,
4552
+ (_a = options == null ? void 0 : options.method) != null ? _a : "GET",
4553
+ fetchUri.toString(),
4554
+ apiResponse.status,
4555
+ apiResponse.statusText,
4556
+ ApiClient.getRequestId(apiResponse)
4557
+ );
4558
+ }
4559
+ if (options == null ? void 0 : options.expectNoContent) {
4560
+ return null;
4561
+ }
4562
+ return await apiResponse.json();
4563
+ });
4564
+ }
4565
+ createUrl(path, queryParams, hostOverride) {
4566
+ const url = new URL(`${hostOverride != null ? hostOverride : this.options.apiHost}${path}`);
4567
+ Object.entries(queryParams != null ? queryParams : {}).forEach(([key, value]) => {
4568
+ var _a;
4569
+ if (typeof value !== "undefined" && value !== null) {
4570
+ url.searchParams.append(key, Array.isArray(value) ? value.join(",") : (_a = value == null ? void 0 : value.toString()) != null ? _a : "");
4571
+ }
4572
+ });
4573
+ return url;
4574
+ }
4575
+ ensureApiHost(apiHost) {
4576
+ if (!apiHost)
4577
+ return "https://uniform.app";
4578
+ if (!(apiHost == null ? void 0 : apiHost.startsWith("http"))) {
4579
+ throw new Error('Your apiHost must start with "http"');
4580
+ }
4581
+ if (apiHost.indexOf("/", 8) > -1) {
4582
+ throw new Error("Your apiHost must not contain a path element after the domain");
4583
+ }
4584
+ if (apiHost.indexOf("?") > -1) {
4585
+ throw new Error("Your apiHost must not contain a query string");
4586
+ }
4587
+ if (apiHost == null ? void 0 : apiHost.endsWith("/")) {
4588
+ apiHost = apiHost.substring(0, apiHost.length - 1);
4589
+ }
4590
+ return apiHost;
4591
+ }
4592
+ static getRequestId(response) {
4593
+ const apigRequestId = response.headers.get("apigw-requestid");
4594
+ if (apigRequestId) {
4595
+ return apigRequestId;
4596
+ }
4597
+ return void 0;
4598
+ }
4599
+ };
4600
+ async function handleRateLimits(callApi) {
4601
+ var _a;
4602
+ const backoffRetries = 5;
4603
+ let backoffRetriesLeft = backoffRetries;
4604
+ let response;
4605
+ while (backoffRetriesLeft > 0) {
4606
+ response = await callApi();
4607
+ if (response.status !== 429) {
4608
+ break;
4609
+ }
4610
+ let resetWait = 0;
4611
+ try {
4612
+ const dateHeader = response.headers.get("date");
4613
+ const serverTime = dateHeader ? new Date(dateHeader).getTime() : void 0;
4614
+ const body = await response.json();
4615
+ const resetTime = (_a = body == null ? void 0 : body.info) == null ? void 0 : _a.reset;
4616
+ if (typeof serverTime === "number" && typeof resetTime === "number") {
4617
+ resetWait = Math.max(0, Math.min(Math.round(1.1 * (resetTime - serverTime)), 1e4));
4618
+ }
4619
+ } catch (err) {
4620
+ }
4621
+ const base = Math.pow(2, backoffRetries - backoffRetriesLeft) * 333;
4622
+ const backoffWait = base + Math.round(Math.random() * (base / 2)) * (Math.random() > 0.5 ? 1 : -1);
4623
+ await new Promise((resolve) => setTimeout(resolve, resetWait + backoffWait));
4624
+ backoffRetriesLeft -= 1;
4625
+ }
4626
+ return response;
4627
+ }
4628
+ var _url;
4629
+ var _AggregateClient = class extends ApiClient {
4630
+ constructor(options) {
4631
+ super(options);
4632
+ }
4633
+ /** Fetches all aggregates for a project */
4634
+ async get(options) {
4635
+ const { projectId } = this.options;
4636
+ const fetchUri = this.createUrl(__privateGet(_AggregateClient, _url), { ...options, projectId });
4637
+ return await this.apiClient(fetchUri);
4638
+ }
4639
+ /** Updates or creates (based on id) an Aggregate */
4640
+ async upsert(body) {
4641
+ const fetchUri = this.createUrl(__privateGet(_AggregateClient, _url));
4642
+ await this.apiClient(fetchUri, {
4643
+ method: "PUT",
4644
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
4645
+ expectNoContent: true
4646
+ });
4647
+ }
4648
+ /** Deletes an Aggregate */
4649
+ async remove(body) {
4650
+ const fetchUri = this.createUrl(__privateGet(_AggregateClient, _url));
4651
+ await this.apiClient(fetchUri, {
4652
+ method: "DELETE",
4653
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
4654
+ expectNoContent: true
4655
+ });
4656
+ }
4657
+ };
4658
+ var AggregateClient = _AggregateClient;
4659
+ _url = /* @__PURE__ */ new WeakMap();
4660
+ __privateAdd(AggregateClient, _url, "/api/v2/aggregate");
4661
+ var _url2;
4662
+ var _DimensionClient = class extends ApiClient {
4663
+ constructor(options) {
4664
+ super(options);
4665
+ }
4666
+ /** Fetches the known score dimensions for a project */
4667
+ async get(options) {
4668
+ const { projectId } = this.options;
4669
+ const fetchUri = this.createUrl(__privateGet(_DimensionClient, _url2), { ...options, projectId });
4670
+ return await this.apiClient(fetchUri);
4671
+ }
4672
+ };
4673
+ var DimensionClient = _DimensionClient;
4674
+ _url2 = /* @__PURE__ */ new WeakMap();
4675
+ __privateAdd(DimensionClient, _url2, "/api/v2/dimension");
4676
+ var _url3;
4677
+ var _valueUrl;
4678
+ var _EnrichmentClient = class extends ApiClient {
4679
+ constructor(options) {
4680
+ super(options);
4681
+ }
4682
+ /** Fetches all enrichments and values for a project, grouped by category */
4683
+ async get(options) {
4684
+ const { projectId } = this.options;
4685
+ const fetchUri = this.createUrl(__privateGet(_EnrichmentClient, _url3), { ...options, projectId });
4686
+ return await this.apiClient(fetchUri);
4687
+ }
4688
+ /** Updates or creates (based on id) an enrichment category */
4689
+ async upsertCategory(body) {
4690
+ const fetchUri = this.createUrl(__privateGet(_EnrichmentClient, _url3));
4691
+ await this.apiClient(fetchUri, {
4692
+ method: "PUT",
4693
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
4694
+ expectNoContent: true
4695
+ });
4696
+ }
4697
+ /** Deletes an enrichment category */
4698
+ async removeCategory(body) {
4699
+ const fetchUri = this.createUrl(__privateGet(_EnrichmentClient, _url3));
4700
+ await this.apiClient(fetchUri, {
4701
+ method: "DELETE",
4702
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
4703
+ expectNoContent: true
4704
+ });
4705
+ }
4706
+ /** Updates or creates (based on id) an enrichment value within an enrichment category */
4707
+ async upsertValue(body) {
4708
+ const fetchUri = this.createUrl(__privateGet(_EnrichmentClient, _valueUrl));
4709
+ await this.apiClient(fetchUri, {
4710
+ method: "PUT",
4711
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
4712
+ expectNoContent: true
4713
+ });
4714
+ }
4715
+ /** Deletes an enrichment value within an enrichment category. The category is left alone. */
4716
+ async removeValue(body) {
4717
+ const fetchUri = this.createUrl(__privateGet(_EnrichmentClient, _valueUrl));
4718
+ await this.apiClient(fetchUri, {
4719
+ method: "DELETE",
4720
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
4721
+ expectNoContent: true
4722
+ });
4723
+ }
4724
+ };
4725
+ var EnrichmentClient = _EnrichmentClient;
4726
+ _url3 = /* @__PURE__ */ new WeakMap();
4727
+ _valueUrl = /* @__PURE__ */ new WeakMap();
4728
+ __privateAdd(EnrichmentClient, _url3, "/api/v1/enrichments");
4729
+ __privateAdd(EnrichmentClient, _valueUrl, "/api/v1/enrichment-values");
4730
+ var _url4;
4731
+ var _ManifestClient = class extends ApiClient {
4732
+ constructor(options) {
4733
+ super(options);
4734
+ }
4735
+ /** Fetches the Context manifest for a project */
4736
+ async get(options) {
4737
+ const { projectId } = this.options;
4738
+ const fetchUri = this.createUrl(__privateGet(_ManifestClient, _url4), { ...options, projectId });
4739
+ return await this.apiClient(fetchUri);
4740
+ }
4741
+ /** Publishes the Context manifest for a project */
4742
+ async publish() {
4743
+ const { projectId } = this.options;
4744
+ const fetchUri = this.createUrl("/api/v1/publish", { siteId: projectId });
4745
+ await this.apiClient(fetchUri, {
4746
+ method: "POST",
4747
+ expectNoContent: true
4748
+ });
4749
+ }
4246
4750
  };
4751
+ var ManifestClient = _ManifestClient;
4752
+ _url4 = /* @__PURE__ */ new WeakMap();
4753
+ __privateAdd(ManifestClient, _url4, "/api/v2/manifest");
4754
+ var _url5;
4755
+ var _QuirkClient = class extends ApiClient {
4756
+ constructor(options) {
4757
+ super(options);
4758
+ }
4759
+ /** Fetches all Quirks for a project */
4760
+ async get(options) {
4761
+ const { projectId } = this.options;
4762
+ const fetchUri = this.createUrl(__privateGet(_QuirkClient, _url5), { ...options, projectId });
4763
+ return await this.apiClient(fetchUri);
4764
+ }
4765
+ /** Updates or creates (based on id) a Quirk */
4766
+ async upsert(body) {
4767
+ const fetchUri = this.createUrl(__privateGet(_QuirkClient, _url5));
4768
+ await this.apiClient(fetchUri, {
4769
+ method: "PUT",
4770
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
4771
+ expectNoContent: true
4772
+ });
4773
+ }
4774
+ /** Deletes a Quirk */
4775
+ async remove(body) {
4776
+ const fetchUri = this.createUrl(__privateGet(_QuirkClient, _url5));
4777
+ await this.apiClient(fetchUri, {
4778
+ method: "DELETE",
4779
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
4780
+ expectNoContent: true
4781
+ });
4782
+ }
4783
+ };
4784
+ var QuirkClient = _QuirkClient;
4785
+ _url5 = /* @__PURE__ */ new WeakMap();
4786
+ __privateAdd(QuirkClient, _url5, "/api/v2/quirk");
4787
+ var _url6;
4788
+ var _SignalClient = class extends ApiClient {
4789
+ constructor(options) {
4790
+ super(options);
4791
+ }
4792
+ /** Fetches all Signals for a project */
4793
+ async get(options) {
4794
+ const { projectId } = this.options;
4795
+ const fetchUri = this.createUrl(__privateGet(_SignalClient, _url6), { ...options, projectId });
4796
+ return await this.apiClient(fetchUri);
4797
+ }
4798
+ /** Updates or creates (based on id) a Signal */
4799
+ async upsert(body) {
4800
+ const fetchUri = this.createUrl(__privateGet(_SignalClient, _url6));
4801
+ await this.apiClient(fetchUri, {
4802
+ method: "PUT",
4803
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
4804
+ expectNoContent: true
4805
+ });
4806
+ }
4807
+ /** Deletes a Signal */
4808
+ async remove(body) {
4809
+ const fetchUri = this.createUrl(__privateGet(_SignalClient, _url6));
4810
+ await this.apiClient(fetchUri, {
4811
+ method: "DELETE",
4812
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
4813
+ expectNoContent: true
4814
+ });
4815
+ }
4816
+ };
4817
+ var SignalClient = _SignalClient;
4818
+ _url6 = /* @__PURE__ */ new WeakMap();
4819
+ __privateAdd(SignalClient, _url6, "/api/v2/signal");
4820
+ var _url7;
4821
+ var _TestClient = class extends ApiClient {
4822
+ constructor(options) {
4823
+ super(options);
4824
+ }
4825
+ /** Fetches all Tests for a project */
4826
+ async get(options) {
4827
+ const { projectId } = this.options;
4828
+ const fetchUri = this.createUrl(__privateGet(_TestClient, _url7), { ...options, projectId });
4829
+ return await this.apiClient(fetchUri);
4830
+ }
4831
+ /** Updates or creates (based on id) a Test */
4832
+ async upsert(body) {
4833
+ const fetchUri = this.createUrl(__privateGet(_TestClient, _url7));
4834
+ await this.apiClient(fetchUri, {
4835
+ method: "PUT",
4836
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
4837
+ expectNoContent: true
4838
+ });
4839
+ }
4840
+ /** Deletes a Test */
4841
+ async remove(body) {
4842
+ const fetchUri = this.createUrl(__privateGet(_TestClient, _url7));
4843
+ await this.apiClient(fetchUri, {
4844
+ method: "DELETE",
4845
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
4846
+ expectNoContent: true
4847
+ });
4848
+ }
4849
+ };
4850
+ var TestClient = _TestClient;
4851
+ _url7 = /* @__PURE__ */ new WeakMap();
4852
+ __privateAdd(TestClient, _url7, "/api/v2/test");
4853
+
4854
+ // ../../node_modules/.pnpm/immer@9.0.21/node_modules/immer/dist/immer.esm.mjs
4855
+ function n(n2) {
4856
+ for (var r2 = arguments.length, t2 = Array(r2 > 1 ? r2 - 1 : 0), e = 1; e < r2; e++)
4857
+ t2[e - 1] = arguments[e];
4858
+ if ("production" !== process.env.NODE_ENV) {
4859
+ var i2 = Y[n2], o2 = i2 ? "function" == typeof i2 ? i2.apply(null, t2) : i2 : "unknown error nr: " + n2;
4860
+ throw Error("[Immer] " + o2);
4861
+ }
4862
+ throw Error("[Immer] minified error nr: " + n2 + (t2.length ? " " + t2.map(function(n3) {
4863
+ return "'" + n3 + "'";
4864
+ }).join(",") : "") + ". Find the full error at: https://bit.ly/3cXEKWf");
4865
+ }
4866
+ function r(n2) {
4867
+ return !!n2 && !!n2[Q];
4868
+ }
4869
+ function t(n2) {
4870
+ var r2;
4871
+ return !!n2 && (function(n3) {
4872
+ if (!n3 || "object" != typeof n3)
4873
+ return false;
4874
+ var r3 = Object.getPrototypeOf(n3);
4875
+ if (null === r3)
4876
+ return true;
4877
+ var t2 = Object.hasOwnProperty.call(r3, "constructor") && r3.constructor;
4878
+ return t2 === Object || "function" == typeof t2 && Function.toString.call(t2) === Z;
4879
+ }(n2) || Array.isArray(n2) || !!n2[L] || !!(null === (r2 = n2.constructor) || void 0 === r2 ? void 0 : r2[L]) || s(n2) || v(n2));
4880
+ }
4881
+ function i(n2, r2, t2) {
4882
+ void 0 === t2 && (t2 = false), 0 === o(n2) ? (t2 ? Object.keys : nn)(n2).forEach(function(e) {
4883
+ t2 && "symbol" == typeof e || r2(e, n2[e], n2);
4884
+ }) : n2.forEach(function(t3, e) {
4885
+ return r2(e, t3, n2);
4886
+ });
4887
+ }
4888
+ function o(n2) {
4889
+ var r2 = n2[Q];
4890
+ return r2 ? r2.i > 3 ? r2.i - 4 : r2.i : Array.isArray(n2) ? 1 : s(n2) ? 2 : v(n2) ? 3 : 0;
4891
+ }
4892
+ function u(n2, r2) {
4893
+ return 2 === o(n2) ? n2.has(r2) : Object.prototype.hasOwnProperty.call(n2, r2);
4894
+ }
4895
+ function a(n2, r2) {
4896
+ return 2 === o(n2) ? n2.get(r2) : n2[r2];
4897
+ }
4898
+ function f(n2, r2, t2) {
4899
+ var e = o(n2);
4900
+ 2 === e ? n2.set(r2, t2) : 3 === e ? n2.add(t2) : n2[r2] = t2;
4901
+ }
4902
+ function c(n2, r2) {
4903
+ return n2 === r2 ? 0 !== n2 || 1 / n2 == 1 / r2 : n2 != n2 && r2 != r2;
4904
+ }
4905
+ function s(n2) {
4906
+ return X && n2 instanceof Map;
4907
+ }
4908
+ function v(n2) {
4909
+ return q && n2 instanceof Set;
4910
+ }
4911
+ function p(n2) {
4912
+ return n2.o || n2.t;
4913
+ }
4914
+ function l(n2) {
4915
+ if (Array.isArray(n2))
4916
+ return Array.prototype.slice.call(n2);
4917
+ var r2 = rn(n2);
4918
+ delete r2[Q];
4919
+ for (var t2 = nn(r2), e = 0; e < t2.length; e++) {
4920
+ var i2 = t2[e], o2 = r2[i2];
4921
+ false === o2.writable && (o2.writable = true, o2.configurable = true), (o2.get || o2.set) && (r2[i2] = { configurable: true, writable: true, enumerable: o2.enumerable, value: n2[i2] });
4922
+ }
4923
+ return Object.create(Object.getPrototypeOf(n2), r2);
4924
+ }
4925
+ function d(n2, e) {
4926
+ return void 0 === e && (e = false), y(n2) || r(n2) || !t(n2) || (o(n2) > 1 && (n2.set = n2.add = n2.clear = n2.delete = h), Object.freeze(n2), e && i(n2, function(n3, r2) {
4927
+ return d(r2, true);
4928
+ }, true)), n2;
4929
+ }
4930
+ function h() {
4931
+ n(2);
4932
+ }
4933
+ function y(n2) {
4934
+ return null == n2 || "object" != typeof n2 || Object.isFrozen(n2);
4935
+ }
4936
+ function b(r2) {
4937
+ var t2 = tn[r2];
4938
+ return t2 || n(18, r2), t2;
4939
+ }
4940
+ function _() {
4941
+ return "production" === process.env.NODE_ENV || U || n(0), U;
4942
+ }
4943
+ function j(n2, r2) {
4944
+ r2 && (b("Patches"), n2.u = [], n2.s = [], n2.v = r2);
4945
+ }
4946
+ function g(n2) {
4947
+ O(n2), n2.p.forEach(S), n2.p = null;
4948
+ }
4949
+ function O(n2) {
4950
+ n2 === U && (U = n2.l);
4951
+ }
4952
+ function w(n2) {
4953
+ return U = { p: [], l: U, h: n2, m: true, _: 0 };
4954
+ }
4955
+ function S(n2) {
4956
+ var r2 = n2[Q];
4957
+ 0 === r2.i || 1 === r2.i ? r2.j() : r2.g = true;
4958
+ }
4959
+ function P(r2, e) {
4960
+ e._ = e.p.length;
4961
+ var i2 = e.p[0], o2 = void 0 !== r2 && r2 !== i2;
4962
+ return e.h.O || b("ES5").S(e, r2, o2), o2 ? (i2[Q].P && (g(e), n(4)), t(r2) && (r2 = M(e, r2), e.l || x(e, r2)), e.u && b("Patches").M(i2[Q].t, r2, e.u, e.s)) : r2 = M(e, i2, []), g(e), e.u && e.v(e.u, e.s), r2 !== H ? r2 : void 0;
4963
+ }
4964
+ function M(n2, r2, t2) {
4965
+ if (y(r2))
4966
+ return r2;
4967
+ var e = r2[Q];
4968
+ if (!e)
4969
+ return i(r2, function(i2, o3) {
4970
+ return A(n2, e, r2, i2, o3, t2);
4971
+ }, true), r2;
4972
+ if (e.A !== n2)
4973
+ return r2;
4974
+ if (!e.P)
4975
+ return x(n2, e.t, true), e.t;
4976
+ if (!e.I) {
4977
+ e.I = true, e.A._--;
4978
+ var o2 = 4 === e.i || 5 === e.i ? e.o = l(e.k) : e.o, u2 = o2, a2 = false;
4979
+ 3 === e.i && (u2 = new Set(o2), o2.clear(), a2 = true), i(u2, function(r3, i2) {
4980
+ return A(n2, e, o2, r3, i2, t2, a2);
4981
+ }), x(n2, o2, false), t2 && n2.u && b("Patches").N(e, t2, n2.u, n2.s);
4982
+ }
4983
+ return e.o;
4984
+ }
4985
+ function A(e, i2, o2, a2, c2, s2, v2) {
4986
+ if ("production" !== process.env.NODE_ENV && c2 === o2 && n(5), r(c2)) {
4987
+ var p2 = M(e, c2, s2 && i2 && 3 !== i2.i && !u(i2.R, a2) ? s2.concat(a2) : void 0);
4988
+ if (f(o2, a2, p2), !r(p2))
4989
+ return;
4990
+ e.m = false;
4991
+ } else
4992
+ v2 && o2.add(c2);
4993
+ if (t(c2) && !y(c2)) {
4994
+ if (!e.h.D && e._ < 1)
4995
+ return;
4996
+ M(e, c2), i2 && i2.A.l || x(e, c2);
4997
+ }
4998
+ }
4999
+ function x(n2, r2, t2) {
5000
+ void 0 === t2 && (t2 = false), !n2.l && n2.h.D && n2.m && d(r2, t2);
5001
+ }
5002
+ function z2(n2, r2) {
5003
+ var t2 = n2[Q];
5004
+ return (t2 ? p(t2) : n2)[r2];
5005
+ }
5006
+ function I(n2, r2) {
5007
+ if (r2 in n2)
5008
+ for (var t2 = Object.getPrototypeOf(n2); t2; ) {
5009
+ var e = Object.getOwnPropertyDescriptor(t2, r2);
5010
+ if (e)
5011
+ return e;
5012
+ t2 = Object.getPrototypeOf(t2);
5013
+ }
5014
+ }
5015
+ function k(n2) {
5016
+ n2.P || (n2.P = true, n2.l && k(n2.l));
5017
+ }
5018
+ function E(n2) {
5019
+ n2.o || (n2.o = l(n2.t));
5020
+ }
5021
+ function N(n2, r2, t2) {
5022
+ var e = s(r2) ? b("MapSet").F(r2, t2) : v(r2) ? b("MapSet").T(r2, t2) : n2.O ? function(n3, r3) {
5023
+ var t3 = Array.isArray(n3), e2 = { i: t3 ? 1 : 0, A: r3 ? r3.A : _(), P: false, I: false, R: {}, l: r3, t: n3, k: null, o: null, j: null, C: false }, i2 = e2, o2 = en;
5024
+ t3 && (i2 = [e2], o2 = on);
5025
+ var u2 = Proxy.revocable(i2, o2), a2 = u2.revoke, f2 = u2.proxy;
5026
+ return e2.k = f2, e2.j = a2, f2;
5027
+ }(r2, t2) : b("ES5").J(r2, t2);
5028
+ return (t2 ? t2.A : _()).p.push(e), e;
5029
+ }
5030
+ function R(e) {
5031
+ return r(e) || n(22, e), function n2(r2) {
5032
+ if (!t(r2))
5033
+ return r2;
5034
+ var e2, u2 = r2[Q], c2 = o(r2);
5035
+ if (u2) {
5036
+ if (!u2.P && (u2.i < 4 || !b("ES5").K(u2)))
5037
+ return u2.t;
5038
+ u2.I = true, e2 = D(r2, c2), u2.I = false;
5039
+ } else
5040
+ e2 = D(r2, c2);
5041
+ return i(e2, function(r3, t2) {
5042
+ u2 && a(u2.t, r3) === t2 || f(e2, r3, n2(t2));
5043
+ }), 3 === c2 ? new Set(e2) : e2;
5044
+ }(e);
5045
+ }
5046
+ function D(n2, r2) {
5047
+ switch (r2) {
5048
+ case 2:
5049
+ return new Map(n2);
5050
+ case 3:
5051
+ return Array.from(n2);
5052
+ }
5053
+ return l(n2);
5054
+ }
5055
+ var G;
5056
+ var U;
5057
+ var W = "undefined" != typeof Symbol && "symbol" == typeof Symbol("x");
5058
+ var X = "undefined" != typeof Map;
5059
+ var q = "undefined" != typeof Set;
5060
+ var B = "undefined" != typeof Proxy && void 0 !== Proxy.revocable && "undefined" != typeof Reflect;
5061
+ var H = W ? Symbol.for("immer-nothing") : ((G = {})["immer-nothing"] = true, G);
5062
+ var L = W ? Symbol.for("immer-draftable") : "__$immer_draftable";
5063
+ var Q = W ? Symbol.for("immer-state") : "__$immer_state";
5064
+ var Y = { 0: "Illegal state", 1: "Immer drafts cannot have computed properties", 2: "This object has been frozen and should not be mutated", 3: function(n2) {
5065
+ return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? " + n2;
5066
+ }, 4: "An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.", 5: "Immer forbids circular references", 6: "The first or second argument to `produce` must be a function", 7: "The third argument to `produce` must be a function or undefined", 8: "First argument to `createDraft` must be a plain object, an array, or an immerable object", 9: "First argument to `finishDraft` must be a draft returned by `createDraft`", 10: "The given draft is already finalized", 11: "Object.defineProperty() cannot be used on an Immer draft", 12: "Object.setPrototypeOf() cannot be used on an Immer draft", 13: "Immer only supports deleting array indices", 14: "Immer only supports setting array indices and the 'length' property", 15: function(n2) {
5067
+ return "Cannot apply patch, path doesn't resolve: " + n2;
5068
+ }, 16: 'Sets cannot have "replace" patches.', 17: function(n2) {
5069
+ return "Unsupported patch operation: " + n2;
5070
+ }, 18: function(n2) {
5071
+ return "The plugin for '" + n2 + "' has not been loaded into Immer. To enable the plugin, import and call `enable" + n2 + "()` when initializing your application.";
5072
+ }, 20: "Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available", 21: function(n2) {
5073
+ return "produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '" + n2 + "'";
5074
+ }, 22: function(n2) {
5075
+ return "'current' expects a draft, got: " + n2;
5076
+ }, 23: function(n2) {
5077
+ return "'original' expects a draft, got: " + n2;
5078
+ }, 24: "Patching reserved attributes like __proto__, prototype and constructor is not allowed" };
5079
+ var Z = "" + Object.prototype.constructor;
5080
+ var nn = "undefined" != typeof Reflect && Reflect.ownKeys ? Reflect.ownKeys : void 0 !== Object.getOwnPropertySymbols ? function(n2) {
5081
+ return Object.getOwnPropertyNames(n2).concat(Object.getOwnPropertySymbols(n2));
5082
+ } : Object.getOwnPropertyNames;
5083
+ var rn = Object.getOwnPropertyDescriptors || function(n2) {
5084
+ var r2 = {};
5085
+ return nn(n2).forEach(function(t2) {
5086
+ r2[t2] = Object.getOwnPropertyDescriptor(n2, t2);
5087
+ }), r2;
5088
+ };
5089
+ var tn = {};
5090
+ var en = { get: function(n2, r2) {
5091
+ if (r2 === Q)
5092
+ return n2;
5093
+ var e = p(n2);
5094
+ if (!u(e, r2))
5095
+ return function(n3, r3, t2) {
5096
+ var e2, i3 = I(r3, t2);
5097
+ return i3 ? "value" in i3 ? i3.value : null === (e2 = i3.get) || void 0 === e2 ? void 0 : e2.call(n3.k) : void 0;
5098
+ }(n2, e, r2);
5099
+ var i2 = e[r2];
5100
+ return n2.I || !t(i2) ? i2 : i2 === z2(n2.t, r2) ? (E(n2), n2.o[r2] = N(n2.A.h, i2, n2)) : i2;
5101
+ }, has: function(n2, r2) {
5102
+ return r2 in p(n2);
5103
+ }, ownKeys: function(n2) {
5104
+ return Reflect.ownKeys(p(n2));
5105
+ }, set: function(n2, r2, t2) {
5106
+ var e = I(p(n2), r2);
5107
+ if (null == e ? void 0 : e.set)
5108
+ return e.set.call(n2.k, t2), true;
5109
+ if (!n2.P) {
5110
+ var i2 = z2(p(n2), r2), o2 = null == i2 ? void 0 : i2[Q];
5111
+ if (o2 && o2.t === t2)
5112
+ return n2.o[r2] = t2, n2.R[r2] = false, true;
5113
+ if (c(t2, i2) && (void 0 !== t2 || u(n2.t, r2)))
5114
+ return true;
5115
+ E(n2), k(n2);
5116
+ }
5117
+ return n2.o[r2] === t2 && (void 0 !== t2 || r2 in n2.o) || Number.isNaN(t2) && Number.isNaN(n2.o[r2]) || (n2.o[r2] = t2, n2.R[r2] = true), true;
5118
+ }, deleteProperty: function(n2, r2) {
5119
+ return void 0 !== z2(n2.t, r2) || r2 in n2.t ? (n2.R[r2] = false, E(n2), k(n2)) : delete n2.R[r2], n2.o && delete n2.o[r2], true;
5120
+ }, getOwnPropertyDescriptor: function(n2, r2) {
5121
+ var t2 = p(n2), e = Reflect.getOwnPropertyDescriptor(t2, r2);
5122
+ return e ? { writable: true, configurable: 1 !== n2.i || "length" !== r2, enumerable: e.enumerable, value: t2[r2] } : e;
5123
+ }, defineProperty: function() {
5124
+ n(11);
5125
+ }, getPrototypeOf: function(n2) {
5126
+ return Object.getPrototypeOf(n2.t);
5127
+ }, setPrototypeOf: function() {
5128
+ n(12);
5129
+ } };
5130
+ var on = {};
5131
+ i(en, function(n2, r2) {
5132
+ on[n2] = function() {
5133
+ return arguments[0] = arguments[0][0], r2.apply(this, arguments);
5134
+ };
5135
+ }), on.deleteProperty = function(r2, t2) {
5136
+ return "production" !== process.env.NODE_ENV && isNaN(parseInt(t2)) && n(13), on.set.call(this, r2, t2, void 0);
5137
+ }, on.set = function(r2, t2, e) {
5138
+ return "production" !== process.env.NODE_ENV && "length" !== t2 && isNaN(parseInt(t2)) && n(14), en.set.call(this, r2[0], t2, e, r2[0]);
5139
+ };
5140
+ var un = function() {
5141
+ function e(r2) {
5142
+ var e2 = this;
5143
+ this.O = B, this.D = true, this.produce = function(r3, i3, o2) {
5144
+ if ("function" == typeof r3 && "function" != typeof i3) {
5145
+ var u2 = i3;
5146
+ i3 = r3;
5147
+ var a2 = e2;
5148
+ return function(n2) {
5149
+ var r4 = this;
5150
+ void 0 === n2 && (n2 = u2);
5151
+ for (var t2 = arguments.length, e3 = Array(t2 > 1 ? t2 - 1 : 0), o3 = 1; o3 < t2; o3++)
5152
+ e3[o3 - 1] = arguments[o3];
5153
+ return a2.produce(n2, function(n3) {
5154
+ var t3;
5155
+ return (t3 = i3).call.apply(t3, [r4, n3].concat(e3));
5156
+ });
5157
+ };
5158
+ }
5159
+ var f2;
5160
+ if ("function" != typeof i3 && n(6), void 0 !== o2 && "function" != typeof o2 && n(7), t(r3)) {
5161
+ var c2 = w(e2), s2 = N(e2, r3, void 0), v2 = true;
5162
+ try {
5163
+ f2 = i3(s2), v2 = false;
5164
+ } finally {
5165
+ v2 ? g(c2) : O(c2);
5166
+ }
5167
+ return "undefined" != typeof Promise && f2 instanceof Promise ? f2.then(function(n2) {
5168
+ return j(c2, o2), P(n2, c2);
5169
+ }, function(n2) {
5170
+ throw g(c2), n2;
5171
+ }) : (j(c2, o2), P(f2, c2));
5172
+ }
5173
+ if (!r3 || "object" != typeof r3) {
5174
+ if (void 0 === (f2 = i3(r3)) && (f2 = r3), f2 === H && (f2 = void 0), e2.D && d(f2, true), o2) {
5175
+ var p2 = [], l2 = [];
5176
+ b("Patches").M(r3, f2, p2, l2), o2(p2, l2);
5177
+ }
5178
+ return f2;
5179
+ }
5180
+ n(21, r3);
5181
+ }, this.produceWithPatches = function(n2, r3) {
5182
+ if ("function" == typeof n2)
5183
+ return function(r4) {
5184
+ for (var t3 = arguments.length, i4 = Array(t3 > 1 ? t3 - 1 : 0), o3 = 1; o3 < t3; o3++)
5185
+ i4[o3 - 1] = arguments[o3];
5186
+ return e2.produceWithPatches(r4, function(r5) {
5187
+ return n2.apply(void 0, [r5].concat(i4));
5188
+ });
5189
+ };
5190
+ var t2, i3, o2 = e2.produce(n2, r3, function(n3, r4) {
5191
+ t2 = n3, i3 = r4;
5192
+ });
5193
+ return "undefined" != typeof Promise && o2 instanceof Promise ? o2.then(function(n3) {
5194
+ return [n3, t2, i3];
5195
+ }) : [o2, t2, i3];
5196
+ }, "boolean" == typeof (null == r2 ? void 0 : r2.useProxies) && this.setUseProxies(r2.useProxies), "boolean" == typeof (null == r2 ? void 0 : r2.autoFreeze) && this.setAutoFreeze(r2.autoFreeze);
5197
+ }
5198
+ var i2 = e.prototype;
5199
+ return i2.createDraft = function(e2) {
5200
+ t(e2) || n(8), r(e2) && (e2 = R(e2));
5201
+ var i3 = w(this), o2 = N(this, e2, void 0);
5202
+ return o2[Q].C = true, O(i3), o2;
5203
+ }, i2.finishDraft = function(r2, t2) {
5204
+ var e2 = r2 && r2[Q];
5205
+ "production" !== process.env.NODE_ENV && (e2 && e2.C || n(9), e2.I && n(10));
5206
+ var i3 = e2.A;
5207
+ return j(i3, t2), P(void 0, i3);
5208
+ }, i2.setAutoFreeze = function(n2) {
5209
+ this.D = n2;
5210
+ }, i2.setUseProxies = function(r2) {
5211
+ r2 && !B && n(20), this.O = r2;
5212
+ }, i2.applyPatches = function(n2, t2) {
5213
+ var e2;
5214
+ for (e2 = t2.length - 1; e2 >= 0; e2--) {
5215
+ var i3 = t2[e2];
5216
+ if (0 === i3.path.length && "replace" === i3.op) {
5217
+ n2 = i3.value;
5218
+ break;
5219
+ }
5220
+ }
5221
+ e2 > -1 && (t2 = t2.slice(e2 + 1));
5222
+ var o2 = b("Patches").$;
5223
+ return r(n2) ? o2(n2, t2) : this.produce(n2, function(n3) {
5224
+ return o2(n3, t2);
5225
+ });
5226
+ }, e;
5227
+ }();
5228
+ var an = new un();
5229
+ var fn = an.produce;
5230
+ var cn = an.produceWithPatches.bind(an);
5231
+ var sn = an.setAutoFreeze.bind(an);
5232
+ var vn = an.setUseProxies.bind(an);
5233
+ var pn = an.applyPatches.bind(an);
5234
+ var ln = an.createDraft.bind(an);
5235
+ var dn = an.finishDraft.bind(an);
5236
+
5237
+ // ../canvas/dist/index.mjs
5238
+ var __create2 = Object.create;
5239
+ var __defProp3 = Object.defineProperty;
5240
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
5241
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
5242
+ var __getProtoOf2 = Object.getPrototypeOf;
5243
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
5244
+ var __commonJS = (cb, mod) => function __require() {
5245
+ return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
5246
+ };
5247
+ var __copyProps2 = (to, from, except, desc) => {
5248
+ if (from && typeof from === "object" || typeof from === "function") {
5249
+ for (let key of __getOwnPropNames2(from))
5250
+ if (!__hasOwnProp2.call(to, key) && key !== except)
5251
+ __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
5252
+ }
5253
+ return to;
5254
+ };
5255
+ var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
5256
+ // If the importer is in node compatibility mode or this is not an ESM
5257
+ // file that has been converted to a CommonJS file using a Babel-
5258
+ // compatible transform (i.e. "__esModule" has not been set), then set
5259
+ // "default" to the CommonJS "module.exports" for node compatibility.
5260
+ isNodeMode || !mod || !mod.__esModule ? __defProp3(target, "default", { value: mod, enumerable: true }) : target,
5261
+ mod
5262
+ ));
5263
+ var __accessCheck2 = (obj, member, msg) => {
5264
+ if (!member.has(obj))
5265
+ throw TypeError("Cannot " + msg);
5266
+ };
5267
+ var __privateGet2 = (obj, member, getter) => {
5268
+ __accessCheck2(obj, member, "read from private field");
5269
+ return getter ? getter.call(obj) : member.get(obj);
5270
+ };
5271
+ var __privateAdd2 = (obj, member, value) => {
5272
+ if (member.has(obj))
5273
+ throw TypeError("Cannot add the same private member more than once");
5274
+ member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
5275
+ };
5276
+ var require_retry_operation = __commonJS({
5277
+ "../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry_operation.js"(exports, module2) {
5278
+ function RetryOperation(timeouts, options) {
5279
+ if (typeof options === "boolean") {
5280
+ options = { forever: options };
5281
+ }
5282
+ this._originalTimeouts = JSON.parse(JSON.stringify(timeouts));
5283
+ this._timeouts = timeouts;
5284
+ this._options = options || {};
5285
+ this._maxRetryTime = options && options.maxRetryTime || Infinity;
5286
+ this._fn = null;
5287
+ this._errors = [];
5288
+ this._attempts = 1;
5289
+ this._operationTimeout = null;
5290
+ this._operationTimeoutCb = null;
5291
+ this._timeout = null;
5292
+ this._operationStart = null;
5293
+ this._timer = null;
5294
+ if (this._options.forever) {
5295
+ this._cachedTimeouts = this._timeouts.slice(0);
5296
+ }
5297
+ }
5298
+ module2.exports = RetryOperation;
5299
+ RetryOperation.prototype.reset = function() {
5300
+ this._attempts = 1;
5301
+ this._timeouts = this._originalTimeouts.slice(0);
5302
+ };
5303
+ RetryOperation.prototype.stop = function() {
5304
+ if (this._timeout) {
5305
+ clearTimeout(this._timeout);
5306
+ }
5307
+ if (this._timer) {
5308
+ clearTimeout(this._timer);
5309
+ }
5310
+ this._timeouts = [];
5311
+ this._cachedTimeouts = null;
5312
+ };
5313
+ RetryOperation.prototype.retry = function(err) {
5314
+ if (this._timeout) {
5315
+ clearTimeout(this._timeout);
5316
+ }
5317
+ if (!err) {
5318
+ return false;
5319
+ }
5320
+ var currentTime = (/* @__PURE__ */ new Date()).getTime();
5321
+ if (err && currentTime - this._operationStart >= this._maxRetryTime) {
5322
+ this._errors.push(err);
5323
+ this._errors.unshift(new Error("RetryOperation timeout occurred"));
5324
+ return false;
5325
+ }
5326
+ this._errors.push(err);
5327
+ var timeout = this._timeouts.shift();
5328
+ if (timeout === void 0) {
5329
+ if (this._cachedTimeouts) {
5330
+ this._errors.splice(0, this._errors.length - 1);
5331
+ timeout = this._cachedTimeouts.slice(-1);
5332
+ } else {
5333
+ return false;
5334
+ }
5335
+ }
5336
+ var self = this;
5337
+ this._timer = setTimeout(function() {
5338
+ self._attempts++;
5339
+ if (self._operationTimeoutCb) {
5340
+ self._timeout = setTimeout(function() {
5341
+ self._operationTimeoutCb(self._attempts);
5342
+ }, self._operationTimeout);
5343
+ if (self._options.unref) {
5344
+ self._timeout.unref();
5345
+ }
5346
+ }
5347
+ self._fn(self._attempts);
5348
+ }, timeout);
5349
+ if (this._options.unref) {
5350
+ this._timer.unref();
5351
+ }
5352
+ return true;
5353
+ };
5354
+ RetryOperation.prototype.attempt = function(fn2, timeoutOps) {
5355
+ this._fn = fn2;
5356
+ if (timeoutOps) {
5357
+ if (timeoutOps.timeout) {
5358
+ this._operationTimeout = timeoutOps.timeout;
5359
+ }
5360
+ if (timeoutOps.cb) {
5361
+ this._operationTimeoutCb = timeoutOps.cb;
5362
+ }
5363
+ }
5364
+ var self = this;
5365
+ if (this._operationTimeoutCb) {
5366
+ this._timeout = setTimeout(function() {
5367
+ self._operationTimeoutCb();
5368
+ }, self._operationTimeout);
5369
+ }
5370
+ this._operationStart = (/* @__PURE__ */ new Date()).getTime();
5371
+ this._fn(this._attempts);
5372
+ };
5373
+ RetryOperation.prototype.try = function(fn2) {
5374
+ console.log("Using RetryOperation.try() is deprecated");
5375
+ this.attempt(fn2);
5376
+ };
5377
+ RetryOperation.prototype.start = function(fn2) {
5378
+ console.log("Using RetryOperation.start() is deprecated");
5379
+ this.attempt(fn2);
5380
+ };
5381
+ RetryOperation.prototype.start = RetryOperation.prototype.try;
5382
+ RetryOperation.prototype.errors = function() {
5383
+ return this._errors;
5384
+ };
5385
+ RetryOperation.prototype.attempts = function() {
5386
+ return this._attempts;
5387
+ };
5388
+ RetryOperation.prototype.mainError = function() {
5389
+ if (this._errors.length === 0) {
5390
+ return null;
5391
+ }
5392
+ var counts = {};
5393
+ var mainError = null;
5394
+ var mainErrorCount = 0;
5395
+ for (var i2 = 0; i2 < this._errors.length; i2++) {
5396
+ var error = this._errors[i2];
5397
+ var message = error.message;
5398
+ var count = (counts[message] || 0) + 1;
5399
+ counts[message] = count;
5400
+ if (count >= mainErrorCount) {
5401
+ mainError = error;
5402
+ mainErrorCount = count;
5403
+ }
5404
+ }
5405
+ return mainError;
5406
+ };
5407
+ }
5408
+ });
5409
+ var require_retry = __commonJS({
5410
+ "../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry.js"(exports) {
5411
+ var RetryOperation = require_retry_operation();
5412
+ exports.operation = function(options) {
5413
+ var timeouts = exports.timeouts(options);
5414
+ return new RetryOperation(timeouts, {
5415
+ forever: options && (options.forever || options.retries === Infinity),
5416
+ unref: options && options.unref,
5417
+ maxRetryTime: options && options.maxRetryTime
5418
+ });
5419
+ };
5420
+ exports.timeouts = function(options) {
5421
+ if (options instanceof Array) {
5422
+ return [].concat(options);
5423
+ }
5424
+ var opts = {
5425
+ retries: 10,
5426
+ factor: 2,
5427
+ minTimeout: 1 * 1e3,
5428
+ maxTimeout: Infinity,
5429
+ randomize: false
5430
+ };
5431
+ for (var key in options) {
5432
+ opts[key] = options[key];
5433
+ }
5434
+ if (opts.minTimeout > opts.maxTimeout) {
5435
+ throw new Error("minTimeout is greater than maxTimeout");
5436
+ }
5437
+ var timeouts = [];
5438
+ for (var i2 = 0; i2 < opts.retries; i2++) {
5439
+ timeouts.push(this.createTimeout(i2, opts));
5440
+ }
5441
+ if (options && options.forever && !timeouts.length) {
5442
+ timeouts.push(this.createTimeout(i2, opts));
5443
+ }
5444
+ timeouts.sort(function(a2, b2) {
5445
+ return a2 - b2;
5446
+ });
5447
+ return timeouts;
5448
+ };
5449
+ exports.createTimeout = function(attempt, opts) {
5450
+ var random = opts.randomize ? Math.random() + 1 : 1;
5451
+ var timeout = Math.round(random * Math.max(opts.minTimeout, 1) * Math.pow(opts.factor, attempt));
5452
+ timeout = Math.min(timeout, opts.maxTimeout);
5453
+ return timeout;
5454
+ };
5455
+ exports.wrap = function(obj, options, methods) {
5456
+ if (options instanceof Array) {
5457
+ methods = options;
5458
+ options = null;
5459
+ }
5460
+ if (!methods) {
5461
+ methods = [];
5462
+ for (var key in obj) {
5463
+ if (typeof obj[key] === "function") {
5464
+ methods.push(key);
5465
+ }
5466
+ }
5467
+ }
5468
+ for (var i2 = 0; i2 < methods.length; i2++) {
5469
+ var method = methods[i2];
5470
+ var original = obj[method];
5471
+ obj[method] = function retryWrapper(original2) {
5472
+ var op = exports.operation(options);
5473
+ var args = Array.prototype.slice.call(arguments, 1);
5474
+ var callback = args.pop();
5475
+ args.push(function(err) {
5476
+ if (op.retry(err)) {
5477
+ return;
5478
+ }
5479
+ if (err) {
5480
+ arguments[0] = op.mainError();
5481
+ }
5482
+ callback.apply(this, arguments);
5483
+ });
5484
+ op.attempt(function() {
5485
+ original2.apply(obj, args);
5486
+ });
5487
+ }.bind(obj, original);
5488
+ obj[method].options = options;
5489
+ }
5490
+ };
5491
+ }
5492
+ });
5493
+ var require_retry2 = __commonJS({
5494
+ "../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/index.js"(exports, module2) {
5495
+ module2.exports = require_retry();
5496
+ }
5497
+ });
5498
+ var import_retry = __toESM2(require_retry2(), 1);
5499
+ var _url8;
5500
+ var _DataTypeClient = class extends ApiClient {
5501
+ constructor(options) {
5502
+ super(options);
5503
+ }
5504
+ /** Fetches all DataTypes for a project */
5505
+ async get(options) {
5506
+ const { projectId } = this.options;
5507
+ const fetchUri = this.createUrl(__privateGet2(_DataTypeClient, _url8), { ...options, projectId });
5508
+ return await this.apiClient(fetchUri);
5509
+ }
5510
+ /** Updates or creates (based on id) a DataType */
5511
+ async upsert(body) {
5512
+ const fetchUri = this.createUrl(__privateGet2(_DataTypeClient, _url8));
5513
+ await this.apiClient(fetchUri, {
5514
+ method: "PUT",
5515
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
5516
+ expectNoContent: true
5517
+ });
5518
+ }
5519
+ /** Deletes a DataType */
5520
+ async remove(body) {
5521
+ const fetchUri = this.createUrl(__privateGet2(_DataTypeClient, _url8));
5522
+ await this.apiClient(fetchUri, {
5523
+ method: "DELETE",
5524
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
5525
+ expectNoContent: true
5526
+ });
5527
+ }
5528
+ };
5529
+ var DataTypeClient = _DataTypeClient;
5530
+ _url8 = /* @__PURE__ */ new WeakMap();
5531
+ __privateAdd2(DataTypeClient, _url8, "/api/v1/data-types");
5532
+ var EDGE_MAX_L2_CACHE_TTL_IN_HOURS = 4 * 7 * 24;
5533
+ function bindVariables({
5534
+ variables,
5535
+ value,
5536
+ errorPrefix = "Variable",
5537
+ handleBinding
5538
+ }) {
5539
+ let boundCount = 0;
5540
+ const errors = [];
5541
+ const defaultHandleBinding = (variableName2, variables2, errors2) => {
5542
+ const variableValue2 = variables2[variableName2];
5543
+ if (variableValue2 === void 0) {
5544
+ errors2.push(`${errorPrefix} "${variableName2}" is not defined`);
5545
+ return "";
5546
+ }
5547
+ return variableValue2;
5548
+ };
5549
+ const result = value.replace(/(?<!\\)\${([^}]+)}/g, (_match, variableName2) => {
5550
+ const variableValue2 = (handleBinding != null ? handleBinding : defaultHandleBinding)(variableName2, variables, errors);
5551
+ boundCount++;
5552
+ return variableValue2;
5553
+ });
5554
+ return { result, boundCount, errors: errors.length > 0 ? errors : void 0 };
5555
+ }
5556
+ function bindVariablesToObject(options) {
5557
+ return bindVariablesToObjectRecursive(options);
5558
+ }
5559
+ function bindVariablesToObjectRecursive({
5560
+ value,
5561
+ recursivePath,
5562
+ ...bindVariablesOptions
5563
+ }) {
5564
+ let boundCount = 0;
5565
+ const errors = [];
5566
+ if (typeof value === "string") {
5567
+ return bindVariables({ ...bindVariablesOptions, value });
5568
+ }
5569
+ if (typeof value !== "object" || value === null) {
5570
+ return { boundCount: 0, result: value };
5571
+ }
5572
+ const result = fn(value, (draft) => {
5573
+ Object.entries(draft).forEach(([property, oldValue]) => {
5574
+ const currentObjectPath = recursivePath ? `${recursivePath}.${property}` : property;
5575
+ if (typeof oldValue === "string") {
5576
+ const bindResult = bindVariables({ ...bindVariablesOptions, value: oldValue });
5577
+ if (oldValue !== bindResult.result || bindResult.errors) {
5578
+ boundCount += bindResult.boundCount;
5579
+ draft[property] = bindResult.result;
5580
+ if (bindResult.errors) {
5581
+ errors.push(...bindResult.errors.map((e) => `${currentObjectPath}: ${e}`));
5582
+ }
5583
+ }
5584
+ return;
5585
+ }
5586
+ const childBind = bindVariablesToObject({
5587
+ ...bindVariablesOptions,
5588
+ value: oldValue,
5589
+ recursivePath: currentObjectPath
5590
+ });
5591
+ if (childBind.boundCount || childBind.errors) {
5592
+ boundCount += childBind.boundCount;
5593
+ draft[property] = childBind.result;
5594
+ if (childBind.errors) {
5595
+ errors.push(...childBind.errors.map((e) => `${currentObjectPath}: ${e}`));
5596
+ }
5597
+ }
5598
+ });
5599
+ });
5600
+ return { boundCount, result, errors: errors.length > 0 ? errors : void 0 };
5601
+ }
4247
5602
 
4248
- // src/components/ObjectSearch/ObjectSearchFilter.tsx
4249
- var import_design_system26 = require("@uniformdev/design-system");
4250
- var import_react43 = require("react");
5603
+ // src/components/ObjectSearch/ObjectSearchContainer.tsx
5604
+ var import_design_system25 = require("@uniformdev/design-system");
4251
5605
 
4252
5606
  // src/components/ObjectSearch/hooks/ObjectSearchContext.tsx
4253
- var import_react41 = require("react");
4254
- var import_jsx_runtime47 = require("@emotion/react/jsx-runtime");
4255
- var ObjectSearchContext = (0, import_react41.createContext)({
5607
+ var import_react43 = require("react");
5608
+ var import_jsx_runtime48 = require("@emotion/react/jsx-runtime");
5609
+ var ObjectSearchContext = (0, import_react43.createContext)({
4256
5610
  onSetQuery: () => {
4257
5611
  },
4258
5612
  onSelectItem: () => {
4259
5613
  },
4260
- query: {
4261
- contentType: "",
4262
- keyword: ""
4263
- },
5614
+ query: {},
5615
+ boundQuery: {},
4264
5616
  list: {},
4265
5617
  onSetList: () => {
4266
5618
  },
@@ -4269,26 +5621,27 @@ var ObjectSearchContext = (0, import_react41.createContext)({
4269
5621
  }
4270
5622
  });
4271
5623
  var ObjectSearchProvider = ({ currentlySelectedItems, children }) => {
4272
- const [query, setQuery] = (0, import_react41.useState)({
5624
+ const [query, setQuery] = (0, import_react43.useState)({
4273
5625
  contentType: "",
4274
5626
  keyword: ""
4275
5627
  });
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)(
4280
- (value) => {
4281
- if (Array.isArray(value.contentType) && value.contentType.length > 0) {
5628
+ const { flatVariables } = useVariables(true);
5629
+ const querySearchDeferred = (0, import_react43.useDeferredValue)(query);
5630
+ const [selectedItems, setSelectedItems] = (0, import_react43.useState)(currentlySelectedItems != null ? currentlySelectedItems : []);
5631
+ const [list, setList] = (0, import_react43.useState)({});
5632
+ const onSetQuery = (0, import_react43.useCallback)(
5633
+ (value2) => {
5634
+ if (Array.isArray(value2.contentType) && value2.contentType.length > 0) {
4282
5635
  return setQuery({
4283
- ...value,
4284
- contentType: value.contentType[0].id
5636
+ ...value2,
5637
+ contentType: value2.contentType[0].id
4285
5638
  });
4286
5639
  }
4287
- return setQuery(value);
5640
+ return setQuery(value2);
4288
5641
  },
4289
5642
  [setQuery]
4290
5643
  );
4291
- const onSelectItem = (0, import_react41.useCallback)(
5644
+ const onSelectItem = (0, import_react43.useCallback)(
4292
5645
  (selectedResult) => {
4293
5646
  if (Array.isArray(selectedResult)) {
4294
5647
  setSelectedItems(selectedResult);
@@ -4302,39 +5655,120 @@ var ObjectSearchProvider = ({ currentlySelectedItems, children }) => {
4302
5655
  },
4303
5656
  [setSelectedItems, selectedItems]
4304
5657
  );
4305
- const onRemoveAllSelectedItems = (0, import_react41.useCallback)(() => {
5658
+ const onRemoveAllSelectedItems = (0, import_react43.useCallback)(() => {
4306
5659
  setSelectedItems([]);
4307
5660
  }, [setSelectedItems]);
4308
- const onSetList = (0, import_react41.useCallback)(
4309
- (value) => {
4310
- setList(value);
5661
+ const onSetList = (0, import_react43.useCallback)(
5662
+ (value2) => {
5663
+ setList(value2);
4311
5664
  },
4312
5665
  [setList]
4313
5666
  );
4314
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
4315
- ObjectSearchContext.Provider,
4316
- {
4317
- value: {
4318
- onSetQuery,
4319
- query: querySearchDeferred,
4320
- onSelectItem,
4321
- selectedListItems: selectedItems,
4322
- onRemoveAllSelectedItems,
4323
- list,
4324
- onSetList
4325
- },
4326
- children
4327
- }
5667
+ const boundQuery = (0, import_react43.useMemo)(() => bindQuery(query, flatVariables), [query, flatVariables]);
5668
+ const value = (0, import_react43.useMemo)(
5669
+ () => ({
5670
+ boundQuery,
5671
+ onSetQuery,
5672
+ query: querySearchDeferred,
5673
+ onSelectItem,
5674
+ selectedListItems: selectedItems,
5675
+ onRemoveAllSelectedItems,
5676
+ list,
5677
+ onSetList
5678
+ }),
5679
+ [
5680
+ boundQuery,
5681
+ onSetQuery,
5682
+ querySearchDeferred,
5683
+ onSelectItem,
5684
+ selectedItems,
5685
+ onRemoveAllSelectedItems,
5686
+ list,
5687
+ onSetList
5688
+ ]
4328
5689
  );
5690
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ObjectSearchContext.Provider, { value, children });
4329
5691
  };
4330
- var useObjectSearchContext = () => {
4331
- const contextValues = (0, import_react41.useContext)(ObjectSearchContext);
4332
- return { ...contextValues };
5692
+ function useObjectSearchContext() {
5693
+ return (0, import_react43.useContext)(ObjectSearchContext);
5694
+ }
5695
+ function bindQuery(query, inputs) {
5696
+ const { result, errors } = bindVariablesToObject({
5697
+ value: query,
5698
+ variables: inputs,
5699
+ errorPrefix: "Dynamic input"
5700
+ });
5701
+ if (errors == null ? void 0 : errors.length) {
5702
+ console.error(`Error binding query filters to dynamic inputs`, errors);
5703
+ }
5704
+ return result;
5705
+ }
5706
+
5707
+ // src/components/ObjectSearch/ObjectSearchContainer.tsx
5708
+ var import_jsx_runtime49 = require("@emotion/react/jsx-runtime");
5709
+ var ObjectSearchContainer = ({
5710
+ label,
5711
+ enableDynamicInputToResultId,
5712
+ searchFilters,
5713
+ resultList,
5714
+ children
5715
+ }) => {
5716
+ var _a, _b;
5717
+ const { onSelectItem, selectedListItems, list } = useObjectSearchContext();
5718
+ const { flatVariables } = useVariables(true);
5719
+ const body = /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_design_system25.VerticalRhythm, { children: [
5720
+ searchFilters,
5721
+ !resultList ? null : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system25.ScrollableList, { role: "list", children: resultList })
5722
+ ] });
5723
+ const handleSelectedVariableChange = (selectedValue) => {
5724
+ var _a2;
5725
+ if (!selectedValue) {
5726
+ onSelectItem([]);
5727
+ return;
5728
+ }
5729
+ const { result, errors } = bindVariables({
5730
+ value: selectedValue,
5731
+ variables: flatVariables,
5732
+ errorPrefix: "Dynamic input"
5733
+ });
5734
+ if (!result) {
5735
+ onSelectItem([]);
5736
+ return;
5737
+ }
5738
+ const item = (_a2 = list.items) == null ? void 0 : _a2.find((i2) => i2.id === result);
5739
+ onSelectItem([
5740
+ {
5741
+ title: selectedValue,
5742
+ contentType: (errors == null ? void 0 : errors.length) ? errors[0] : `Current dynamic value "${result}" is not an ID in the options`,
5743
+ // spread any matched list item, overriding the above default props
5744
+ ...item,
5745
+ // we want to make sure the ID is our dynamic value
5746
+ id: selectedValue
5747
+ }
5748
+ ]);
5749
+ };
5750
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system25.IconsProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_design_system25.VerticalRhythm, { children: [
5751
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system25.Container, { backgroundColor: "gray-50", padding: "var(--spacing-base)", border: true, children: label ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
5752
+ InputVariables,
5753
+ {
5754
+ label,
5755
+ value: (_b = (_a = selectedListItems == null ? void 0 : selectedListItems[0]) == null ? void 0 : _a.id) != null ? _b : "",
5756
+ onChange: handleSelectedVariableChange,
5757
+ inputWhenNoVariables: body,
5758
+ disableVariables: !enableDynamicInputToResultId
5759
+ }
5760
+ ) : body }),
5761
+ children
5762
+ ] }) });
4333
5763
  };
4334
5764
 
5765
+ // src/components/ObjectSearch/ObjectSearchFilter.tsx
5766
+ var import_design_system26 = require("@uniformdev/design-system");
5767
+ var import_react45 = require("react");
5768
+
4335
5769
  // src/components/ObjectSearch/styles/ObjectSearchFilterContainer.styles.ts
4336
- var import_react42 = require("@emotion/react");
4337
- var ObjectSearchFilterContainerLabel = import_react42.css`
5770
+ var import_react44 = require("@emotion/react");
5771
+ var ObjectSearchFilterContainerLabel = import_react44.css`
4338
5772
  align-items: center;
4339
5773
  display: flex;
4340
5774
  font-size: var(--fs-sm);
@@ -4342,21 +5776,21 @@ var ObjectSearchFilterContainerLabel = import_react42.css`
4342
5776
  line-height: 1rem;
4343
5777
  margin-bottom: var(--spacing-sm);
4344
5778
  `;
4345
- var ObjectSearchFilterContainer = import_react42.css`
5779
+ var ObjectSearchFilterContainer = import_react44.css`
4346
5780
  display: grid;
4347
5781
  gap: var(--spacing-base);
4348
5782
  `;
4349
- var ObjectSearchFilterDropdownAndTextSearch = import_react42.css`
5783
+ var ObjectSearchFilterDropdownAndTextSearch = import_react44.css`
4350
5784
  grid-template-columns: 0.5fr 1fr;
4351
5785
  `;
4352
- var ObjectSearchFilterGrid = (gridColumns) => import_react42.css`
5786
+ var ObjectSearchFilterGrid = (gridColumns) => import_react44.css`
4353
5787
  display: grid;
4354
5788
  grid-template-columns: ${gridColumns};
4355
5789
  gap: var(--spacing-base);
4356
5790
  `;
4357
5791
 
4358
5792
  // src/components/ObjectSearch/ObjectSearchFilter.tsx
4359
- var import_jsx_runtime48 = require("@emotion/react/jsx-runtime");
5793
+ var import_jsx_runtime50 = require("@emotion/react/jsx-runtime");
4360
5794
  var ObjectSearchFilter = ({
4361
5795
  requireContentType,
4362
5796
  typeSelectorAllTypesOptionText = "All content types",
@@ -4366,7 +5800,7 @@ var ObjectSearchFilter = ({
4366
5800
  selectOptions
4367
5801
  }) => {
4368
5802
  const { query, onSetQuery } = useObjectSearchContext();
4369
- const [searchState, setSearchState] = (0, import_react43.useState)({
5803
+ const [searchState, setSearchState] = (0, import_react45.useState)({
4370
5804
  contentType: "",
4371
5805
  keyword: ""
4372
5806
  });
@@ -4376,8 +5810,8 @@ var ObjectSearchFilter = ({
4376
5810
  });
4377
5811
  onSetQuery({ ...query, ...value });
4378
5812
  };
4379
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("fieldset", { css: [ObjectSearchFilterContainer, ObjectSearchFilterDropdownAndTextSearch], children: [
4380
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
5813
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("fieldset", { css: [ObjectSearchFilterContainer, ObjectSearchFilterDropdownAndTextSearch], children: [
5814
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
4381
5815
  import_design_system26.InputSelect,
4382
5816
  {
4383
5817
  label: selectLabel,
@@ -4393,7 +5827,7 @@ var ObjectSearchFilter = ({
4393
5827
  value: query.contentType
4394
5828
  }
4395
5829
  ),
4396
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
5830
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
4397
5831
  import_design_system26.InputKeywordSearch,
4398
5832
  {
4399
5833
  inputFieldName: searchInputName,
@@ -4408,11 +5842,11 @@ var ObjectSearchFilter = ({
4408
5842
  };
4409
5843
 
4410
5844
  // src/components/ObjectSearch/ObjectSearchFilterContainer.tsx
4411
- var import_jsx_runtime49 = require("@emotion/react/jsx-runtime");
5845
+ var import_jsx_runtime51 = require("@emotion/react/jsx-runtime");
4412
5846
  var ObjectSearchFilterContainer2 = ({ label, children }) => {
4413
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { children: [
4414
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { css: ObjectSearchFilterContainerLabel, children: label }),
4415
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { css: ObjectSearchFilterContainer, children })
5847
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { children: [
5848
+ label ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { css: ObjectSearchFilterContainerLabel, children: label }) : null,
5849
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { css: ObjectSearchFilterContainer, children })
4416
5850
  ] });
4417
5851
  };
4418
5852
 
@@ -4420,9 +5854,9 @@ var ObjectSearchFilterContainer2 = ({ label, children }) => {
4420
5854
  var import_design_system28 = require("@uniformdev/design-system");
4421
5855
 
4422
5856
  // src/components/ObjectSearch/styles/ObjectSearchListItem.styles.ts
4423
- var import_react44 = require("@emotion/react");
5857
+ var import_react46 = require("@emotion/react");
4424
5858
  var import_design_system27 = require("@uniformdev/design-system");
4425
- var ObjectListItemContainer = import_react44.css`
5859
+ var ObjectListItemContainer = import_react46.css`
4426
5860
  align-items: center;
4427
5861
  border: 1px solid var(--gray-300);
4428
5862
  border-radius: var(--rounded-base);
@@ -4435,7 +5869,7 @@ var ObjectListItemContainer = import_react44.css`
4435
5869
  display: none;
4436
5870
  }
4437
5871
  `;
4438
- var ObjectListItemLoading = import_react44.css`
5872
+ var ObjectListItemLoading = import_react46.css`
4439
5873
  animation: ${import_design_system27.skeletonLoading} 1s linear infinite alternate;
4440
5874
  border-color: transparent;
4441
5875
  min-height: 42px;
@@ -4459,37 +5893,37 @@ var ObjectListItemLoading = import_react44.css`
4459
5893
  width: 1rem;
4460
5894
  }
4461
5895
  `;
4462
- var ObjectListItemHeadingGroup = import_react44.css`
5896
+ var ObjectListItemHeadingGroup = import_react46.css`
4463
5897
  align-items: center;
4464
5898
  display: grid;
4465
5899
  `;
4466
- var ObjectListItemTitle = import_react44.css`
5900
+ var ObjectListItemTitle = import_react46.css`
4467
5901
  color: var(--brand-secondary-1);
4468
5902
  display: block;
4469
5903
  font-size: var(--fs-sm);
4470
5904
  `;
4471
- var ObjectListItemSubtitle = import_react44.css`
5905
+ var ObjectListItemSubtitle = import_react46.css`
4472
5906
  color: var(--gray-500);
4473
5907
  display: block;
4474
5908
  font-size: var(--fs-xs);
4475
5909
  line-height: 1;
4476
5910
  `;
4477
- var ObjectListItemInfoContainer = import_react44.css`
5911
+ var ObjectListItemInfoContainer = import_react46.css`
4478
5912
  align-items: center;
4479
5913
  display: flex;
4480
5914
  justify-content: center;
4481
5915
  `;
4482
- var ObjectListItemControlledContent = import_react44.css`
5916
+ var ObjectListItemControlledContent = import_react46.css`
4483
5917
  display: flex;
4484
5918
  gap: var(--spacing-sm);
4485
5919
  `;
4486
- var ObjectListItemUnControlledContent = import_react44.css`
5920
+ var ObjectListItemUnControlledContent = import_react46.css`
4487
5921
  margin-top: var(--spacing-sm);
4488
5922
  grid-column: 1 / -1;
4489
5923
  `;
4490
5924
 
4491
5925
  // src/components/ObjectSearch/ObjectSearchListItem.tsx
4492
- var import_jsx_runtime50 = require("@emotion/react/jsx-runtime");
5926
+ var import_jsx_runtime52 = require("@emotion/react/jsx-runtime");
4493
5927
  var ObjectSearchListItem = ({
4494
5928
  id,
4495
5929
  title,
@@ -4498,8 +5932,7 @@ var ObjectSearchListItem = ({
4498
5932
  popoverData,
4499
5933
  onSelect,
4500
5934
  isMulti = false,
4501
- children,
4502
- ...props
5935
+ children
4503
5936
  }) => {
4504
5937
  const { onSelectItem, selectedListItems } = useObjectSearchContext();
4505
5938
  const formatedContentType = Array.isArray(contentType) ? contentType.join(", ") : contentType;
@@ -4513,20 +5946,20 @@ var ObjectSearchListItem = ({
4513
5946
  return onSelectItem([selectedItem]);
4514
5947
  };
4515
5948
  const hideWhenInSelectedList = selectedListItems.some((item) => item.id === id);
4516
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { role: "listitem", hidden: hideWhenInSelectedList, css: ObjectListItemContainer, ...props, children: [
4517
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { role: "button", onClick: handleSelectItem, css: ObjectListItemControlledContent, children: [
4518
- !image ? null : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("img", { ...image, loading: (image == null ? void 0 : image.width) && image.height ? "lazy" : "eager" }),
4519
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { role: "heading", css: ObjectListItemHeadingGroup, children: [
4520
- !contentType ? null : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { css: ObjectListItemSubtitle, children: formatedContentType }),
4521
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { css: ObjectListItemTitle, children: title })
5949
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { role: "listitem", hidden: hideWhenInSelectedList, css: ObjectListItemContainer, children: [
5950
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { role: "button", onClick: handleSelectItem, css: ObjectListItemControlledContent, children: [
5951
+ !image ? null : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("img", { ...image, loading: (image == null ? void 0 : image.width) && image.height ? "lazy" : "eager" }),
5952
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { role: "heading", css: ObjectListItemHeadingGroup, children: [
5953
+ !contentType ? null : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { css: ObjectListItemSubtitle, children: formatedContentType }),
5954
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { css: ObjectListItemTitle, children: title })
4522
5955
  ] })
4523
5956
  ] }),
4524
- !popoverData ? null : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { css: ObjectListItemInfoContainer, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system28.Popover, { baseId: title, ariaLabel: title, buttonText: `See ${title} details`, children: popoverData }) }),
4525
- !children ? null : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { css: ObjectListItemUnControlledContent, children })
5957
+ !popoverData ? null : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { css: ObjectListItemInfoContainer, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_design_system28.Popover, { baseId: title, ariaLabel: title, buttonText: `See ${title} details`, children: popoverData }) }),
5958
+ !children ? null : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { css: ObjectListItemUnControlledContent, children })
4526
5959
  ] });
4527
5960
  };
4528
5961
  var ObjectSearchListItemLoadingSkeleton = () => {
4529
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { role: "presentation", css: [ObjectListItemContainer, ObjectListItemLoading] });
5962
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { role: "presentation", css: [ObjectListItemContainer, ObjectListItemLoading] });
4530
5963
  };
4531
5964
 
4532
5965
  // src/components/ObjectSearch/ObjectSearchResultItem.tsx
@@ -4534,9 +5967,9 @@ var import_design_system30 = require("@uniformdev/design-system");
4534
5967
  var import_timeago3 = require("timeago.js");
4535
5968
 
4536
5969
  // src/components/ObjectSearch/styles/ObjectSearchResultItemButton.styles.ts
4537
- var import_react45 = require("@emotion/react");
5970
+ var import_react47 = require("@emotion/react");
4538
5971
  var import_design_system29 = require("@uniformdev/design-system");
4539
- var ButtonStyles = import_react45.css`
5972
+ var ButtonStyles = import_react47.css`
4540
5973
  ${import_design_system29.button}
4541
5974
  background: transparent;
4542
5975
  border: 1px solid var(--brand-secondary-1);
@@ -4563,20 +5996,20 @@ var ButtonStyles = import_react45.css`
4563
5996
  text-decoration: none;
4564
5997
  }
4565
5998
  `;
4566
- var ButtonIcon = import_react45.css`
5999
+ var ButtonIcon = import_react47.css`
4567
6000
  width: 1rem;
4568
6001
  height: 1rem;
4569
6002
  `;
4570
6003
 
4571
6004
  // src/components/ObjectSearch/ObjectSearchResultItemButton.tsx
4572
- var import_jsx_runtime51 = require("@emotion/react/jsx-runtime");
6005
+ var import_jsx_runtime53 = require("@emotion/react/jsx-runtime");
4573
6006
  var ObjectSearchResultItemButton = ({
4574
6007
  text,
4575
6008
  icon,
4576
6009
  ...props
4577
6010
  }) => {
4578
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("button", { type: "button", css: ButtonStyles, ...props, children: [
4579
- !icon ? null : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Image, { src: icon, css: ButtonIcon }),
6011
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("button", { type: "button", css: ButtonStyles, ...props, children: [
6012
+ !icon ? null : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Image, { src: icon, css: ButtonIcon }),
4580
6013
  text
4581
6014
  ] });
4582
6015
  };
@@ -4585,15 +6018,15 @@ var LinkButton = ({
4585
6018
  icon,
4586
6019
  ...props
4587
6020
  }) => {
4588
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("a", { ...props, css: ButtonStyles, target: "_blank", rel: "noopener noreferrer", children: [
4589
- !icon ? null : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Image, { src: icon, css: ButtonIcon }),
6021
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("a", { ...props, css: ButtonStyles, target: "_blank", rel: "noopener noreferrer", children: [
6022
+ !icon ? null : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Image, { src: icon, css: ButtonIcon }),
4590
6023
  text
4591
6024
  ] });
4592
6025
  };
4593
6026
 
4594
6027
  // src/components/ObjectSearch/styles/ObjectSearchResultItem.styles.ts
4595
- var import_react46 = require("@emotion/react");
4596
- var ObjectSearchResultItemContainer = import_react46.css`
6028
+ var import_react48 = require("@emotion/react");
6029
+ var ObjectSearchResultItemContainer = import_react48.css`
4597
6030
  align-items: center;
4598
6031
  border: 1px solid var(--gray-300);
4599
6032
  border-radius: var(--rounded-base);
@@ -4609,7 +6042,7 @@ var ObjectSearchResultItemContainer = import_react46.css`
4609
6042
  }
4610
6043
  }
4611
6044
  `;
4612
- var ObjectSearchDragHandle = import_react46.css`
6045
+ var ObjectSearchDragHandle = import_react48.css`
4613
6046
  border-left: 2px dotted var(--gray-300);
4614
6047
  border-right: 2px dotted var(--gray-300);
4615
6048
  position: absolute;
@@ -4618,41 +6051,41 @@ var ObjectSearchDragHandle = import_react46.css`
4618
6051
  transition: opacity var(--duration-fast) var(--timing-ease-out);
4619
6052
  opacity: 0;
4620
6053
  `;
4621
- var ObjectSearchResultItemSubtitle = import_react46.css`
6054
+ var ObjectSearchResultItemSubtitle = import_react48.css`
4622
6055
  color: var(--gray-500);
4623
6056
  display: block;
4624
6057
  font-size: var(--fs-xs);
4625
6058
  line-height: 1;
4626
6059
  `;
4627
- var ObjectSearchResultItemTitle = import_react46.css`
6060
+ var ObjectSearchResultItemTitle = import_react48.css`
4628
6061
  align-items: center;
4629
6062
  color: var(--brand-secondary-1);
4630
6063
  display: flex;
4631
6064
  gap: var(--spacing-xs);
4632
6065
  `;
4633
- var ObjectSearchResultItemTimeStamp = import_react46.css`
6066
+ var ObjectSearchResultItemTimeStamp = import_react48.css`
4634
6067
  color: var(--gray-500);
4635
6068
  font-size: var(--fs-xs);
4636
6069
  `;
4637
- var ObjectSearchAuthorStateGroup = import_react46.css`
6070
+ var ObjectSearchAuthorStateGroup = import_react48.css`
4638
6071
  align-items: center;
4639
6072
  display: flex;
4640
6073
  gap: var(--spacing-sm);
4641
6074
  `;
4642
- var ObjectSearchUpdateGroup = import_react46.css`
6075
+ var ObjectSearchUpdateGroup = import_react48.css`
4643
6076
  display: grid;
4644
6077
  `;
4645
- var ObjectSearchContentContainer = import_react46.css`
6078
+ var ObjectSearchContentContainer = import_react48.css`
4646
6079
  display: flex;
4647
6080
  gap: var(--spacing-base);
4648
6081
  `;
4649
- var ObjectSearchImage = import_react46.css`
6082
+ var ObjectSearchImage = import_react48.css`
4650
6083
  width: 56px;
4651
6084
  object-fit: contain;
4652
6085
  `;
4653
6086
 
4654
6087
  // src/components/ObjectSearch/ObjectSearchResultItem.tsx
4655
- var import_jsx_runtime52 = require("@emotion/react/jsx-runtime");
6088
+ var import_jsx_runtime54 = require("@emotion/react/jsx-runtime");
4656
6089
  var ObjectSearchResultItem = ({
4657
6090
  id,
4658
6091
  title,
@@ -4673,38 +6106,38 @@ var ObjectSearchResultItem = ({
4673
6106
  const { onSelectItem } = useObjectSearchContext();
4674
6107
  const formatedContentType = Array.isArray(contentType) ? contentType.join(", ") : contentType;
4675
6108
  const onRemoveItem = () => {
4676
- onSelectItem({ id });
6109
+ onSelectItem({ id, title: id });
4677
6110
  onRemove == null ? void 0 : onRemove();
4678
6111
  };
4679
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { css: ObjectSearchResultItemContainer, children: [
4680
- disableDnD ? null : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { role: "presentation", className: "drag-handle", css: ObjectSearchDragHandle }),
4681
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { css: ObjectSearchContentContainer, children: [
4682
- !imageUrl ? null : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("img", { src: imageUrl, alt: `Thumbnail for ${title}`, css: ObjectSearchImage }),
4683
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { children: [
4684
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { css: ObjectSearchResultItemSubtitle, children: formatedContentType }),
4685
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("span", { role: "heading", css: ObjectSearchResultItemTitle, children: [
6112
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { css: ObjectSearchResultItemContainer, children: [
6113
+ disableDnD ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { role: "presentation", className: "drag-handle", css: ObjectSearchDragHandle }),
6114
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { css: ObjectSearchContentContainer, children: [
6115
+ !imageUrl ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("img", { src: imageUrl, alt: `Thumbnail for ${title}`, css: ObjectSearchImage }),
6116
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { children: [
6117
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { css: ObjectSearchResultItemSubtitle, children: formatedContentType }),
6118
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { role: "heading", css: ObjectSearchResultItemTitle, children: [
4686
6119
  title != null ? title : name,
4687
- !popoverData ? null : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_design_system30.Popover, { baseId: title, ariaLabel: title, buttonText: `See ${title} details`, children: popoverData })
6120
+ !popoverData ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_design_system30.Popover, { baseId: title, ariaLabel: title, buttonText: `See ${title} details`, children: popoverData })
4688
6121
  ] }),
4689
- !createdAt && !publishStatus ? null : /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { css: ObjectSearchAuthorStateGroup, children: [
4690
- !(publishStatus == null ? void 0 : publishStatus.text) ? null : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_design_system30.Badge, { ...publishStatus, size: "sm", uppercaseText: true }),
4691
- !createdAt && !publishedAt ? null : /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { css: ObjectSearchUpdateGroup, children: [
4692
- !createdAt ? null : /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("small", { css: ObjectSearchResultItemTimeStamp, children: [
4693
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("strong", { children: "Last updated: " }),
6122
+ !createdAt && !publishStatus ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { css: ObjectSearchAuthorStateGroup, children: [
6123
+ !(publishStatus == null ? void 0 : publishStatus.text) ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_design_system30.Badge, { ...publishStatus, size: "sm", uppercaseText: true }),
6124
+ !createdAt && !publishedAt ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { css: ObjectSearchUpdateGroup, children: [
6125
+ !createdAt ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("small", { css: ObjectSearchResultItemTimeStamp, children: [
6126
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("strong", { children: "Last updated: " }),
4694
6127
  (0, import_timeago3.format)(createdAt)
4695
6128
  ] }),
4696
- !publishedAt ? null : /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("small", { css: ObjectSearchResultItemTimeStamp, children: [
4697
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("strong", { children: "Last published: " }),
6129
+ !publishedAt ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("small", { css: ObjectSearchResultItemTimeStamp, children: [
6130
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("strong", { children: "Last published: " }),
4698
6131
  (0, import_timeago3.format)(publishedAt)
4699
6132
  ] })
4700
6133
  ] })
4701
6134
  ] }),
4702
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { children })
6135
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { children })
4703
6136
  ] })
4704
6137
  ] }) }),
4705
- !editLink && hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { css: ObjectSearchAuthorStateGroup, children: [
4706
- !editLink ? null : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(LinkButton, { text: "Edit", href: editLink, icon: editLinkIcon }),
4707
- hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_design_system30.Button, { buttonType: "ghostDestructive", onClick: onRemoveItem, children: "Remove" })
6138
+ !editLink && hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { css: ObjectSearchAuthorStateGroup, children: [
6139
+ !editLink ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(LinkButton, { text: "Edit", href: editLink, icon: editLinkIcon }),
6140
+ hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_design_system30.Button, { buttonType: "ghostDestructive", onClick: onRemoveItem, children: "Remove" })
4708
6141
  ] })
4709
6142
  ] });
4710
6143
  };
@@ -4714,38 +6147,39 @@ var import_design_system31 = require("@uniformdev/design-system");
4714
6147
  var import_react_beautiful_dnd3 = require("react-beautiful-dnd");
4715
6148
 
4716
6149
  // src/components/ObjectSearch/styles/ObjectSearchResultList.styles.ts
4717
- var import_react47 = require("@emotion/react");
4718
- var ObjectSearchResultListContainer = import_react47.css`
6150
+ var import_react49 = require("@emotion/react");
6151
+ var ObjectSearchResultListContainer = import_react49.css`
4719
6152
  align-items: center;
4720
6153
  display: flex;
4721
6154
  gap: var(--spacing-sm);
4722
6155
  justify-content: space-between;
4723
6156
  `;
4724
- var ObjectSearchDragContainer = import_react47.css`
6157
+ var ObjectSearchDragContainer = import_react49.css`
4725
6158
  margin: 0 0 var(--spacing-sm);
4726
6159
  `;
4727
- var ObjectSearchResultListCounterContainer = import_react47.css`
6160
+ var ObjectSearchResultListCounterContainer = import_react49.css`
4728
6161
  align-items: center;
4729
6162
  display: flex;
4730
6163
  gap: var(--spacing-sm);
4731
6164
  `;
4732
- var ObjectSearchResultListTitle = import_react47.css`
6165
+ var ObjectSearchResultListTitle = import_react49.css`
4733
6166
  font-weight: var(--fw-bold);
4734
6167
  line-height: 1;
4735
6168
  `;
4736
6169
 
4737
6170
  // src/components/ObjectSearch/ObjectSearchResultList.tsx
4738
- var import_jsx_runtime53 = require("@emotion/react/jsx-runtime");
4739
- var ObjectSearchResultList = ({
6171
+ var import_jsx_runtime55 = require("@emotion/react/jsx-runtime");
6172
+ function ObjectSearchResultList({
4740
6173
  resultLabelText = "Selected",
4741
6174
  removeButtonText = "Remove all",
4742
6175
  onRemoveAllSelected,
4743
6176
  hideRemoveButton = false,
4744
6177
  additionalButtons,
4745
- renderResultComponent = (value) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ObjectSearchResultItem, { ...value, disableDnD }),
6178
+ renderResultComponent = (value) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ObjectSearchResultItem, { ...value, disableDnD }),
4746
6179
  multiSelectId,
4747
- disableDnD = false
4748
- }) => {
6180
+ disableDnD = false,
6181
+ whenNothingSelected = null
6182
+ }) {
4749
6183
  const { selectedListItems, onRemoveAllSelectedItems, onSelectItem } = useObjectSearchContext();
4750
6184
  const handleRemoveAllSelectedItems = () => {
4751
6185
  onRemoveAllSelectedItems();
@@ -4761,16 +6195,16 @@ var ObjectSearchResultList = ({
4761
6195
  return result;
4762
6196
  }
4763
6197
  };
4764
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_jsx_runtime53.Fragment, { children: [
4765
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { role: "group", css: ObjectSearchResultListContainer, children: [
4766
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { role: "note", css: ObjectSearchResultListCounterContainer, children: [
4767
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { css: ObjectSearchResultListTitle, children: resultLabelText }),
6198
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
6199
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { role: "group", css: ObjectSearchResultListContainer, children: [
6200
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { role: "note", css: ObjectSearchResultListCounterContainer, children: [
6201
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { css: ObjectSearchResultListTitle, children: resultLabelText }),
4768
6202
  " ",
4769
- !selectedListItems.length ? null : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_design_system31.Counter, { count: selectedListItems.length })
6203
+ !selectedListItems.length ? null : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_design_system31.Counter, { count: selectedListItems.length })
4770
6204
  ] }),
4771
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { css: ObjectSearchResultListCounterContainer, children: [
6205
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { css: ObjectSearchResultListCounterContainer, children: [
4772
6206
  additionalButtons,
4773
- hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
6207
+ hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
4774
6208
  import_design_system31.Button,
4775
6209
  {
4776
6210
  buttonType: "ghostDestructive",
@@ -4782,10 +6216,10 @@ var ObjectSearchResultList = ({
4782
6216
  )
4783
6217
  ] })
4784
6218
  ] }),
4785
- !selectedListItems.length ? null : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react_beautiful_dnd3.DragDropContext, { onDragEnd: (res) => onDragEnd(res), children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react_beautiful_dnd3.Droppable, { droppableId: multiSelectId != null ? multiSelectId : "canvas-multi-select", children: (provided) => /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { ...provided.droppableProps, ref: provided.innerRef, children: [
4786
- selectedListItems.map((item, i) => {
6219
+ !selectedListItems.length ? whenNothingSelected : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_react_beautiful_dnd3.DragDropContext, { onDragEnd: (res) => onDragEnd(res), children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_react_beautiful_dnd3.Droppable, { droppableId: multiSelectId != null ? multiSelectId : "canvas-multi-select", children: (provided) => /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { ...provided.droppableProps, ref: provided.innerRef, children: [
6220
+ selectedListItems.map((item, i2) => {
4787
6221
  const renderListItem = renderResultComponent(item);
4788
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react_beautiful_dnd3.Draggable, { draggableId: item.id, index: i, isDragDisabled: disableDnD, children: (provided2, snapshot) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
6222
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_react_beautiful_dnd3.Draggable, { draggableId: item.id, index: i2, isDragDisabled: disableDnD, children: (provided2, snapshot) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
4789
6223
  "div",
4790
6224
  {
4791
6225
  css: ObjectSearchDragContainer,
@@ -4800,12 +6234,12 @@ var ObjectSearchResultList = ({
4800
6234
  provided.placeholder
4801
6235
  ] }) }) })
4802
6236
  ] });
4803
- };
6237
+ }
4804
6238
 
4805
6239
  // src/components/ObjectSearch/QueryFilter.tsx
4806
6240
  var import_design_system32 = require("@uniformdev/design-system");
4807
- var import_react48 = require("react");
4808
- var import_jsx_runtime54 = require("@emotion/react/jsx-runtime");
6241
+ var import_react50 = require("react");
6242
+ var import_jsx_runtime56 = require("@emotion/react/jsx-runtime");
4809
6243
  var QueryFilter = ({
4810
6244
  requireContentType,
4811
6245
  queryFilterTitle = "Configure Query",
@@ -4814,9 +6248,10 @@ var QueryFilter = ({
4814
6248
  contentTypeOptions,
4815
6249
  searchInputName = "searchText",
4816
6250
  searchInputPlaceholderText = "Enter keyword to narrow your results",
6251
+ searchInputLabel = "Query",
4817
6252
  countLabel = "Count",
4818
6253
  countValue = 5,
4819
- sortLabel = "Sort",
6254
+ sortLabel = "Sort By",
4820
6255
  sortOptions,
4821
6256
  sortOrderLabel = "Sort Order",
4822
6257
  sortOrderOptions = [
@@ -4833,9 +6268,9 @@ var QueryFilter = ({
4833
6268
  ],
4834
6269
  children
4835
6270
  }) => {
4836
- var _a, _b;
6271
+ var _a, _b, _c, _d;
4837
6272
  const { query, onSetQuery } = useObjectSearchContext();
4838
- const [queryState, setQueryState] = (0, import_react48.useState)({
6273
+ const [queryState, setQueryState] = (0, import_react50.useState)({
4839
6274
  contentType: "",
4840
6275
  keyword: "",
4841
6276
  count: countValue != null ? countValue : 5,
@@ -4846,87 +6281,145 @@ var QueryFilter = ({
4846
6281
  setQueryState((prev) => ({ ...prev, ...value }));
4847
6282
  onSetQuery({ ...query, ...value });
4848
6283
  };
4849
- (0, import_react48.useEffect)(() => {
6284
+ (0, import_react50.useEffect)(() => {
4850
6285
  onSetQuery(queryState);
4851
6286
  }, [onSetQuery, queryState]);
4852
- return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("fieldset", { children: [
4853
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { css: ObjectSearchFilterContainerLabel, children: queryFilterTitle }),
4854
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { css: ObjectSearchFilterContainer, children: [
4855
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { css: ObjectSearchFilterGrid("0.5fr 1fr"), children: [
4856
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
4857
- import_design_system32.InputSelect,
6287
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("fieldset", { children: [
6288
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { css: ObjectSearchFilterContainerLabel, children: queryFilterTitle }),
6289
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { css: ObjectSearchFilterContainer, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_design_system32.VerticalRhythm, { children: [
6290
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
6291
+ InputVariables,
6292
+ {
6293
+ label: searchInputLabel,
6294
+ value: (_c = queryState.keyword) != null ? _c : "",
6295
+ onChange: (newQuery) => handleFilterChange({ keyword: newQuery }),
6296
+ disableInlineMenu: true,
6297
+ id: "qf_searchText",
6298
+ inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
6299
+ import_design_system32.InputKeywordSearch,
6300
+ {
6301
+ id: "qf_searchText",
6302
+ inputFieldName: searchInputName,
6303
+ placeholder: searchInputPlaceholderText,
6304
+ onSearchTextChanged: (e) => handleFilterChange({ keyword: e }),
6305
+ disabledFieldSubmission: true,
6306
+ onClear: () => handleFilterChange({ keyword: "" }),
6307
+ value: queryState.keyword
6308
+ }
6309
+ )
6310
+ }
6311
+ ),
6312
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { css: ObjectSearchFilterGrid("1fr 100px"), children: [
6313
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
6314
+ InputVariables,
4858
6315
  {
4859
6316
  label: contentTypeLabel,
4860
- showLabel: false,
4861
- options: [
4862
- ...!requireContentType ? [{ id: "", label: typeSelectorAllTypesOptionText }] : [],
4863
- ...contentTypeOptions ? contentTypeOptions.map((option) => {
4864
- var _a2;
4865
- return { id: option.id, label: (_a2 = option.label) != null ? _a2 : option.name, name: option.name };
4866
- }) : []
4867
- ],
4868
- onChange: (e) => handleFilterChange({ contentType: e.target.value }),
4869
- value: queryState.contentType
6317
+ id: "qf_contentType",
6318
+ value: (_d = queryState.contentType) != null ? _d : "",
6319
+ onChange: (newType) => handleFilterChange({ contentType: newType }),
6320
+ disableInlineMenu: true,
6321
+ inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
6322
+ import_design_system32.InputSelect,
6323
+ {
6324
+ id: "qf_contentType",
6325
+ label: contentTypeLabel,
6326
+ showLabel: false,
6327
+ options: [
6328
+ ...!requireContentType ? [{ id: "", label: typeSelectorAllTypesOptionText }] : [],
6329
+ ...contentTypeOptions ? contentTypeOptions.map((option) => {
6330
+ var _a2;
6331
+ return { id: option.id, label: (_a2 = option.label) != null ? _a2 : option.name, name: option.name };
6332
+ }) : []
6333
+ ],
6334
+ onChange: (e) => handleFilterChange({ contentType: e.target.value }),
6335
+ value: queryState.contentType
6336
+ }
6337
+ )
4870
6338
  }
4871
6339
  ),
4872
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
4873
- import_design_system32.InputKeywordSearch,
6340
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
6341
+ InputVariables,
4874
6342
  {
4875
- inputFieldName: searchInputName,
4876
- placeholder: searchInputPlaceholderText,
4877
- onSearchTextChanged: (e) => handleFilterChange({ keyword: e }),
4878
- disabledFieldSubmission: true,
4879
- onClear: () => handleFilterChange({ keyword: "" }),
4880
- value: queryState.keyword
6343
+ label: countLabel,
6344
+ id: "qf_count",
6345
+ value: queryState.count.toString(10),
6346
+ onChange: (newCount) => handleFilterChange({ count: newCount }),
6347
+ disableInlineMenu: true,
6348
+ inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
6349
+ import_design_system32.Input,
6350
+ {
6351
+ id: "qf_count",
6352
+ label: countLabel,
6353
+ showLabel: false,
6354
+ type: "number",
6355
+ onChange: (e) => handleFilterChange({ count: e.target.value }),
6356
+ defaultValue: countValue,
6357
+ value: queryState.count
6358
+ }
6359
+ )
4881
6360
  }
4882
6361
  )
4883
6362
  ] }),
4884
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { css: ObjectSearchFilterGrid("repeat(2, 1fr) 0.5fr"), children: [
4885
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
4886
- import_design_system32.InputSelect,
6363
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { css: ObjectSearchFilterGrid("2fr 1fr"), children: [
6364
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
6365
+ InputVariables,
4887
6366
  {
6367
+ id: "qf_sortBy",
4888
6368
  label: sortLabel,
4889
- options: [
6369
+ value: queryState.sortBy,
6370
+ onChange: (newSortBy) => handleFilterChange({ sortBy: newSortBy }),
6371
+ disableInlineMenu: true,
6372
+ inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
6373
+ import_design_system32.InputSelect,
4890
6374
  {
4891
- label: "Select a sort",
4892
- id: ""
4893
- },
4894
- ...sortOptions ? sortOptions.map((option) => {
4895
- var _a2;
4896
- return { id: option.id, name: option.name, label: (_a2 = option.label) != null ? _a2 : option.name };
4897
- }) : []
4898
- ],
4899
- onChange: (e) => handleFilterChange({ sortBy: e.target.value }),
4900
- value: queryState.sortBy
6375
+ label: sortLabel,
6376
+ id: "qf_sortBy",
6377
+ showLabel: false,
6378
+ options: [
6379
+ {
6380
+ label: "Select a sort",
6381
+ id: ""
6382
+ },
6383
+ ...sortOptions ? sortOptions.map((option) => {
6384
+ var _a2;
6385
+ return { id: option.id, name: option.name, label: (_a2 = option.label) != null ? _a2 : option.name };
6386
+ }) : []
6387
+ ],
6388
+ onChange: (e) => handleFilterChange({ sortBy: e.target.value }),
6389
+ value: queryState.sortBy
6390
+ }
6391
+ )
4901
6392
  }
4902
6393
  ),
4903
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
4904
- import_design_system32.InputSelect,
6394
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
6395
+ InputVariables,
4905
6396
  {
4906
6397
  label: sortOrderLabel,
4907
- options: [
4908
- ...sortOrderOptions ? sortOrderOptions.map((option) => {
4909
- var _a2;
4910
- return { value: option.id, label: (_a2 = option.label) != null ? _a2 : option.name, name: option.name };
4911
- }) : []
4912
- ],
4913
- onChange: (e) => handleFilterChange({ sortOrder: e.target.value }),
4914
- value: queryState.sortOrder
4915
- }
4916
- ),
4917
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
4918
- import_design_system32.Input,
4919
- {
4920
- label: countLabel,
4921
- type: "number",
4922
- onChange: (e) => handleFilterChange({ count: e.target.value }),
4923
- defaultValue: countValue,
4924
- value: queryState.count
6398
+ id: "qf_sortOrder",
6399
+ value: queryState.sortOrder,
6400
+ onChange: (newSort) => handleFilterChange({ sortOrder: newSort }),
6401
+ disableInlineMenu: true,
6402
+ inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
6403
+ import_design_system32.InputSelect,
6404
+ {
6405
+ label: sortOrderLabel,
6406
+ id: "qf_sortOrder",
6407
+ showLabel: false,
6408
+ options: [
6409
+ ...sortOrderOptions ? sortOrderOptions.map((option) => {
6410
+ var _a2;
6411
+ return { value: option.id, label: (_a2 = option.label) != null ? _a2 : option.name, name: option.name };
6412
+ }) : []
6413
+ ],
6414
+ onChange: (e) => handleFilterChange({ sortOrder: e.target.value }),
6415
+ value: queryState.sortOrder
6416
+ }
6417
+ )
4925
6418
  }
4926
6419
  )
4927
6420
  ] }),
4928
6421
  children
4929
- ] })
6422
+ ] }) })
4930
6423
  ] });
4931
6424
  };
4932
6425
 
@@ -4951,7 +6444,9 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
4951
6444
  Callout,
4952
6445
  DamSelectedItem,
4953
6446
  DataRefreshButton,
6447
+ DataResourceDynamicInputProvider,
4954
6448
  DataResourceVariablesList,
6449
+ DataResourceVariablesListExplicit,
4955
6450
  DataSourceEditor,
4956
6451
  DataTypeEditor,
4957
6452
  DefaultSearchRow,
@@ -5098,5 +6593,9 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
5098
6593
  useRequestParameter,
5099
6594
  useUniformMeshSdk,
5100
6595
  useVariables,
5101
- variablesToList
6596
+ variableExpression,
6597
+ variablePrefix,
6598
+ variableSuffix,
6599
+ variablesToList,
6600
+ ...require("@uniformdev/mesh-sdk")
5102
6601
  });