@uniformdev/mesh-sdk-react 19.3.0 → 19.5.1-alpha.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -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,35 +4169,42 @@ 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 });
@@ -4000,7 +4218,7 @@ function RequestUrlInput(props) {
4000
4218
  function useRequestHeader(headerName) {
4001
4219
  var _a, _b;
4002
4220
  const { request, dispatch } = useRequest();
4003
- const headerIndex = request.headers.findIndex((f) => f.key === headerName);
4221
+ const headerIndex = request.headers.findIndex((f2) => f2.key === headerName);
4004
4222
  return {
4005
4223
  value: (_b = (_a = request.headers[headerIndex]) == null ? void 0 : _a.value) != null ? _b : "",
4006
4224
  update: (value) => {
@@ -4017,7 +4235,7 @@ function useRequestHeader(headerName) {
4017
4235
  function useRequestParameter(paramName) {
4018
4236
  var _a, _b;
4019
4237
  const { request, dispatch } = useRequest();
4020
- const paramIndex = request.parameters.findIndex((f) => f.key === paramName);
4238
+ const paramIndex = request.parameters.findIndex((f2) => f2.key === paramName);
4021
4239
  return {
4022
4240
  value: (_b = (_a = request.parameters[paramIndex]) == null ? void 0 : _a.value) != null ? _b : "",
4023
4241
  update: (value) => {
@@ -4031,18 +4249,18 @@ function useRequestParameter(paramName) {
4031
4249
  }
4032
4250
 
4033
4251
  // src/components/DataSourceEditor.tsx
4034
- var import_jsx_runtime42 = require("@emotion/react/jsx-runtime");
4252
+ var import_jsx_runtime44 = require("@emotion/react/jsx-runtime");
4035
4253
  function DataSourceEditor({ onChange, children, editVariableComponent }) {
4036
4254
  var _a;
4037
4255
  const { value } = useMeshLocation("dataSource");
4038
4256
  const currentRequestValue = convertDataSourceToRequestData(value);
4039
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
4257
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
4040
4258
  VariablesProvider,
4041
4259
  {
4042
4260
  value: (_a = value.variables) != null ? _a : {},
4043
4261
  onChange: (newValue) => onChange((prev) => ({ newValue: { ...prev, variables: newValue } })),
4044
4262
  editVariableComponent,
4045
- children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
4263
+ children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
4046
4264
  RequestProvider,
4047
4265
  {
4048
4266
  value: currentRequestValue,
@@ -4079,7 +4297,7 @@ function convertRequestDataToDataSource(dataSource, requestData) {
4079
4297
  }
4080
4298
 
4081
4299
  // src/components/DataTypeEditor.tsx
4082
- var import_jsx_runtime43 = require("@emotion/react/jsx-runtime");
4300
+ var import_jsx_runtime45 = require("@emotion/react/jsx-runtime");
4083
4301
  function DataTypeEditor({ onChange, children, editVariableComponent }) {
4084
4302
  var _a;
4085
4303
  const {
@@ -4087,13 +4305,13 @@ function DataTypeEditor({ onChange, children, editVariableComponent }) {
4087
4305
  metadata: { dataSource }
4088
4306
  } = useMeshLocation("dataType");
4089
4307
  const currentRequestValue = convertDataTypeToRequestData(value, dataSource);
4090
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
4308
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
4091
4309
  VariablesProvider,
4092
4310
  {
4093
4311
  value: (_a = value.variables) != null ? _a : {},
4094
4312
  onChange: (newValue) => onChange((prev) => ({ newValue: { ...prev, variables: newValue } })),
4095
4313
  editVariableComponent,
4096
- children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
4314
+ children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
4097
4315
  RequestProvider,
4098
4316
  {
4099
4317
  value: currentRequestValue,
@@ -4143,12 +4361,12 @@ var import_design_system23 = require("@uniformdev/design-system");
4143
4361
 
4144
4362
  // src/hooks/useInitializeUniformMeshSdk.ts
4145
4363
  var import_mesh_sdk = require("@uniformdev/mesh-sdk");
4146
- var import_react39 = require("react");
4364
+ var import_react41 = require("react");
4147
4365
  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)(
4366
+ const [error, setError] = (0, import_react41.useState)();
4367
+ const [sdk, setSdk] = (0, import_react41.useState)();
4368
+ const initializationInProgress = (0, import_react41.useRef)(false);
4369
+ (0, import_react41.useEffect)(
4152
4370
  () => {
4153
4371
  if (typeof window === "undefined" || sdk) {
4154
4372
  return;
@@ -4181,7 +4399,7 @@ var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
4181
4399
  };
4182
4400
 
4183
4401
  // src/components/MeshApp.tsx
4184
- var import_jsx_runtime44 = require("@emotion/react/jsx-runtime");
4402
+ var import_jsx_runtime46 = require("@emotion/react/jsx-runtime");
4185
4403
  var MeshApp = ({
4186
4404
  children,
4187
4405
  loadingComponent,
@@ -4190,36 +4408,36 @@ var MeshApp = ({
4190
4408
  const { initializing, error, sdk } = useInitializeUniformMeshSdk();
4191
4409
  if (initializing || !sdk) {
4192
4410
  const LoadingComponent = loadingComponent;
4193
- return LoadingComponent ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(LoadingComponent, {}) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_design_system23.LoadingIndicator, {});
4411
+ return LoadingComponent ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(LoadingComponent, {}) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_design_system23.LoadingIndicator, {});
4194
4412
  }
4195
4413
  if (error) {
4196
4414
  const ErrorComponent = errorComponent;
4197
4415
  if (ErrorComponent) {
4198
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ErrorComponent, { error });
4416
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ErrorComponent, { error });
4199
4417
  }
4200
4418
  throw error;
4201
4419
  }
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 })
4420
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(UniformMeshSdkContext.Provider, { value: { sdk }, children: [
4421
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_design_system23.Theme, {}),
4422
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(UniformMeshLocationContextProvider, { children })
4205
4423
  ] });
4206
4424
  };
4207
4425
 
4208
4426
  // src/components/ObjectSearch/DataRefreshButton.tsx
4209
- var import_react40 = require("@emotion/react");
4427
+ var import_react42 = require("@emotion/react");
4210
4428
  var import_design_system24 = require("@uniformdev/design-system");
4211
- var import_jsx_runtime45 = require("@emotion/react/jsx-runtime");
4429
+ var import_jsx_runtime47 = require("@emotion/react/jsx-runtime");
4212
4430
  var DataRefreshButton = ({
4213
4431
  buttonText,
4214
4432
  isLoading,
4215
4433
  onRefreshData,
4216
4434
  ...props
4217
4435
  }) => {
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)(
4436
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_design_system24.Button, { buttonType: "primaryInvert", onClick: onRefreshData, disabled: isLoading, ...props, children: [
4437
+ !isLoading ? null : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
4220
4438
  import_design_system24.LoadingIndicator,
4221
4439
  {
4222
- css: import_react40.css`
4440
+ css: import_react42.css`
4223
4441
  ${isLoading ? "opacity: 0.2;" : void 0}
4224
4442
  `
4225
4443
  }
@@ -4228,39 +4446,1172 @@ var DataRefreshButton = ({
4228
4446
  ] });
4229
4447
  };
4230
4448
 
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
- ] }) });
4449
+ // ../context/dist/api/api.mjs
4450
+ var __defProp2 = Object.defineProperty;
4451
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4452
+ var __publicField = (obj, key, value) => {
4453
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4454
+ return value;
4455
+ };
4456
+ var __accessCheck = (obj, member, msg) => {
4457
+ if (!member.has(obj))
4458
+ throw TypeError("Cannot " + msg);
4459
+ };
4460
+ var __privateGet = (obj, member, getter) => {
4461
+ __accessCheck(obj, member, "read from private field");
4462
+ return getter ? getter.call(obj) : member.get(obj);
4463
+ };
4464
+ var __privateAdd = (obj, member, value) => {
4465
+ if (member.has(obj))
4466
+ throw TypeError("Cannot add the same private member more than once");
4467
+ member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
4468
+ };
4469
+ var nullLimitPolicy = async (func) => await func();
4470
+ var ApiClientError = class extends Error {
4471
+ constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
4472
+ super(
4473
+ `${errorMessage}
4474
+ ${statusCode}${statusText ? " " + statusText : ""} (${fetchMethod} ${fetchUri}${requestId ? ` Request ID: ${requestId}` : ""})`
4475
+ );
4476
+ this.errorMessage = errorMessage;
4477
+ this.fetchMethod = fetchMethod;
4478
+ this.fetchUri = fetchUri;
4479
+ this.statusCode = statusCode;
4480
+ this.statusText = statusText;
4481
+ this.requestId = requestId;
4482
+ Object.setPrototypeOf(this, ApiClientError.prototype);
4483
+ }
4484
+ };
4485
+ var ApiClient = class {
4486
+ constructor(options) {
4487
+ __publicField(this, "options");
4488
+ var _a, _b, _c, _d, _e;
4489
+ if (!options.apiKey && !options.bearerToken) {
4490
+ throw new Error("You must provide an API key or a bearer token");
4491
+ }
4492
+ let leFetch = options.fetch;
4493
+ if (!leFetch) {
4494
+ if (typeof window !== "undefined") {
4495
+ leFetch = window.fetch.bind(window);
4496
+ } else if (typeof fetch !== "undefined") {
4497
+ leFetch = fetch;
4498
+ } else {
4499
+ throw new Error("You must provide or polyfill a fetch implementation when not in a browser");
4500
+ }
4501
+ }
4502
+ this.options = {
4503
+ ...options,
4504
+ fetch: leFetch,
4505
+ apiHost: this.ensureApiHost(options.apiHost),
4506
+ apiKey: (_a = options.apiKey) != null ? _a : null,
4507
+ projectId: (_b = options.projectId) != null ? _b : null,
4508
+ bearerToken: (_c = options.bearerToken) != null ? _c : null,
4509
+ limitPolicy: (_d = options.limitPolicy) != null ? _d : nullLimitPolicy,
4510
+ bypassCache: (_e = options.bypassCache) != null ? _e : false
4511
+ };
4512
+ }
4513
+ async apiClient(fetchUri, options) {
4514
+ return this.options.limitPolicy(async () => {
4515
+ var _a;
4516
+ const coreHeaders = this.options.apiKey ? {
4517
+ "x-api-key": this.options.apiKey
4518
+ } : {
4519
+ Authorization: `Bearer ${this.options.bearerToken}`
4520
+ };
4521
+ if (this.options.bypassCache) {
4522
+ coreHeaders["x-bypass-cache"] = "true";
4523
+ }
4524
+ const callApi = () => this.options.fetch(fetchUri.toString(), {
4525
+ ...options,
4526
+ headers: {
4527
+ ...options == null ? void 0 : options.headers,
4528
+ ...coreHeaders
4529
+ }
4530
+ });
4531
+ const apiResponse = await handleRateLimits(callApi);
4532
+ if (!apiResponse.ok) {
4533
+ let message = "";
4534
+ try {
4535
+ const responseText = await apiResponse.text();
4536
+ try {
4537
+ const parsed = JSON.parse(responseText);
4538
+ if (parsed.errorMessage) {
4539
+ message = Array.isArray(parsed.errorMessage) ? parsed.errorMessage.join(", ") : parsed.errorMessage;
4540
+ } else {
4541
+ message = responseText;
4542
+ }
4543
+ } catch (e) {
4544
+ message = responseText;
4545
+ }
4546
+ } catch (e) {
4547
+ message = `General error`;
4548
+ }
4549
+ throw new ApiClientError(
4550
+ message,
4551
+ (_a = options == null ? void 0 : options.method) != null ? _a : "GET",
4552
+ fetchUri.toString(),
4553
+ apiResponse.status,
4554
+ apiResponse.statusText,
4555
+ ApiClient.getRequestId(apiResponse)
4556
+ );
4557
+ }
4558
+ if (options == null ? void 0 : options.expectNoContent) {
4559
+ return null;
4560
+ }
4561
+ return await apiResponse.json();
4562
+ });
4563
+ }
4564
+ createUrl(path, queryParams, hostOverride) {
4565
+ const url = new URL(`${hostOverride != null ? hostOverride : this.options.apiHost}${path}`);
4566
+ Object.entries(queryParams != null ? queryParams : {}).forEach(([key, value]) => {
4567
+ var _a;
4568
+ if (typeof value !== "undefined" && value !== null) {
4569
+ url.searchParams.append(key, Array.isArray(value) ? value.join(",") : (_a = value == null ? void 0 : value.toString()) != null ? _a : "");
4570
+ }
4571
+ });
4572
+ return url;
4573
+ }
4574
+ ensureApiHost(apiHost) {
4575
+ if (!apiHost)
4576
+ return "https://uniform.app";
4577
+ if (!(apiHost == null ? void 0 : apiHost.startsWith("http"))) {
4578
+ throw new Error('Your apiHost must start with "http"');
4579
+ }
4580
+ if (apiHost.indexOf("/", 8) > -1) {
4581
+ throw new Error("Your apiHost must not contain a path element after the domain");
4582
+ }
4583
+ if (apiHost.indexOf("?") > -1) {
4584
+ throw new Error("Your apiHost must not contain a query string");
4585
+ }
4586
+ if (apiHost == null ? void 0 : apiHost.endsWith("/")) {
4587
+ apiHost = apiHost.substring(0, apiHost.length - 1);
4588
+ }
4589
+ return apiHost;
4590
+ }
4591
+ static getRequestId(response) {
4592
+ const apigRequestId = response.headers.get("apigw-requestid");
4593
+ if (apigRequestId) {
4594
+ return apigRequestId;
4595
+ }
4596
+ return void 0;
4597
+ }
4598
+ };
4599
+ async function handleRateLimits(callApi) {
4600
+ var _a;
4601
+ const backoffRetries = 5;
4602
+ let backoffRetriesLeft = backoffRetries;
4603
+ let response;
4604
+ while (backoffRetriesLeft > 0) {
4605
+ response = await callApi();
4606
+ if (response.status !== 429) {
4607
+ break;
4608
+ }
4609
+ let resetWait = 0;
4610
+ try {
4611
+ const dateHeader = response.headers.get("date");
4612
+ const serverTime = dateHeader ? new Date(dateHeader).getTime() : void 0;
4613
+ const body = await response.json();
4614
+ const resetTime = (_a = body == null ? void 0 : body.info) == null ? void 0 : _a.reset;
4615
+ if (typeof serverTime === "number" && typeof resetTime === "number") {
4616
+ resetWait = Math.max(0, Math.min(Math.round(1.1 * (resetTime - serverTime)), 1e4));
4617
+ }
4618
+ } catch (err) {
4619
+ }
4620
+ const base = Math.pow(2, backoffRetries - backoffRetriesLeft) * 333;
4621
+ const backoffWait = base + Math.round(Math.random() * (base / 2)) * (Math.random() > 0.5 ? 1 : -1);
4622
+ await new Promise((resolve) => setTimeout(resolve, resetWait + backoffWait));
4623
+ backoffRetriesLeft -= 1;
4624
+ }
4625
+ return response;
4626
+ }
4627
+ var _url;
4628
+ var _AggregateClient = class extends ApiClient {
4629
+ constructor(options) {
4630
+ super(options);
4631
+ }
4632
+ /** Fetches all aggregates for a project */
4633
+ async get(options) {
4634
+ const { projectId } = this.options;
4635
+ const fetchUri = this.createUrl(__privateGet(_AggregateClient, _url), { ...options, projectId });
4636
+ return await this.apiClient(fetchUri);
4637
+ }
4638
+ /** Updates or creates (based on id) an Aggregate */
4639
+ async upsert(body) {
4640
+ const fetchUri = this.createUrl(__privateGet(_AggregateClient, _url));
4641
+ await this.apiClient(fetchUri, {
4642
+ method: "PUT",
4643
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
4644
+ expectNoContent: true
4645
+ });
4646
+ }
4647
+ /** Deletes an Aggregate */
4648
+ async remove(body) {
4649
+ const fetchUri = this.createUrl(__privateGet(_AggregateClient, _url));
4650
+ await this.apiClient(fetchUri, {
4651
+ method: "DELETE",
4652
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
4653
+ expectNoContent: true
4654
+ });
4655
+ }
4656
+ };
4657
+ var AggregateClient = _AggregateClient;
4658
+ _url = /* @__PURE__ */ new WeakMap();
4659
+ __privateAdd(AggregateClient, _url, "/api/v2/aggregate");
4660
+ var _url2;
4661
+ var _DimensionClient = class extends ApiClient {
4662
+ constructor(options) {
4663
+ super(options);
4664
+ }
4665
+ /** Fetches the known score dimensions for a project */
4666
+ async get(options) {
4667
+ const { projectId } = this.options;
4668
+ const fetchUri = this.createUrl(__privateGet(_DimensionClient, _url2), { ...options, projectId });
4669
+ return await this.apiClient(fetchUri);
4670
+ }
4671
+ };
4672
+ var DimensionClient = _DimensionClient;
4673
+ _url2 = /* @__PURE__ */ new WeakMap();
4674
+ __privateAdd(DimensionClient, _url2, "/api/v2/dimension");
4675
+ var _url3;
4676
+ var _valueUrl;
4677
+ var _EnrichmentClient = class extends ApiClient {
4678
+ constructor(options) {
4679
+ super(options);
4680
+ }
4681
+ /** Fetches all enrichments and values for a project, grouped by category */
4682
+ async get(options) {
4683
+ const { projectId } = this.options;
4684
+ const fetchUri = this.createUrl(__privateGet(_EnrichmentClient, _url3), { ...options, projectId });
4685
+ return await this.apiClient(fetchUri);
4686
+ }
4687
+ /** Updates or creates (based on id) an enrichment category */
4688
+ async upsertCategory(body) {
4689
+ const fetchUri = this.createUrl(__privateGet(_EnrichmentClient, _url3));
4690
+ await this.apiClient(fetchUri, {
4691
+ method: "PUT",
4692
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
4693
+ expectNoContent: true
4694
+ });
4695
+ }
4696
+ /** Deletes an enrichment category */
4697
+ async removeCategory(body) {
4698
+ const fetchUri = this.createUrl(__privateGet(_EnrichmentClient, _url3));
4699
+ await this.apiClient(fetchUri, {
4700
+ method: "DELETE",
4701
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
4702
+ expectNoContent: true
4703
+ });
4704
+ }
4705
+ /** Updates or creates (based on id) an enrichment value within an enrichment category */
4706
+ async upsertValue(body) {
4707
+ const fetchUri = this.createUrl(__privateGet(_EnrichmentClient, _valueUrl));
4708
+ await this.apiClient(fetchUri, {
4709
+ method: "PUT",
4710
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
4711
+ expectNoContent: true
4712
+ });
4713
+ }
4714
+ /** Deletes an enrichment value within an enrichment category. The category is left alone. */
4715
+ async removeValue(body) {
4716
+ const fetchUri = this.createUrl(__privateGet(_EnrichmentClient, _valueUrl));
4717
+ await this.apiClient(fetchUri, {
4718
+ method: "DELETE",
4719
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
4720
+ expectNoContent: true
4721
+ });
4722
+ }
4723
+ };
4724
+ var EnrichmentClient = _EnrichmentClient;
4725
+ _url3 = /* @__PURE__ */ new WeakMap();
4726
+ _valueUrl = /* @__PURE__ */ new WeakMap();
4727
+ __privateAdd(EnrichmentClient, _url3, "/api/v1/enrichments");
4728
+ __privateAdd(EnrichmentClient, _valueUrl, "/api/v1/enrichment-values");
4729
+ var _url4;
4730
+ var _ManifestClient = class extends ApiClient {
4731
+ constructor(options) {
4732
+ super(options);
4733
+ }
4734
+ /** Fetches the Context manifest for a project */
4735
+ async get(options) {
4736
+ const { projectId } = this.options;
4737
+ const fetchUri = this.createUrl(__privateGet(_ManifestClient, _url4), { ...options, projectId });
4738
+ return await this.apiClient(fetchUri);
4739
+ }
4740
+ /** Publishes the Context manifest for a project */
4741
+ async publish() {
4742
+ const { projectId } = this.options;
4743
+ const fetchUri = this.createUrl("/api/v1/publish", { siteId: projectId });
4744
+ await this.apiClient(fetchUri, {
4745
+ method: "POST",
4746
+ expectNoContent: true
4747
+ });
4748
+ }
4246
4749
  };
4750
+ var ManifestClient = _ManifestClient;
4751
+ _url4 = /* @__PURE__ */ new WeakMap();
4752
+ __privateAdd(ManifestClient, _url4, "/api/v2/manifest");
4753
+ var _url5;
4754
+ var _QuirkClient = class extends ApiClient {
4755
+ constructor(options) {
4756
+ super(options);
4757
+ }
4758
+ /** Fetches all Quirks for a project */
4759
+ async get(options) {
4760
+ const { projectId } = this.options;
4761
+ const fetchUri = this.createUrl(__privateGet(_QuirkClient, _url5), { ...options, projectId });
4762
+ return await this.apiClient(fetchUri);
4763
+ }
4764
+ /** Updates or creates (based on id) a Quirk */
4765
+ async upsert(body) {
4766
+ const fetchUri = this.createUrl(__privateGet(_QuirkClient, _url5));
4767
+ await this.apiClient(fetchUri, {
4768
+ method: "PUT",
4769
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
4770
+ expectNoContent: true
4771
+ });
4772
+ }
4773
+ /** Deletes a Quirk */
4774
+ async remove(body) {
4775
+ const fetchUri = this.createUrl(__privateGet(_QuirkClient, _url5));
4776
+ await this.apiClient(fetchUri, {
4777
+ method: "DELETE",
4778
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
4779
+ expectNoContent: true
4780
+ });
4781
+ }
4782
+ };
4783
+ var QuirkClient = _QuirkClient;
4784
+ _url5 = /* @__PURE__ */ new WeakMap();
4785
+ __privateAdd(QuirkClient, _url5, "/api/v2/quirk");
4786
+ var _url6;
4787
+ var _SignalClient = class extends ApiClient {
4788
+ constructor(options) {
4789
+ super(options);
4790
+ }
4791
+ /** Fetches all Signals for a project */
4792
+ async get(options) {
4793
+ const { projectId } = this.options;
4794
+ const fetchUri = this.createUrl(__privateGet(_SignalClient, _url6), { ...options, projectId });
4795
+ return await this.apiClient(fetchUri);
4796
+ }
4797
+ /** Updates or creates (based on id) a Signal */
4798
+ async upsert(body) {
4799
+ const fetchUri = this.createUrl(__privateGet(_SignalClient, _url6));
4800
+ await this.apiClient(fetchUri, {
4801
+ method: "PUT",
4802
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
4803
+ expectNoContent: true
4804
+ });
4805
+ }
4806
+ /** Deletes a Signal */
4807
+ async remove(body) {
4808
+ const fetchUri = this.createUrl(__privateGet(_SignalClient, _url6));
4809
+ await this.apiClient(fetchUri, {
4810
+ method: "DELETE",
4811
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
4812
+ expectNoContent: true
4813
+ });
4814
+ }
4815
+ };
4816
+ var SignalClient = _SignalClient;
4817
+ _url6 = /* @__PURE__ */ new WeakMap();
4818
+ __privateAdd(SignalClient, _url6, "/api/v2/signal");
4819
+ var _url7;
4820
+ var _TestClient = class extends ApiClient {
4821
+ constructor(options) {
4822
+ super(options);
4823
+ }
4824
+ /** Fetches all Tests for a project */
4825
+ async get(options) {
4826
+ const { projectId } = this.options;
4827
+ const fetchUri = this.createUrl(__privateGet(_TestClient, _url7), { ...options, projectId });
4828
+ return await this.apiClient(fetchUri);
4829
+ }
4830
+ /** Updates or creates (based on id) a Test */
4831
+ async upsert(body) {
4832
+ const fetchUri = this.createUrl(__privateGet(_TestClient, _url7));
4833
+ await this.apiClient(fetchUri, {
4834
+ method: "PUT",
4835
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
4836
+ expectNoContent: true
4837
+ });
4838
+ }
4839
+ /** Deletes a Test */
4840
+ async remove(body) {
4841
+ const fetchUri = this.createUrl(__privateGet(_TestClient, _url7));
4842
+ await this.apiClient(fetchUri, {
4843
+ method: "DELETE",
4844
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
4845
+ expectNoContent: true
4846
+ });
4847
+ }
4848
+ };
4849
+ var TestClient = _TestClient;
4850
+ _url7 = /* @__PURE__ */ new WeakMap();
4851
+ __privateAdd(TestClient, _url7, "/api/v2/test");
4852
+
4853
+ // ../../node_modules/.pnpm/immer@9.0.21/node_modules/immer/dist/immer.esm.mjs
4854
+ function n(n2) {
4855
+ for (var r2 = arguments.length, t2 = Array(r2 > 1 ? r2 - 1 : 0), e = 1; e < r2; e++)
4856
+ t2[e - 1] = arguments[e];
4857
+ if ("production" !== process.env.NODE_ENV) {
4858
+ var i2 = Y[n2], o2 = i2 ? "function" == typeof i2 ? i2.apply(null, t2) : i2 : "unknown error nr: " + n2;
4859
+ throw Error("[Immer] " + o2);
4860
+ }
4861
+ throw Error("[Immer] minified error nr: " + n2 + (t2.length ? " " + t2.map(function(n3) {
4862
+ return "'" + n3 + "'";
4863
+ }).join(",") : "") + ". Find the full error at: https://bit.ly/3cXEKWf");
4864
+ }
4865
+ function r(n2) {
4866
+ return !!n2 && !!n2[Q];
4867
+ }
4868
+ function t(n2) {
4869
+ var r2;
4870
+ return !!n2 && (function(n3) {
4871
+ if (!n3 || "object" != typeof n3)
4872
+ return false;
4873
+ var r3 = Object.getPrototypeOf(n3);
4874
+ if (null === r3)
4875
+ return true;
4876
+ var t2 = Object.hasOwnProperty.call(r3, "constructor") && r3.constructor;
4877
+ return t2 === Object || "function" == typeof t2 && Function.toString.call(t2) === Z;
4878
+ }(n2) || Array.isArray(n2) || !!n2[L] || !!(null === (r2 = n2.constructor) || void 0 === r2 ? void 0 : r2[L]) || s(n2) || v(n2));
4879
+ }
4880
+ function i(n2, r2, t2) {
4881
+ void 0 === t2 && (t2 = false), 0 === o(n2) ? (t2 ? Object.keys : nn)(n2).forEach(function(e) {
4882
+ t2 && "symbol" == typeof e || r2(e, n2[e], n2);
4883
+ }) : n2.forEach(function(t3, e) {
4884
+ return r2(e, t3, n2);
4885
+ });
4886
+ }
4887
+ function o(n2) {
4888
+ var r2 = n2[Q];
4889
+ return r2 ? r2.i > 3 ? r2.i - 4 : r2.i : Array.isArray(n2) ? 1 : s(n2) ? 2 : v(n2) ? 3 : 0;
4890
+ }
4891
+ function u(n2, r2) {
4892
+ return 2 === o(n2) ? n2.has(r2) : Object.prototype.hasOwnProperty.call(n2, r2);
4893
+ }
4894
+ function a(n2, r2) {
4895
+ return 2 === o(n2) ? n2.get(r2) : n2[r2];
4896
+ }
4897
+ function f(n2, r2, t2) {
4898
+ var e = o(n2);
4899
+ 2 === e ? n2.set(r2, t2) : 3 === e ? n2.add(t2) : n2[r2] = t2;
4900
+ }
4901
+ function c(n2, r2) {
4902
+ return n2 === r2 ? 0 !== n2 || 1 / n2 == 1 / r2 : n2 != n2 && r2 != r2;
4903
+ }
4904
+ function s(n2) {
4905
+ return X && n2 instanceof Map;
4906
+ }
4907
+ function v(n2) {
4908
+ return q && n2 instanceof Set;
4909
+ }
4910
+ function p(n2) {
4911
+ return n2.o || n2.t;
4912
+ }
4913
+ function l(n2) {
4914
+ if (Array.isArray(n2))
4915
+ return Array.prototype.slice.call(n2);
4916
+ var r2 = rn(n2);
4917
+ delete r2[Q];
4918
+ for (var t2 = nn(r2), e = 0; e < t2.length; e++) {
4919
+ var i2 = t2[e], o2 = r2[i2];
4920
+ 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] });
4921
+ }
4922
+ return Object.create(Object.getPrototypeOf(n2), r2);
4923
+ }
4924
+ function d(n2, e) {
4925
+ 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) {
4926
+ return d(r2, true);
4927
+ }, true)), n2;
4928
+ }
4929
+ function h() {
4930
+ n(2);
4931
+ }
4932
+ function y(n2) {
4933
+ return null == n2 || "object" != typeof n2 || Object.isFrozen(n2);
4934
+ }
4935
+ function b(r2) {
4936
+ var t2 = tn[r2];
4937
+ return t2 || n(18, r2), t2;
4938
+ }
4939
+ function _() {
4940
+ return "production" === process.env.NODE_ENV || U || n(0), U;
4941
+ }
4942
+ function j(n2, r2) {
4943
+ r2 && (b("Patches"), n2.u = [], n2.s = [], n2.v = r2);
4944
+ }
4945
+ function g(n2) {
4946
+ O(n2), n2.p.forEach(S), n2.p = null;
4947
+ }
4948
+ function O(n2) {
4949
+ n2 === U && (U = n2.l);
4950
+ }
4951
+ function w(n2) {
4952
+ return U = { p: [], l: U, h: n2, m: true, _: 0 };
4953
+ }
4954
+ function S(n2) {
4955
+ var r2 = n2[Q];
4956
+ 0 === r2.i || 1 === r2.i ? r2.j() : r2.g = true;
4957
+ }
4958
+ function P(r2, e) {
4959
+ e._ = e.p.length;
4960
+ var i2 = e.p[0], o2 = void 0 !== r2 && r2 !== i2;
4961
+ 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;
4962
+ }
4963
+ function M(n2, r2, t2) {
4964
+ if (y(r2))
4965
+ return r2;
4966
+ var e = r2[Q];
4967
+ if (!e)
4968
+ return i(r2, function(i2, o3) {
4969
+ return A(n2, e, r2, i2, o3, t2);
4970
+ }, true), r2;
4971
+ if (e.A !== n2)
4972
+ return r2;
4973
+ if (!e.P)
4974
+ return x(n2, e.t, true), e.t;
4975
+ if (!e.I) {
4976
+ e.I = true, e.A._--;
4977
+ var o2 = 4 === e.i || 5 === e.i ? e.o = l(e.k) : e.o, u2 = o2, a2 = false;
4978
+ 3 === e.i && (u2 = new Set(o2), o2.clear(), a2 = true), i(u2, function(r3, i2) {
4979
+ return A(n2, e, o2, r3, i2, t2, a2);
4980
+ }), x(n2, o2, false), t2 && n2.u && b("Patches").N(e, t2, n2.u, n2.s);
4981
+ }
4982
+ return e.o;
4983
+ }
4984
+ function A(e, i2, o2, a2, c2, s2, v2) {
4985
+ if ("production" !== process.env.NODE_ENV && c2 === o2 && n(5), r(c2)) {
4986
+ var p2 = M(e, c2, s2 && i2 && 3 !== i2.i && !u(i2.R, a2) ? s2.concat(a2) : void 0);
4987
+ if (f(o2, a2, p2), !r(p2))
4988
+ return;
4989
+ e.m = false;
4990
+ } else
4991
+ v2 && o2.add(c2);
4992
+ if (t(c2) && !y(c2)) {
4993
+ if (!e.h.D && e._ < 1)
4994
+ return;
4995
+ M(e, c2), i2 && i2.A.l || x(e, c2);
4996
+ }
4997
+ }
4998
+ function x(n2, r2, t2) {
4999
+ void 0 === t2 && (t2 = false), !n2.l && n2.h.D && n2.m && d(r2, t2);
5000
+ }
5001
+ function z2(n2, r2) {
5002
+ var t2 = n2[Q];
5003
+ return (t2 ? p(t2) : n2)[r2];
5004
+ }
5005
+ function I(n2, r2) {
5006
+ if (r2 in n2)
5007
+ for (var t2 = Object.getPrototypeOf(n2); t2; ) {
5008
+ var e = Object.getOwnPropertyDescriptor(t2, r2);
5009
+ if (e)
5010
+ return e;
5011
+ t2 = Object.getPrototypeOf(t2);
5012
+ }
5013
+ }
5014
+ function k(n2) {
5015
+ n2.P || (n2.P = true, n2.l && k(n2.l));
5016
+ }
5017
+ function E(n2) {
5018
+ n2.o || (n2.o = l(n2.t));
5019
+ }
5020
+ function N(n2, r2, t2) {
5021
+ var e = s(r2) ? b("MapSet").F(r2, t2) : v(r2) ? b("MapSet").T(r2, t2) : n2.O ? function(n3, r3) {
5022
+ 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;
5023
+ t3 && (i2 = [e2], o2 = on);
5024
+ var u2 = Proxy.revocable(i2, o2), a2 = u2.revoke, f2 = u2.proxy;
5025
+ return e2.k = f2, e2.j = a2, f2;
5026
+ }(r2, t2) : b("ES5").J(r2, t2);
5027
+ return (t2 ? t2.A : _()).p.push(e), e;
5028
+ }
5029
+ function R(e) {
5030
+ return r(e) || n(22, e), function n2(r2) {
5031
+ if (!t(r2))
5032
+ return r2;
5033
+ var e2, u2 = r2[Q], c2 = o(r2);
5034
+ if (u2) {
5035
+ if (!u2.P && (u2.i < 4 || !b("ES5").K(u2)))
5036
+ return u2.t;
5037
+ u2.I = true, e2 = D(r2, c2), u2.I = false;
5038
+ } else
5039
+ e2 = D(r2, c2);
5040
+ return i(e2, function(r3, t2) {
5041
+ u2 && a(u2.t, r3) === t2 || f(e2, r3, n2(t2));
5042
+ }), 3 === c2 ? new Set(e2) : e2;
5043
+ }(e);
5044
+ }
5045
+ function D(n2, r2) {
5046
+ switch (r2) {
5047
+ case 2:
5048
+ return new Map(n2);
5049
+ case 3:
5050
+ return Array.from(n2);
5051
+ }
5052
+ return l(n2);
5053
+ }
5054
+ var G;
5055
+ var U;
5056
+ var W = "undefined" != typeof Symbol && "symbol" == typeof Symbol("x");
5057
+ var X = "undefined" != typeof Map;
5058
+ var q = "undefined" != typeof Set;
5059
+ var B = "undefined" != typeof Proxy && void 0 !== Proxy.revocable && "undefined" != typeof Reflect;
5060
+ var H = W ? Symbol.for("immer-nothing") : ((G = {})["immer-nothing"] = true, G);
5061
+ var L = W ? Symbol.for("immer-draftable") : "__$immer_draftable";
5062
+ var Q = W ? Symbol.for("immer-state") : "__$immer_state";
5063
+ 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) {
5064
+ return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? " + n2;
5065
+ }, 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) {
5066
+ return "Cannot apply patch, path doesn't resolve: " + n2;
5067
+ }, 16: 'Sets cannot have "replace" patches.', 17: function(n2) {
5068
+ return "Unsupported patch operation: " + n2;
5069
+ }, 18: function(n2) {
5070
+ return "The plugin for '" + n2 + "' has not been loaded into Immer. To enable the plugin, import and call `enable" + n2 + "()` when initializing your application.";
5071
+ }, 20: "Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available", 21: function(n2) {
5072
+ 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 + "'";
5073
+ }, 22: function(n2) {
5074
+ return "'current' expects a draft, got: " + n2;
5075
+ }, 23: function(n2) {
5076
+ return "'original' expects a draft, got: " + n2;
5077
+ }, 24: "Patching reserved attributes like __proto__, prototype and constructor is not allowed" };
5078
+ var Z = "" + Object.prototype.constructor;
5079
+ var nn = "undefined" != typeof Reflect && Reflect.ownKeys ? Reflect.ownKeys : void 0 !== Object.getOwnPropertySymbols ? function(n2) {
5080
+ return Object.getOwnPropertyNames(n2).concat(Object.getOwnPropertySymbols(n2));
5081
+ } : Object.getOwnPropertyNames;
5082
+ var rn = Object.getOwnPropertyDescriptors || function(n2) {
5083
+ var r2 = {};
5084
+ return nn(n2).forEach(function(t2) {
5085
+ r2[t2] = Object.getOwnPropertyDescriptor(n2, t2);
5086
+ }), r2;
5087
+ };
5088
+ var tn = {};
5089
+ var en = { get: function(n2, r2) {
5090
+ if (r2 === Q)
5091
+ return n2;
5092
+ var e = p(n2);
5093
+ if (!u(e, r2))
5094
+ return function(n3, r3, t2) {
5095
+ var e2, i3 = I(r3, t2);
5096
+ return i3 ? "value" in i3 ? i3.value : null === (e2 = i3.get) || void 0 === e2 ? void 0 : e2.call(n3.k) : void 0;
5097
+ }(n2, e, r2);
5098
+ var i2 = e[r2];
5099
+ return n2.I || !t(i2) ? i2 : i2 === z2(n2.t, r2) ? (E(n2), n2.o[r2] = N(n2.A.h, i2, n2)) : i2;
5100
+ }, has: function(n2, r2) {
5101
+ return r2 in p(n2);
5102
+ }, ownKeys: function(n2) {
5103
+ return Reflect.ownKeys(p(n2));
5104
+ }, set: function(n2, r2, t2) {
5105
+ var e = I(p(n2), r2);
5106
+ if (null == e ? void 0 : e.set)
5107
+ return e.set.call(n2.k, t2), true;
5108
+ if (!n2.P) {
5109
+ var i2 = z2(p(n2), r2), o2 = null == i2 ? void 0 : i2[Q];
5110
+ if (o2 && o2.t === t2)
5111
+ return n2.o[r2] = t2, n2.R[r2] = false, true;
5112
+ if (c(t2, i2) && (void 0 !== t2 || u(n2.t, r2)))
5113
+ return true;
5114
+ E(n2), k(n2);
5115
+ }
5116
+ 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;
5117
+ }, deleteProperty: function(n2, r2) {
5118
+ 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;
5119
+ }, getOwnPropertyDescriptor: function(n2, r2) {
5120
+ var t2 = p(n2), e = Reflect.getOwnPropertyDescriptor(t2, r2);
5121
+ return e ? { writable: true, configurable: 1 !== n2.i || "length" !== r2, enumerable: e.enumerable, value: t2[r2] } : e;
5122
+ }, defineProperty: function() {
5123
+ n(11);
5124
+ }, getPrototypeOf: function(n2) {
5125
+ return Object.getPrototypeOf(n2.t);
5126
+ }, setPrototypeOf: function() {
5127
+ n(12);
5128
+ } };
5129
+ var on = {};
5130
+ i(en, function(n2, r2) {
5131
+ on[n2] = function() {
5132
+ return arguments[0] = arguments[0][0], r2.apply(this, arguments);
5133
+ };
5134
+ }), on.deleteProperty = function(r2, t2) {
5135
+ return "production" !== process.env.NODE_ENV && isNaN(parseInt(t2)) && n(13), on.set.call(this, r2, t2, void 0);
5136
+ }, on.set = function(r2, t2, e) {
5137
+ return "production" !== process.env.NODE_ENV && "length" !== t2 && isNaN(parseInt(t2)) && n(14), en.set.call(this, r2[0], t2, e, r2[0]);
5138
+ };
5139
+ var un = function() {
5140
+ function e(r2) {
5141
+ var e2 = this;
5142
+ this.O = B, this.D = true, this.produce = function(r3, i3, o2) {
5143
+ if ("function" == typeof r3 && "function" != typeof i3) {
5144
+ var u2 = i3;
5145
+ i3 = r3;
5146
+ var a2 = e2;
5147
+ return function(n2) {
5148
+ var r4 = this;
5149
+ void 0 === n2 && (n2 = u2);
5150
+ for (var t2 = arguments.length, e3 = Array(t2 > 1 ? t2 - 1 : 0), o3 = 1; o3 < t2; o3++)
5151
+ e3[o3 - 1] = arguments[o3];
5152
+ return a2.produce(n2, function(n3) {
5153
+ var t3;
5154
+ return (t3 = i3).call.apply(t3, [r4, n3].concat(e3));
5155
+ });
5156
+ };
5157
+ }
5158
+ var f2;
5159
+ if ("function" != typeof i3 && n(6), void 0 !== o2 && "function" != typeof o2 && n(7), t(r3)) {
5160
+ var c2 = w(e2), s2 = N(e2, r3, void 0), v2 = true;
5161
+ try {
5162
+ f2 = i3(s2), v2 = false;
5163
+ } finally {
5164
+ v2 ? g(c2) : O(c2);
5165
+ }
5166
+ return "undefined" != typeof Promise && f2 instanceof Promise ? f2.then(function(n2) {
5167
+ return j(c2, o2), P(n2, c2);
5168
+ }, function(n2) {
5169
+ throw g(c2), n2;
5170
+ }) : (j(c2, o2), P(f2, c2));
5171
+ }
5172
+ if (!r3 || "object" != typeof r3) {
5173
+ if (void 0 === (f2 = i3(r3)) && (f2 = r3), f2 === H && (f2 = void 0), e2.D && d(f2, true), o2) {
5174
+ var p2 = [], l2 = [];
5175
+ b("Patches").M(r3, f2, p2, l2), o2(p2, l2);
5176
+ }
5177
+ return f2;
5178
+ }
5179
+ n(21, r3);
5180
+ }, this.produceWithPatches = function(n2, r3) {
5181
+ if ("function" == typeof n2)
5182
+ return function(r4) {
5183
+ for (var t3 = arguments.length, i4 = Array(t3 > 1 ? t3 - 1 : 0), o3 = 1; o3 < t3; o3++)
5184
+ i4[o3 - 1] = arguments[o3];
5185
+ return e2.produceWithPatches(r4, function(r5) {
5186
+ return n2.apply(void 0, [r5].concat(i4));
5187
+ });
5188
+ };
5189
+ var t2, i3, o2 = e2.produce(n2, r3, function(n3, r4) {
5190
+ t2 = n3, i3 = r4;
5191
+ });
5192
+ return "undefined" != typeof Promise && o2 instanceof Promise ? o2.then(function(n3) {
5193
+ return [n3, t2, i3];
5194
+ }) : [o2, t2, i3];
5195
+ }, "boolean" == typeof (null == r2 ? void 0 : r2.useProxies) && this.setUseProxies(r2.useProxies), "boolean" == typeof (null == r2 ? void 0 : r2.autoFreeze) && this.setAutoFreeze(r2.autoFreeze);
5196
+ }
5197
+ var i2 = e.prototype;
5198
+ return i2.createDraft = function(e2) {
5199
+ t(e2) || n(8), r(e2) && (e2 = R(e2));
5200
+ var i3 = w(this), o2 = N(this, e2, void 0);
5201
+ return o2[Q].C = true, O(i3), o2;
5202
+ }, i2.finishDraft = function(r2, t2) {
5203
+ var e2 = r2 && r2[Q];
5204
+ "production" !== process.env.NODE_ENV && (e2 && e2.C || n(9), e2.I && n(10));
5205
+ var i3 = e2.A;
5206
+ return j(i3, t2), P(void 0, i3);
5207
+ }, i2.setAutoFreeze = function(n2) {
5208
+ this.D = n2;
5209
+ }, i2.setUseProxies = function(r2) {
5210
+ r2 && !B && n(20), this.O = r2;
5211
+ }, i2.applyPatches = function(n2, t2) {
5212
+ var e2;
5213
+ for (e2 = t2.length - 1; e2 >= 0; e2--) {
5214
+ var i3 = t2[e2];
5215
+ if (0 === i3.path.length && "replace" === i3.op) {
5216
+ n2 = i3.value;
5217
+ break;
5218
+ }
5219
+ }
5220
+ e2 > -1 && (t2 = t2.slice(e2 + 1));
5221
+ var o2 = b("Patches").$;
5222
+ return r(n2) ? o2(n2, t2) : this.produce(n2, function(n3) {
5223
+ return o2(n3, t2);
5224
+ });
5225
+ }, e;
5226
+ }();
5227
+ var an = new un();
5228
+ var fn = an.produce;
5229
+ var cn = an.produceWithPatches.bind(an);
5230
+ var sn = an.setAutoFreeze.bind(an);
5231
+ var vn = an.setUseProxies.bind(an);
5232
+ var pn = an.applyPatches.bind(an);
5233
+ var ln = an.createDraft.bind(an);
5234
+ var dn = an.finishDraft.bind(an);
5235
+
5236
+ // ../canvas/dist/index.mjs
5237
+ var __create2 = Object.create;
5238
+ var __defProp3 = Object.defineProperty;
5239
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
5240
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
5241
+ var __getProtoOf2 = Object.getPrototypeOf;
5242
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
5243
+ var __commonJS = (cb, mod) => function __require() {
5244
+ return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
5245
+ };
5246
+ var __copyProps2 = (to, from, except, desc) => {
5247
+ if (from && typeof from === "object" || typeof from === "function") {
5248
+ for (let key of __getOwnPropNames2(from))
5249
+ if (!__hasOwnProp2.call(to, key) && key !== except)
5250
+ __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
5251
+ }
5252
+ return to;
5253
+ };
5254
+ var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
5255
+ // If the importer is in node compatibility mode or this is not an ESM
5256
+ // file that has been converted to a CommonJS file using a Babel-
5257
+ // compatible transform (i.e. "__esModule" has not been set), then set
5258
+ // "default" to the CommonJS "module.exports" for node compatibility.
5259
+ isNodeMode || !mod || !mod.__esModule ? __defProp3(target, "default", { value: mod, enumerable: true }) : target,
5260
+ mod
5261
+ ));
5262
+ var __accessCheck2 = (obj, member, msg) => {
5263
+ if (!member.has(obj))
5264
+ throw TypeError("Cannot " + msg);
5265
+ };
5266
+ var __privateGet2 = (obj, member, getter) => {
5267
+ __accessCheck2(obj, member, "read from private field");
5268
+ return getter ? getter.call(obj) : member.get(obj);
5269
+ };
5270
+ var __privateAdd2 = (obj, member, value) => {
5271
+ if (member.has(obj))
5272
+ throw TypeError("Cannot add the same private member more than once");
5273
+ member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
5274
+ };
5275
+ var require_retry_operation = __commonJS({
5276
+ "../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry_operation.js"(exports, module2) {
5277
+ function RetryOperation(timeouts, options) {
5278
+ if (typeof options === "boolean") {
5279
+ options = { forever: options };
5280
+ }
5281
+ this._originalTimeouts = JSON.parse(JSON.stringify(timeouts));
5282
+ this._timeouts = timeouts;
5283
+ this._options = options || {};
5284
+ this._maxRetryTime = options && options.maxRetryTime || Infinity;
5285
+ this._fn = null;
5286
+ this._errors = [];
5287
+ this._attempts = 1;
5288
+ this._operationTimeout = null;
5289
+ this._operationTimeoutCb = null;
5290
+ this._timeout = null;
5291
+ this._operationStart = null;
5292
+ this._timer = null;
5293
+ if (this._options.forever) {
5294
+ this._cachedTimeouts = this._timeouts.slice(0);
5295
+ }
5296
+ }
5297
+ module2.exports = RetryOperation;
5298
+ RetryOperation.prototype.reset = function() {
5299
+ this._attempts = 1;
5300
+ this._timeouts = this._originalTimeouts.slice(0);
5301
+ };
5302
+ RetryOperation.prototype.stop = function() {
5303
+ if (this._timeout) {
5304
+ clearTimeout(this._timeout);
5305
+ }
5306
+ if (this._timer) {
5307
+ clearTimeout(this._timer);
5308
+ }
5309
+ this._timeouts = [];
5310
+ this._cachedTimeouts = null;
5311
+ };
5312
+ RetryOperation.prototype.retry = function(err) {
5313
+ if (this._timeout) {
5314
+ clearTimeout(this._timeout);
5315
+ }
5316
+ if (!err) {
5317
+ return false;
5318
+ }
5319
+ var currentTime = (/* @__PURE__ */ new Date()).getTime();
5320
+ if (err && currentTime - this._operationStart >= this._maxRetryTime) {
5321
+ this._errors.push(err);
5322
+ this._errors.unshift(new Error("RetryOperation timeout occurred"));
5323
+ return false;
5324
+ }
5325
+ this._errors.push(err);
5326
+ var timeout = this._timeouts.shift();
5327
+ if (timeout === void 0) {
5328
+ if (this._cachedTimeouts) {
5329
+ this._errors.splice(0, this._errors.length - 1);
5330
+ timeout = this._cachedTimeouts.slice(-1);
5331
+ } else {
5332
+ return false;
5333
+ }
5334
+ }
5335
+ var self = this;
5336
+ this._timer = setTimeout(function() {
5337
+ self._attempts++;
5338
+ if (self._operationTimeoutCb) {
5339
+ self._timeout = setTimeout(function() {
5340
+ self._operationTimeoutCb(self._attempts);
5341
+ }, self._operationTimeout);
5342
+ if (self._options.unref) {
5343
+ self._timeout.unref();
5344
+ }
5345
+ }
5346
+ self._fn(self._attempts);
5347
+ }, timeout);
5348
+ if (this._options.unref) {
5349
+ this._timer.unref();
5350
+ }
5351
+ return true;
5352
+ };
5353
+ RetryOperation.prototype.attempt = function(fn2, timeoutOps) {
5354
+ this._fn = fn2;
5355
+ if (timeoutOps) {
5356
+ if (timeoutOps.timeout) {
5357
+ this._operationTimeout = timeoutOps.timeout;
5358
+ }
5359
+ if (timeoutOps.cb) {
5360
+ this._operationTimeoutCb = timeoutOps.cb;
5361
+ }
5362
+ }
5363
+ var self = this;
5364
+ if (this._operationTimeoutCb) {
5365
+ this._timeout = setTimeout(function() {
5366
+ self._operationTimeoutCb();
5367
+ }, self._operationTimeout);
5368
+ }
5369
+ this._operationStart = (/* @__PURE__ */ new Date()).getTime();
5370
+ this._fn(this._attempts);
5371
+ };
5372
+ RetryOperation.prototype.try = function(fn2) {
5373
+ console.log("Using RetryOperation.try() is deprecated");
5374
+ this.attempt(fn2);
5375
+ };
5376
+ RetryOperation.prototype.start = function(fn2) {
5377
+ console.log("Using RetryOperation.start() is deprecated");
5378
+ this.attempt(fn2);
5379
+ };
5380
+ RetryOperation.prototype.start = RetryOperation.prototype.try;
5381
+ RetryOperation.prototype.errors = function() {
5382
+ return this._errors;
5383
+ };
5384
+ RetryOperation.prototype.attempts = function() {
5385
+ return this._attempts;
5386
+ };
5387
+ RetryOperation.prototype.mainError = function() {
5388
+ if (this._errors.length === 0) {
5389
+ return null;
5390
+ }
5391
+ var counts = {};
5392
+ var mainError = null;
5393
+ var mainErrorCount = 0;
5394
+ for (var i2 = 0; i2 < this._errors.length; i2++) {
5395
+ var error = this._errors[i2];
5396
+ var message = error.message;
5397
+ var count = (counts[message] || 0) + 1;
5398
+ counts[message] = count;
5399
+ if (count >= mainErrorCount) {
5400
+ mainError = error;
5401
+ mainErrorCount = count;
5402
+ }
5403
+ }
5404
+ return mainError;
5405
+ };
5406
+ }
5407
+ });
5408
+ var require_retry = __commonJS({
5409
+ "../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry.js"(exports) {
5410
+ var RetryOperation = require_retry_operation();
5411
+ exports.operation = function(options) {
5412
+ var timeouts = exports.timeouts(options);
5413
+ return new RetryOperation(timeouts, {
5414
+ forever: options && (options.forever || options.retries === Infinity),
5415
+ unref: options && options.unref,
5416
+ maxRetryTime: options && options.maxRetryTime
5417
+ });
5418
+ };
5419
+ exports.timeouts = function(options) {
5420
+ if (options instanceof Array) {
5421
+ return [].concat(options);
5422
+ }
5423
+ var opts = {
5424
+ retries: 10,
5425
+ factor: 2,
5426
+ minTimeout: 1 * 1e3,
5427
+ maxTimeout: Infinity,
5428
+ randomize: false
5429
+ };
5430
+ for (var key in options) {
5431
+ opts[key] = options[key];
5432
+ }
5433
+ if (opts.minTimeout > opts.maxTimeout) {
5434
+ throw new Error("minTimeout is greater than maxTimeout");
5435
+ }
5436
+ var timeouts = [];
5437
+ for (var i2 = 0; i2 < opts.retries; i2++) {
5438
+ timeouts.push(this.createTimeout(i2, opts));
5439
+ }
5440
+ if (options && options.forever && !timeouts.length) {
5441
+ timeouts.push(this.createTimeout(i2, opts));
5442
+ }
5443
+ timeouts.sort(function(a2, b2) {
5444
+ return a2 - b2;
5445
+ });
5446
+ return timeouts;
5447
+ };
5448
+ exports.createTimeout = function(attempt, opts) {
5449
+ var random = opts.randomize ? Math.random() + 1 : 1;
5450
+ var timeout = Math.round(random * Math.max(opts.minTimeout, 1) * Math.pow(opts.factor, attempt));
5451
+ timeout = Math.min(timeout, opts.maxTimeout);
5452
+ return timeout;
5453
+ };
5454
+ exports.wrap = function(obj, options, methods) {
5455
+ if (options instanceof Array) {
5456
+ methods = options;
5457
+ options = null;
5458
+ }
5459
+ if (!methods) {
5460
+ methods = [];
5461
+ for (var key in obj) {
5462
+ if (typeof obj[key] === "function") {
5463
+ methods.push(key);
5464
+ }
5465
+ }
5466
+ }
5467
+ for (var i2 = 0; i2 < methods.length; i2++) {
5468
+ var method = methods[i2];
5469
+ var original = obj[method];
5470
+ obj[method] = function retryWrapper(original2) {
5471
+ var op = exports.operation(options);
5472
+ var args = Array.prototype.slice.call(arguments, 1);
5473
+ var callback = args.pop();
5474
+ args.push(function(err) {
5475
+ if (op.retry(err)) {
5476
+ return;
5477
+ }
5478
+ if (err) {
5479
+ arguments[0] = op.mainError();
5480
+ }
5481
+ callback.apply(this, arguments);
5482
+ });
5483
+ op.attempt(function() {
5484
+ original2.apply(obj, args);
5485
+ });
5486
+ }.bind(obj, original);
5487
+ obj[method].options = options;
5488
+ }
5489
+ };
5490
+ }
5491
+ });
5492
+ var require_retry2 = __commonJS({
5493
+ "../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/index.js"(exports, module2) {
5494
+ module2.exports = require_retry();
5495
+ }
5496
+ });
5497
+ var import_retry = __toESM2(require_retry2(), 1);
5498
+ var _url8;
5499
+ var _DataTypeClient = class extends ApiClient {
5500
+ constructor(options) {
5501
+ super(options);
5502
+ }
5503
+ /** Fetches all DataTypes for a project */
5504
+ async get(options) {
5505
+ const { projectId } = this.options;
5506
+ const fetchUri = this.createUrl(__privateGet2(_DataTypeClient, _url8), { ...options, projectId });
5507
+ return await this.apiClient(fetchUri);
5508
+ }
5509
+ /** Updates or creates (based on id) a DataType */
5510
+ async upsert(body) {
5511
+ const fetchUri = this.createUrl(__privateGet2(_DataTypeClient, _url8));
5512
+ await this.apiClient(fetchUri, {
5513
+ method: "PUT",
5514
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
5515
+ expectNoContent: true
5516
+ });
5517
+ }
5518
+ /** Deletes a DataType */
5519
+ async remove(body) {
5520
+ const fetchUri = this.createUrl(__privateGet2(_DataTypeClient, _url8));
5521
+ await this.apiClient(fetchUri, {
5522
+ method: "DELETE",
5523
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
5524
+ expectNoContent: true
5525
+ });
5526
+ }
5527
+ };
5528
+ var DataTypeClient = _DataTypeClient;
5529
+ _url8 = /* @__PURE__ */ new WeakMap();
5530
+ __privateAdd2(DataTypeClient, _url8, "/api/v1/data-types");
5531
+ var EDGE_MAX_L2_CACHE_TTL_IN_HOURS = 4 * 7 * 24;
5532
+ function bindVariables({
5533
+ variables,
5534
+ value,
5535
+ errorPrefix = "Variable",
5536
+ handleBinding
5537
+ }) {
5538
+ let boundCount = 0;
5539
+ const errors = [];
5540
+ const defaultHandleBinding = (variableName2, variables2, errors2) => {
5541
+ const variableValue2 = variables2[variableName2];
5542
+ if (variableValue2 === void 0) {
5543
+ errors2.push(`${errorPrefix} "${variableName2}" is not defined`);
5544
+ return "";
5545
+ }
5546
+ return variableValue2;
5547
+ };
5548
+ const result = value.replace(/(?<!\\)\${([^}]+)}/g, (_match, variableName2) => {
5549
+ const variableValue2 = (handleBinding != null ? handleBinding : defaultHandleBinding)(variableName2, variables, errors);
5550
+ boundCount++;
5551
+ return variableValue2;
5552
+ });
5553
+ return { result, boundCount, errors: errors.length > 0 ? errors : void 0 };
5554
+ }
5555
+ function bindVariablesToObject(options) {
5556
+ return bindVariablesToObjectRecursive(options);
5557
+ }
5558
+ function bindVariablesToObjectRecursive({
5559
+ value,
5560
+ recursivePath,
5561
+ ...bindVariablesOptions
5562
+ }) {
5563
+ let boundCount = 0;
5564
+ const errors = [];
5565
+ if (typeof value === "string") {
5566
+ return bindVariables({ ...bindVariablesOptions, value });
5567
+ }
5568
+ if (typeof value !== "object" || value === null) {
5569
+ return { boundCount: 0, result: value };
5570
+ }
5571
+ const result = fn(value, (draft) => {
5572
+ Object.entries(draft).forEach(([property, oldValue]) => {
5573
+ const currentObjectPath = recursivePath ? `${recursivePath}.${property}` : property;
5574
+ if (typeof oldValue === "string") {
5575
+ const bindResult = bindVariables({ ...bindVariablesOptions, value: oldValue });
5576
+ if (oldValue !== bindResult.result || bindResult.errors) {
5577
+ boundCount += bindResult.boundCount;
5578
+ draft[property] = bindResult.result;
5579
+ if (bindResult.errors) {
5580
+ errors.push(...bindResult.errors.map((e) => `${currentObjectPath}: ${e}`));
5581
+ }
5582
+ }
5583
+ return;
5584
+ }
5585
+ const childBind = bindVariablesToObject({
5586
+ ...bindVariablesOptions,
5587
+ value: oldValue,
5588
+ recursivePath: currentObjectPath
5589
+ });
5590
+ if (childBind.boundCount || childBind.errors) {
5591
+ boundCount += childBind.boundCount;
5592
+ draft[property] = childBind.result;
5593
+ if (childBind.errors) {
5594
+ errors.push(...childBind.errors.map((e) => `${currentObjectPath}: ${e}`));
5595
+ }
5596
+ }
5597
+ });
5598
+ });
5599
+ return { boundCount, result, errors: errors.length > 0 ? errors : void 0 };
5600
+ }
4247
5601
 
4248
- // src/components/ObjectSearch/ObjectSearchFilter.tsx
4249
- var import_design_system26 = require("@uniformdev/design-system");
4250
- var import_react43 = require("react");
5602
+ // src/components/ObjectSearch/ObjectSearchContainer.tsx
5603
+ var import_design_system25 = require("@uniformdev/design-system");
4251
5604
 
4252
5605
  // 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)({
5606
+ var import_react43 = require("react");
5607
+ var import_jsx_runtime48 = require("@emotion/react/jsx-runtime");
5608
+ var ObjectSearchContext = (0, import_react43.createContext)({
4256
5609
  onSetQuery: () => {
4257
5610
  },
4258
5611
  onSelectItem: () => {
4259
5612
  },
4260
- query: {
4261
- contentType: "",
4262
- keyword: ""
4263
- },
5613
+ query: {},
5614
+ boundQuery: {},
4264
5615
  list: {},
4265
5616
  onSetList: () => {
4266
5617
  },
@@ -4269,26 +5620,27 @@ var ObjectSearchContext = (0, import_react41.createContext)({
4269
5620
  }
4270
5621
  });
4271
5622
  var ObjectSearchProvider = ({ currentlySelectedItems, children }) => {
4272
- const [query, setQuery] = (0, import_react41.useState)({
5623
+ const [query, setQuery] = (0, import_react43.useState)({
4273
5624
  contentType: "",
4274
5625
  keyword: ""
4275
5626
  });
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) {
5627
+ const { flatVariables } = useVariables(true);
5628
+ const querySearchDeferred = (0, import_react43.useDeferredValue)(query);
5629
+ const [selectedItems, setSelectedItems] = (0, import_react43.useState)(currentlySelectedItems != null ? currentlySelectedItems : []);
5630
+ const [list, setList] = (0, import_react43.useState)({});
5631
+ const onSetQuery = (0, import_react43.useCallback)(
5632
+ (value2) => {
5633
+ if (Array.isArray(value2.contentType) && value2.contentType.length > 0) {
4282
5634
  return setQuery({
4283
- ...value,
4284
- contentType: value.contentType[0].id
5635
+ ...value2,
5636
+ contentType: value2.contentType[0].id
4285
5637
  });
4286
5638
  }
4287
- return setQuery(value);
5639
+ return setQuery(value2);
4288
5640
  },
4289
5641
  [setQuery]
4290
5642
  );
4291
- const onSelectItem = (0, import_react41.useCallback)(
5643
+ const onSelectItem = (0, import_react43.useCallback)(
4292
5644
  (selectedResult) => {
4293
5645
  if (Array.isArray(selectedResult)) {
4294
5646
  setSelectedItems(selectedResult);
@@ -4302,39 +5654,120 @@ var ObjectSearchProvider = ({ currentlySelectedItems, children }) => {
4302
5654
  },
4303
5655
  [setSelectedItems, selectedItems]
4304
5656
  );
4305
- const onRemoveAllSelectedItems = (0, import_react41.useCallback)(() => {
5657
+ const onRemoveAllSelectedItems = (0, import_react43.useCallback)(() => {
4306
5658
  setSelectedItems([]);
4307
5659
  }, [setSelectedItems]);
4308
- const onSetList = (0, import_react41.useCallback)(
4309
- (value) => {
4310
- setList(value);
5660
+ const onSetList = (0, import_react43.useCallback)(
5661
+ (value2) => {
5662
+ setList(value2);
4311
5663
  },
4312
5664
  [setList]
4313
5665
  );
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
- }
5666
+ const boundQuery = (0, import_react43.useMemo)(() => bindQuery(query, flatVariables), [query, flatVariables]);
5667
+ const value = (0, import_react43.useMemo)(
5668
+ () => ({
5669
+ boundQuery,
5670
+ onSetQuery,
5671
+ query: querySearchDeferred,
5672
+ onSelectItem,
5673
+ selectedListItems: selectedItems,
5674
+ onRemoveAllSelectedItems,
5675
+ list,
5676
+ onSetList
5677
+ }),
5678
+ [
5679
+ boundQuery,
5680
+ onSetQuery,
5681
+ querySearchDeferred,
5682
+ onSelectItem,
5683
+ selectedItems,
5684
+ onRemoveAllSelectedItems,
5685
+ list,
5686
+ onSetList
5687
+ ]
4328
5688
  );
5689
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ObjectSearchContext.Provider, { value, children });
4329
5690
  };
4330
- var useObjectSearchContext = () => {
4331
- const contextValues = (0, import_react41.useContext)(ObjectSearchContext);
4332
- return { ...contextValues };
5691
+ function useObjectSearchContext() {
5692
+ return (0, import_react43.useContext)(ObjectSearchContext);
5693
+ }
5694
+ function bindQuery(query, inputs) {
5695
+ const { result, errors } = bindVariablesToObject({
5696
+ value: query,
5697
+ variables: inputs,
5698
+ errorPrefix: "Dynamic input"
5699
+ });
5700
+ if (errors == null ? void 0 : errors.length) {
5701
+ console.error(`Error binding query filters to dynamic inputs`, errors);
5702
+ }
5703
+ return result;
5704
+ }
5705
+
5706
+ // src/components/ObjectSearch/ObjectSearchContainer.tsx
5707
+ var import_jsx_runtime49 = require("@emotion/react/jsx-runtime");
5708
+ var ObjectSearchContainer = ({
5709
+ label,
5710
+ enableDynamicInputToResultId,
5711
+ searchFilters,
5712
+ resultList,
5713
+ children
5714
+ }) => {
5715
+ var _a, _b;
5716
+ const { onSelectItem, selectedListItems, list } = useObjectSearchContext();
5717
+ const { flatVariables } = useVariables(true);
5718
+ const body = /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_design_system25.VerticalRhythm, { children: [
5719
+ searchFilters,
5720
+ !resultList ? null : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system25.ScrollableList, { role: "list", children: resultList })
5721
+ ] });
5722
+ const handleSelectedVariableChange = (selectedValue) => {
5723
+ var _a2;
5724
+ if (!selectedValue) {
5725
+ onSelectItem([]);
5726
+ return;
5727
+ }
5728
+ const { result, errors } = bindVariables({
5729
+ value: selectedValue,
5730
+ variables: flatVariables,
5731
+ errorPrefix: "Dynamic input"
5732
+ });
5733
+ if (!result) {
5734
+ onSelectItem([]);
5735
+ return;
5736
+ }
5737
+ const item = (_a2 = list.items) == null ? void 0 : _a2.find((i2) => i2.id === result);
5738
+ onSelectItem([
5739
+ {
5740
+ title: selectedValue,
5741
+ contentType: (errors == null ? void 0 : errors.length) ? errors[0] : `Current dynamic value "${result}" is not an ID in the options`,
5742
+ // spread any matched list item, overriding the above default props
5743
+ ...item,
5744
+ // we want to make sure the ID is our dynamic value
5745
+ id: selectedValue
5746
+ }
5747
+ ]);
5748
+ };
5749
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system25.IconsProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_design_system25.VerticalRhythm, { children: [
5750
+ /* @__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)(
5751
+ InputVariables,
5752
+ {
5753
+ label,
5754
+ value: (_b = (_a = selectedListItems == null ? void 0 : selectedListItems[0]) == null ? void 0 : _a.id) != null ? _b : "",
5755
+ onChange: handleSelectedVariableChange,
5756
+ inputWhenNoVariables: body,
5757
+ disableVariables: !enableDynamicInputToResultId
5758
+ }
5759
+ ) : body }),
5760
+ children
5761
+ ] }) });
4333
5762
  };
4334
5763
 
5764
+ // src/components/ObjectSearch/ObjectSearchFilter.tsx
5765
+ var import_design_system26 = require("@uniformdev/design-system");
5766
+ var import_react45 = require("react");
5767
+
4335
5768
  // src/components/ObjectSearch/styles/ObjectSearchFilterContainer.styles.ts
4336
- var import_react42 = require("@emotion/react");
4337
- var ObjectSearchFilterContainerLabel = import_react42.css`
5769
+ var import_react44 = require("@emotion/react");
5770
+ var ObjectSearchFilterContainerLabel = import_react44.css`
4338
5771
  align-items: center;
4339
5772
  display: flex;
4340
5773
  font-size: var(--fs-sm);
@@ -4342,21 +5775,21 @@ var ObjectSearchFilterContainerLabel = import_react42.css`
4342
5775
  line-height: 1rem;
4343
5776
  margin-bottom: var(--spacing-sm);
4344
5777
  `;
4345
- var ObjectSearchFilterContainer = import_react42.css`
5778
+ var ObjectSearchFilterContainer = import_react44.css`
4346
5779
  display: grid;
4347
5780
  gap: var(--spacing-base);
4348
5781
  `;
4349
- var ObjectSearchFilterDropdownAndTextSearch = import_react42.css`
5782
+ var ObjectSearchFilterDropdownAndTextSearch = import_react44.css`
4350
5783
  grid-template-columns: 0.5fr 1fr;
4351
5784
  `;
4352
- var ObjectSearchFilterGrid = (gridColumns) => import_react42.css`
5785
+ var ObjectSearchFilterGrid = (gridColumns) => import_react44.css`
4353
5786
  display: grid;
4354
5787
  grid-template-columns: ${gridColumns};
4355
5788
  gap: var(--spacing-base);
4356
5789
  `;
4357
5790
 
4358
5791
  // src/components/ObjectSearch/ObjectSearchFilter.tsx
4359
- var import_jsx_runtime48 = require("@emotion/react/jsx-runtime");
5792
+ var import_jsx_runtime50 = require("@emotion/react/jsx-runtime");
4360
5793
  var ObjectSearchFilter = ({
4361
5794
  requireContentType,
4362
5795
  typeSelectorAllTypesOptionText = "All content types",
@@ -4366,7 +5799,7 @@ var ObjectSearchFilter = ({
4366
5799
  selectOptions
4367
5800
  }) => {
4368
5801
  const { query, onSetQuery } = useObjectSearchContext();
4369
- const [searchState, setSearchState] = (0, import_react43.useState)({
5802
+ const [searchState, setSearchState] = (0, import_react45.useState)({
4370
5803
  contentType: "",
4371
5804
  keyword: ""
4372
5805
  });
@@ -4376,8 +5809,8 @@ var ObjectSearchFilter = ({
4376
5809
  });
4377
5810
  onSetQuery({ ...query, ...value });
4378
5811
  };
4379
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("fieldset", { css: [ObjectSearchFilterContainer, ObjectSearchFilterDropdownAndTextSearch], children: [
4380
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
5812
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("fieldset", { css: [ObjectSearchFilterContainer, ObjectSearchFilterDropdownAndTextSearch], children: [
5813
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
4381
5814
  import_design_system26.InputSelect,
4382
5815
  {
4383
5816
  label: selectLabel,
@@ -4393,7 +5826,7 @@ var ObjectSearchFilter = ({
4393
5826
  value: query.contentType
4394
5827
  }
4395
5828
  ),
4396
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
5829
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
4397
5830
  import_design_system26.InputKeywordSearch,
4398
5831
  {
4399
5832
  inputFieldName: searchInputName,
@@ -4408,11 +5841,11 @@ var ObjectSearchFilter = ({
4408
5841
  };
4409
5842
 
4410
5843
  // src/components/ObjectSearch/ObjectSearchFilterContainer.tsx
4411
- var import_jsx_runtime49 = require("@emotion/react/jsx-runtime");
5844
+ var import_jsx_runtime51 = require("@emotion/react/jsx-runtime");
4412
5845
  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 })
5846
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { children: [
5847
+ label ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { css: ObjectSearchFilterContainerLabel, children: label }) : null,
5848
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { css: ObjectSearchFilterContainer, children })
4416
5849
  ] });
4417
5850
  };
4418
5851
 
@@ -4420,9 +5853,9 @@ var ObjectSearchFilterContainer2 = ({ label, children }) => {
4420
5853
  var import_design_system28 = require("@uniformdev/design-system");
4421
5854
 
4422
5855
  // src/components/ObjectSearch/styles/ObjectSearchListItem.styles.ts
4423
- var import_react44 = require("@emotion/react");
5856
+ var import_react46 = require("@emotion/react");
4424
5857
  var import_design_system27 = require("@uniformdev/design-system");
4425
- var ObjectListItemContainer = import_react44.css`
5858
+ var ObjectListItemContainer = import_react46.css`
4426
5859
  align-items: center;
4427
5860
  border: 1px solid var(--gray-300);
4428
5861
  border-radius: var(--rounded-base);
@@ -4435,7 +5868,7 @@ var ObjectListItemContainer = import_react44.css`
4435
5868
  display: none;
4436
5869
  }
4437
5870
  `;
4438
- var ObjectListItemLoading = import_react44.css`
5871
+ var ObjectListItemLoading = import_react46.css`
4439
5872
  animation: ${import_design_system27.skeletonLoading} 1s linear infinite alternate;
4440
5873
  border-color: transparent;
4441
5874
  min-height: 42px;
@@ -4459,37 +5892,37 @@ var ObjectListItemLoading = import_react44.css`
4459
5892
  width: 1rem;
4460
5893
  }
4461
5894
  `;
4462
- var ObjectListItemHeadingGroup = import_react44.css`
5895
+ var ObjectListItemHeadingGroup = import_react46.css`
4463
5896
  align-items: center;
4464
5897
  display: grid;
4465
5898
  `;
4466
- var ObjectListItemTitle = import_react44.css`
5899
+ var ObjectListItemTitle = import_react46.css`
4467
5900
  color: var(--brand-secondary-1);
4468
5901
  display: block;
4469
5902
  font-size: var(--fs-sm);
4470
5903
  `;
4471
- var ObjectListItemSubtitle = import_react44.css`
5904
+ var ObjectListItemSubtitle = import_react46.css`
4472
5905
  color: var(--gray-500);
4473
5906
  display: block;
4474
5907
  font-size: var(--fs-xs);
4475
5908
  line-height: 1;
4476
5909
  `;
4477
- var ObjectListItemInfoContainer = import_react44.css`
5910
+ var ObjectListItemInfoContainer = import_react46.css`
4478
5911
  align-items: center;
4479
5912
  display: flex;
4480
5913
  justify-content: center;
4481
5914
  `;
4482
- var ObjectListItemControlledContent = import_react44.css`
5915
+ var ObjectListItemControlledContent = import_react46.css`
4483
5916
  display: flex;
4484
5917
  gap: var(--spacing-sm);
4485
5918
  `;
4486
- var ObjectListItemUnControlledContent = import_react44.css`
5919
+ var ObjectListItemUnControlledContent = import_react46.css`
4487
5920
  margin-top: var(--spacing-sm);
4488
5921
  grid-column: 1 / -1;
4489
5922
  `;
4490
5923
 
4491
5924
  // src/components/ObjectSearch/ObjectSearchListItem.tsx
4492
- var import_jsx_runtime50 = require("@emotion/react/jsx-runtime");
5925
+ var import_jsx_runtime52 = require("@emotion/react/jsx-runtime");
4493
5926
  var ObjectSearchListItem = ({
4494
5927
  id,
4495
5928
  title,
@@ -4498,8 +5931,7 @@ var ObjectSearchListItem = ({
4498
5931
  popoverData,
4499
5932
  onSelect,
4500
5933
  isMulti = false,
4501
- children,
4502
- ...props
5934
+ children
4503
5935
  }) => {
4504
5936
  const { onSelectItem, selectedListItems } = useObjectSearchContext();
4505
5937
  const formatedContentType = Array.isArray(contentType) ? contentType.join(", ") : contentType;
@@ -4513,20 +5945,20 @@ var ObjectSearchListItem = ({
4513
5945
  return onSelectItem([selectedItem]);
4514
5946
  };
4515
5947
  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 })
5948
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { role: "listitem", hidden: hideWhenInSelectedList, css: ObjectListItemContainer, children: [
5949
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { role: "button", onClick: handleSelectItem, css: ObjectListItemControlledContent, children: [
5950
+ !image ? null : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("img", { ...image, loading: (image == null ? void 0 : image.width) && image.height ? "lazy" : "eager" }),
5951
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { role: "heading", css: ObjectListItemHeadingGroup, children: [
5952
+ !contentType ? null : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { css: ObjectListItemSubtitle, children: formatedContentType }),
5953
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { css: ObjectListItemTitle, children: title })
4522
5954
  ] })
4523
5955
  ] }),
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 })
5956
+ !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 }) }),
5957
+ !children ? null : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { css: ObjectListItemUnControlledContent, children })
4526
5958
  ] });
4527
5959
  };
4528
5960
  var ObjectSearchListItemLoadingSkeleton = () => {
4529
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { role: "presentation", css: [ObjectListItemContainer, ObjectListItemLoading] });
5961
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { role: "presentation", css: [ObjectListItemContainer, ObjectListItemLoading] });
4530
5962
  };
4531
5963
 
4532
5964
  // src/components/ObjectSearch/ObjectSearchResultItem.tsx
@@ -4534,9 +5966,9 @@ var import_design_system30 = require("@uniformdev/design-system");
4534
5966
  var import_timeago3 = require("timeago.js");
4535
5967
 
4536
5968
  // src/components/ObjectSearch/styles/ObjectSearchResultItemButton.styles.ts
4537
- var import_react45 = require("@emotion/react");
5969
+ var import_react47 = require("@emotion/react");
4538
5970
  var import_design_system29 = require("@uniformdev/design-system");
4539
- var ButtonStyles = import_react45.css`
5971
+ var ButtonStyles = import_react47.css`
4540
5972
  ${import_design_system29.button}
4541
5973
  background: transparent;
4542
5974
  border: 1px solid var(--brand-secondary-1);
@@ -4563,20 +5995,20 @@ var ButtonStyles = import_react45.css`
4563
5995
  text-decoration: none;
4564
5996
  }
4565
5997
  `;
4566
- var ButtonIcon = import_react45.css`
5998
+ var ButtonIcon = import_react47.css`
4567
5999
  width: 1rem;
4568
6000
  height: 1rem;
4569
6001
  `;
4570
6002
 
4571
6003
  // src/components/ObjectSearch/ObjectSearchResultItemButton.tsx
4572
- var import_jsx_runtime51 = require("@emotion/react/jsx-runtime");
6004
+ var import_jsx_runtime53 = require("@emotion/react/jsx-runtime");
4573
6005
  var ObjectSearchResultItemButton = ({
4574
6006
  text,
4575
6007
  icon,
4576
6008
  ...props
4577
6009
  }) => {
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 }),
6010
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("button", { type: "button", css: ButtonStyles, ...props, children: [
6011
+ !icon ? null : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Image, { src: icon, css: ButtonIcon }),
4580
6012
  text
4581
6013
  ] });
4582
6014
  };
@@ -4585,15 +6017,15 @@ var LinkButton = ({
4585
6017
  icon,
4586
6018
  ...props
4587
6019
  }) => {
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 }),
6020
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("a", { ...props, css: ButtonStyles, target: "_blank", rel: "noopener noreferrer", children: [
6021
+ !icon ? null : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Image, { src: icon, css: ButtonIcon }),
4590
6022
  text
4591
6023
  ] });
4592
6024
  };
4593
6025
 
4594
6026
  // src/components/ObjectSearch/styles/ObjectSearchResultItem.styles.ts
4595
- var import_react46 = require("@emotion/react");
4596
- var ObjectSearchResultItemContainer = import_react46.css`
6027
+ var import_react48 = require("@emotion/react");
6028
+ var ObjectSearchResultItemContainer = import_react48.css`
4597
6029
  align-items: center;
4598
6030
  border: 1px solid var(--gray-300);
4599
6031
  border-radius: var(--rounded-base);
@@ -4609,7 +6041,7 @@ var ObjectSearchResultItemContainer = import_react46.css`
4609
6041
  }
4610
6042
  }
4611
6043
  `;
4612
- var ObjectSearchDragHandle = import_react46.css`
6044
+ var ObjectSearchDragHandle = import_react48.css`
4613
6045
  border-left: 2px dotted var(--gray-300);
4614
6046
  border-right: 2px dotted var(--gray-300);
4615
6047
  position: absolute;
@@ -4618,41 +6050,41 @@ var ObjectSearchDragHandle = import_react46.css`
4618
6050
  transition: opacity var(--duration-fast) var(--timing-ease-out);
4619
6051
  opacity: 0;
4620
6052
  `;
4621
- var ObjectSearchResultItemSubtitle = import_react46.css`
6053
+ var ObjectSearchResultItemSubtitle = import_react48.css`
4622
6054
  color: var(--gray-500);
4623
6055
  display: block;
4624
6056
  font-size: var(--fs-xs);
4625
6057
  line-height: 1;
4626
6058
  `;
4627
- var ObjectSearchResultItemTitle = import_react46.css`
6059
+ var ObjectSearchResultItemTitle = import_react48.css`
4628
6060
  align-items: center;
4629
6061
  color: var(--brand-secondary-1);
4630
6062
  display: flex;
4631
6063
  gap: var(--spacing-xs);
4632
6064
  `;
4633
- var ObjectSearchResultItemTimeStamp = import_react46.css`
6065
+ var ObjectSearchResultItemTimeStamp = import_react48.css`
4634
6066
  color: var(--gray-500);
4635
6067
  font-size: var(--fs-xs);
4636
6068
  `;
4637
- var ObjectSearchAuthorStateGroup = import_react46.css`
6069
+ var ObjectSearchAuthorStateGroup = import_react48.css`
4638
6070
  align-items: center;
4639
6071
  display: flex;
4640
6072
  gap: var(--spacing-sm);
4641
6073
  `;
4642
- var ObjectSearchUpdateGroup = import_react46.css`
6074
+ var ObjectSearchUpdateGroup = import_react48.css`
4643
6075
  display: grid;
4644
6076
  `;
4645
- var ObjectSearchContentContainer = import_react46.css`
6077
+ var ObjectSearchContentContainer = import_react48.css`
4646
6078
  display: flex;
4647
6079
  gap: var(--spacing-base);
4648
6080
  `;
4649
- var ObjectSearchImage = import_react46.css`
6081
+ var ObjectSearchImage = import_react48.css`
4650
6082
  width: 56px;
4651
6083
  object-fit: contain;
4652
6084
  `;
4653
6085
 
4654
6086
  // src/components/ObjectSearch/ObjectSearchResultItem.tsx
4655
- var import_jsx_runtime52 = require("@emotion/react/jsx-runtime");
6087
+ var import_jsx_runtime54 = require("@emotion/react/jsx-runtime");
4656
6088
  var ObjectSearchResultItem = ({
4657
6089
  id,
4658
6090
  title,
@@ -4673,38 +6105,38 @@ var ObjectSearchResultItem = ({
4673
6105
  const { onSelectItem } = useObjectSearchContext();
4674
6106
  const formatedContentType = Array.isArray(contentType) ? contentType.join(", ") : contentType;
4675
6107
  const onRemoveItem = () => {
4676
- onSelectItem({ id });
6108
+ onSelectItem({ id, title: id });
4677
6109
  onRemove == null ? void 0 : onRemove();
4678
6110
  };
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: [
6111
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { css: ObjectSearchResultItemContainer, children: [
6112
+ disableDnD ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { role: "presentation", className: "drag-handle", css: ObjectSearchDragHandle }),
6113
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { css: ObjectSearchContentContainer, children: [
6114
+ !imageUrl ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("img", { src: imageUrl, alt: `Thumbnail for ${title}`, css: ObjectSearchImage }),
6115
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { children: [
6116
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { css: ObjectSearchResultItemSubtitle, children: formatedContentType }),
6117
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { role: "heading", css: ObjectSearchResultItemTitle, children: [
4686
6118
  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 })
6119
+ !popoverData ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_design_system30.Popover, { baseId: title, ariaLabel: title, buttonText: `See ${title} details`, children: popoverData })
4688
6120
  ] }),
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: " }),
6121
+ !createdAt && !publishStatus ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { css: ObjectSearchAuthorStateGroup, children: [
6122
+ !(publishStatus == null ? void 0 : publishStatus.text) ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_design_system30.Badge, { ...publishStatus, size: "sm", uppercaseText: true }),
6123
+ !createdAt && !publishedAt ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { css: ObjectSearchUpdateGroup, children: [
6124
+ !createdAt ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("small", { css: ObjectSearchResultItemTimeStamp, children: [
6125
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("strong", { children: "Last updated: " }),
4694
6126
  (0, import_timeago3.format)(createdAt)
4695
6127
  ] }),
4696
- !publishedAt ? null : /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("small", { css: ObjectSearchResultItemTimeStamp, children: [
4697
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("strong", { children: "Last published: " }),
6128
+ !publishedAt ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("small", { css: ObjectSearchResultItemTimeStamp, children: [
6129
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("strong", { children: "Last published: " }),
4698
6130
  (0, import_timeago3.format)(publishedAt)
4699
6131
  ] })
4700
6132
  ] })
4701
6133
  ] }),
4702
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { children })
6134
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { children })
4703
6135
  ] })
4704
6136
  ] }) }),
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" })
6137
+ !editLink && hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { css: ObjectSearchAuthorStateGroup, children: [
6138
+ !editLink ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(LinkButton, { text: "Edit", href: editLink, icon: editLinkIcon }),
6139
+ hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_design_system30.Button, { buttonType: "ghostDestructive", onClick: onRemoveItem, children: "Remove" })
4708
6140
  ] })
4709
6141
  ] });
4710
6142
  };
@@ -4714,38 +6146,39 @@ var import_design_system31 = require("@uniformdev/design-system");
4714
6146
  var import_react_beautiful_dnd3 = require("react-beautiful-dnd");
4715
6147
 
4716
6148
  // src/components/ObjectSearch/styles/ObjectSearchResultList.styles.ts
4717
- var import_react47 = require("@emotion/react");
4718
- var ObjectSearchResultListContainer = import_react47.css`
6149
+ var import_react49 = require("@emotion/react");
6150
+ var ObjectSearchResultListContainer = import_react49.css`
4719
6151
  align-items: center;
4720
6152
  display: flex;
4721
6153
  gap: var(--spacing-sm);
4722
6154
  justify-content: space-between;
4723
6155
  `;
4724
- var ObjectSearchDragContainer = import_react47.css`
6156
+ var ObjectSearchDragContainer = import_react49.css`
4725
6157
  margin: 0 0 var(--spacing-sm);
4726
6158
  `;
4727
- var ObjectSearchResultListCounterContainer = import_react47.css`
6159
+ var ObjectSearchResultListCounterContainer = import_react49.css`
4728
6160
  align-items: center;
4729
6161
  display: flex;
4730
6162
  gap: var(--spacing-sm);
4731
6163
  `;
4732
- var ObjectSearchResultListTitle = import_react47.css`
6164
+ var ObjectSearchResultListTitle = import_react49.css`
4733
6165
  font-weight: var(--fw-bold);
4734
6166
  line-height: 1;
4735
6167
  `;
4736
6168
 
4737
6169
  // src/components/ObjectSearch/ObjectSearchResultList.tsx
4738
- var import_jsx_runtime53 = require("@emotion/react/jsx-runtime");
4739
- var ObjectSearchResultList = ({
6170
+ var import_jsx_runtime55 = require("@emotion/react/jsx-runtime");
6171
+ function ObjectSearchResultList({
4740
6172
  resultLabelText = "Selected",
4741
6173
  removeButtonText = "Remove all",
4742
6174
  onRemoveAllSelected,
4743
6175
  hideRemoveButton = false,
4744
6176
  additionalButtons,
4745
- renderResultComponent = (value) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ObjectSearchResultItem, { ...value, disableDnD }),
6177
+ renderResultComponent = (value) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ObjectSearchResultItem, { ...value, disableDnD }),
4746
6178
  multiSelectId,
4747
- disableDnD = false
4748
- }) => {
6179
+ disableDnD = false,
6180
+ whenNothingSelected = null
6181
+ }) {
4749
6182
  const { selectedListItems, onRemoveAllSelectedItems, onSelectItem } = useObjectSearchContext();
4750
6183
  const handleRemoveAllSelectedItems = () => {
4751
6184
  onRemoveAllSelectedItems();
@@ -4761,16 +6194,16 @@ var ObjectSearchResultList = ({
4761
6194
  return result;
4762
6195
  }
4763
6196
  };
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 }),
6197
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
6198
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { role: "group", css: ObjectSearchResultListContainer, children: [
6199
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { role: "note", css: ObjectSearchResultListCounterContainer, children: [
6200
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { css: ObjectSearchResultListTitle, children: resultLabelText }),
4768
6201
  " ",
4769
- !selectedListItems.length ? null : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_design_system31.Counter, { count: selectedListItems.length })
6202
+ !selectedListItems.length ? null : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_design_system31.Counter, { count: selectedListItems.length })
4770
6203
  ] }),
4771
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { css: ObjectSearchResultListCounterContainer, children: [
6204
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { css: ObjectSearchResultListCounterContainer, children: [
4772
6205
  additionalButtons,
4773
- hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
6206
+ hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
4774
6207
  import_design_system31.Button,
4775
6208
  {
4776
6209
  buttonType: "ghostDestructive",
@@ -4782,10 +6215,10 @@ var ObjectSearchResultList = ({
4782
6215
  )
4783
6216
  ] })
4784
6217
  ] }),
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) => {
6218
+ !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: [
6219
+ selectedListItems.map((item, i2) => {
4787
6220
  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)(
6221
+ 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
6222
  "div",
4790
6223
  {
4791
6224
  css: ObjectSearchDragContainer,
@@ -4800,12 +6233,12 @@ var ObjectSearchResultList = ({
4800
6233
  provided.placeholder
4801
6234
  ] }) }) })
4802
6235
  ] });
4803
- };
6236
+ }
4804
6237
 
4805
6238
  // src/components/ObjectSearch/QueryFilter.tsx
4806
6239
  var import_design_system32 = require("@uniformdev/design-system");
4807
- var import_react48 = require("react");
4808
- var import_jsx_runtime54 = require("@emotion/react/jsx-runtime");
6240
+ var import_react50 = require("react");
6241
+ var import_jsx_runtime56 = require("@emotion/react/jsx-runtime");
4809
6242
  var QueryFilter = ({
4810
6243
  requireContentType,
4811
6244
  queryFilterTitle = "Configure Query",
@@ -4814,9 +6247,10 @@ var QueryFilter = ({
4814
6247
  contentTypeOptions,
4815
6248
  searchInputName = "searchText",
4816
6249
  searchInputPlaceholderText = "Enter keyword to narrow your results",
6250
+ searchInputLabel = "Query",
4817
6251
  countLabel = "Count",
4818
6252
  countValue = 5,
4819
- sortLabel = "Sort",
6253
+ sortLabel = "Sort By",
4820
6254
  sortOptions,
4821
6255
  sortOrderLabel = "Sort Order",
4822
6256
  sortOrderOptions = [
@@ -4833,9 +6267,9 @@ var QueryFilter = ({
4833
6267
  ],
4834
6268
  children
4835
6269
  }) => {
4836
- var _a, _b;
6270
+ var _a, _b, _c, _d;
4837
6271
  const { query, onSetQuery } = useObjectSearchContext();
4838
- const [queryState, setQueryState] = (0, import_react48.useState)({
6272
+ const [queryState, setQueryState] = (0, import_react50.useState)({
4839
6273
  contentType: "",
4840
6274
  keyword: "",
4841
6275
  count: countValue != null ? countValue : 5,
@@ -4846,87 +6280,145 @@ var QueryFilter = ({
4846
6280
  setQueryState((prev) => ({ ...prev, ...value }));
4847
6281
  onSetQuery({ ...query, ...value });
4848
6282
  };
4849
- (0, import_react48.useEffect)(() => {
6283
+ (0, import_react50.useEffect)(() => {
4850
6284
  onSetQuery(queryState);
4851
6285
  }, [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,
6286
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("fieldset", { children: [
6287
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { css: ObjectSearchFilterContainerLabel, children: queryFilterTitle }),
6288
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { css: ObjectSearchFilterContainer, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_design_system32.VerticalRhythm, { children: [
6289
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
6290
+ InputVariables,
6291
+ {
6292
+ label: searchInputLabel,
6293
+ value: (_c = queryState.keyword) != null ? _c : "",
6294
+ onChange: (newQuery) => handleFilterChange({ keyword: newQuery }),
6295
+ disableInlineMenu: true,
6296
+ id: "qf_searchText",
6297
+ inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
6298
+ import_design_system32.InputKeywordSearch,
6299
+ {
6300
+ id: "qf_searchText",
6301
+ inputFieldName: searchInputName,
6302
+ placeholder: searchInputPlaceholderText,
6303
+ onSearchTextChanged: (e) => handleFilterChange({ keyword: e }),
6304
+ disabledFieldSubmission: true,
6305
+ onClear: () => handleFilterChange({ keyword: "" }),
6306
+ value: queryState.keyword
6307
+ }
6308
+ )
6309
+ }
6310
+ ),
6311
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { css: ObjectSearchFilterGrid("1fr 100px"), children: [
6312
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
6313
+ InputVariables,
4858
6314
  {
4859
6315
  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
6316
+ id: "qf_contentType",
6317
+ value: (_d = queryState.contentType) != null ? _d : "",
6318
+ onChange: (newType) => handleFilterChange({ contentType: newType }),
6319
+ disableInlineMenu: true,
6320
+ inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
6321
+ import_design_system32.InputSelect,
6322
+ {
6323
+ id: "qf_contentType",
6324
+ label: contentTypeLabel,
6325
+ showLabel: false,
6326
+ options: [
6327
+ ...!requireContentType ? [{ id: "", label: typeSelectorAllTypesOptionText }] : [],
6328
+ ...contentTypeOptions ? contentTypeOptions.map((option) => {
6329
+ var _a2;
6330
+ return { id: option.id, label: (_a2 = option.label) != null ? _a2 : option.name, name: option.name };
6331
+ }) : []
6332
+ ],
6333
+ onChange: (e) => handleFilterChange({ contentType: e.target.value }),
6334
+ value: queryState.contentType
6335
+ }
6336
+ )
4870
6337
  }
4871
6338
  ),
4872
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
4873
- import_design_system32.InputKeywordSearch,
6339
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
6340
+ InputVariables,
4874
6341
  {
4875
- inputFieldName: searchInputName,
4876
- placeholder: searchInputPlaceholderText,
4877
- onSearchTextChanged: (e) => handleFilterChange({ keyword: e }),
4878
- disabledFieldSubmission: true,
4879
- onClear: () => handleFilterChange({ keyword: "" }),
4880
- value: queryState.keyword
6342
+ label: countLabel,
6343
+ id: "qf_count",
6344
+ value: queryState.count.toString(10),
6345
+ onChange: (newCount) => handleFilterChange({ count: newCount }),
6346
+ disableInlineMenu: true,
6347
+ inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
6348
+ import_design_system32.Input,
6349
+ {
6350
+ id: "qf_count",
6351
+ label: countLabel,
6352
+ showLabel: false,
6353
+ type: "number",
6354
+ onChange: (e) => handleFilterChange({ count: e.target.value }),
6355
+ defaultValue: countValue,
6356
+ value: queryState.count
6357
+ }
6358
+ )
4881
6359
  }
4882
6360
  )
4883
6361
  ] }),
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,
6362
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { css: ObjectSearchFilterGrid("2fr 1fr"), children: [
6363
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
6364
+ InputVariables,
4887
6365
  {
6366
+ id: "qf_sortBy",
4888
6367
  label: sortLabel,
4889
- options: [
6368
+ value: queryState.sortBy,
6369
+ onChange: (newSortBy) => handleFilterChange({ sortBy: newSortBy }),
6370
+ disableInlineMenu: true,
6371
+ inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
6372
+ import_design_system32.InputSelect,
4890
6373
  {
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
6374
+ label: sortLabel,
6375
+ id: "qf_sortBy",
6376
+ showLabel: false,
6377
+ options: [
6378
+ {
6379
+ label: "Select a sort",
6380
+ id: ""
6381
+ },
6382
+ ...sortOptions ? sortOptions.map((option) => {
6383
+ var _a2;
6384
+ return { id: option.id, name: option.name, label: (_a2 = option.label) != null ? _a2 : option.name };
6385
+ }) : []
6386
+ ],
6387
+ onChange: (e) => handleFilterChange({ sortBy: e.target.value }),
6388
+ value: queryState.sortBy
6389
+ }
6390
+ )
4901
6391
  }
4902
6392
  ),
4903
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
4904
- import_design_system32.InputSelect,
6393
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
6394
+ InputVariables,
4905
6395
  {
4906
6396
  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
6397
+ id: "qf_sortOrder",
6398
+ value: queryState.sortOrder,
6399
+ onChange: (newSort) => handleFilterChange({ sortOrder: newSort }),
6400
+ disableInlineMenu: true,
6401
+ inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
6402
+ import_design_system32.InputSelect,
6403
+ {
6404
+ label: sortOrderLabel,
6405
+ id: "qf_sortOrder",
6406
+ showLabel: false,
6407
+ options: [
6408
+ ...sortOrderOptions ? sortOrderOptions.map((option) => {
6409
+ var _a2;
6410
+ return { value: option.id, label: (_a2 = option.label) != null ? _a2 : option.name, name: option.name };
6411
+ }) : []
6412
+ ],
6413
+ onChange: (e) => handleFilterChange({ sortOrder: e.target.value }),
6414
+ value: queryState.sortOrder
6415
+ }
6416
+ )
4925
6417
  }
4926
6418
  )
4927
6419
  ] }),
4928
6420
  children
4929
- ] })
6421
+ ] }) })
4930
6422
  ] });
4931
6423
  };
4932
6424
 
@@ -4951,7 +6443,9 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
4951
6443
  Callout,
4952
6444
  DamSelectedItem,
4953
6445
  DataRefreshButton,
6446
+ DataResourceDynamicInputProvider,
4954
6447
  DataResourceVariablesList,
6448
+ DataResourceVariablesListExplicit,
4955
6449
  DataSourceEditor,
4956
6450
  DataTypeEditor,
4957
6451
  DefaultSearchRow,
@@ -5098,5 +6592,9 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
5098
6592
  useRequestParameter,
5099
6593
  useUniformMeshSdk,
5100
6594
  useVariables,
5101
- variablesToList
6595
+ variableExpression,
6596
+ variablePrefix,
6597
+ variableSuffix,
6598
+ variablesToList,
6599
+ ...require("@uniformdev/mesh-sdk")
5102
6600
  });