@uniformdev/mesh-sdk-react 18.35.1-alpha.12 → 18.35.1-alpha.26

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
@@ -2900,9 +2900,35 @@ function useMeshLocation(expectedLocation) {
2900
2900
  var import_design_system16 = require("@uniformdev/design-system");
2901
2901
  var React11 = __toESM(require("react"));
2902
2902
 
2903
+ // src/components/Variables/insertVariableIntoText.ts
2904
+ function insertVariableIntoText({
2905
+ variableName: variableName2,
2906
+ variablePrefix,
2907
+ variableSuffix = "",
2908
+ value,
2909
+ selectionStart = null,
2910
+ selectionEnd = null
2911
+ }) {
2912
+ const variableExpression = `${variablePrefix}${variableName2}${variableSuffix}`;
2913
+ if (selectionStart !== null && selectionEnd !== null && selectionStart !== selectionEnd) {
2914
+ return `${value.substring(0, selectionStart)}${variableExpression}${value.substring(selectionEnd)}`;
2915
+ }
2916
+ const hasCursorPosition = selectionStart !== null;
2917
+ let startOffset = 0;
2918
+ if (hasCursorPosition && value.substring(selectionStart - variablePrefix.length, selectionStart) === variablePrefix) {
2919
+ startOffset = variablePrefix.length;
2920
+ }
2921
+ if (hasCursorPosition) {
2922
+ return `${value.substring(0, selectionStart - startOffset)}${variableExpression}${value.substring(
2923
+ selectionStart
2924
+ )}`;
2925
+ }
2926
+ return `${value}${variableExpression}`;
2927
+ }
2928
+
2903
2929
  // src/components/Variables/InsertVariableMenu.tsx
2904
2930
  var import_design_system15 = require("@uniformdev/design-system");
2905
- var import_react30 = require("react");
2931
+ var import_react31 = require("react");
2906
2932
 
2907
2933
  // src/components/Variables/styles/InsertVariableMenu.styles.ts
2908
2934
  var import_react28 = require("@emotion/react");
@@ -2932,7 +2958,11 @@ var variablesTipText = import_react28.css`
2932
2958
  padding: 0 var(--spacing-sm);
2933
2959
  `;
2934
2960
 
2961
+ // src/components/Variables/useOnVariableUpdated.ts
2962
+ var import_react30 = require("react");
2963
+
2935
2964
  // src/components/Variables/VariablesProvider.tsx
2965
+ var import_mitt = __toESM(require("mitt"));
2936
2966
  var React10 = __toESM(require("react"));
2937
2967
 
2938
2968
  // src/components/Variables/VariableEditor.tsx
@@ -3017,6 +3047,7 @@ function VariablesProvider({
3017
3047
  children
3018
3048
  }) {
3019
3049
  const [editing, setEditing] = React10.useState();
3050
+ const events = React10.useMemo(() => (0, import_mitt.default)(), []);
3020
3051
  const Editor = editVariableComponent != null ? editVariableComponent : VariableEditor;
3021
3052
  const contextValue = {
3022
3053
  dispatch: (event) => {
@@ -3038,7 +3069,9 @@ function VariablesProvider({
3038
3069
  throw new Error(`Unknown event ${JSON.stringify(event)}`);
3039
3070
  }
3040
3071
  },
3041
- variables: value
3072
+ variables: value,
3073
+ isEditing: typeof editing !== "undefined",
3074
+ events
3042
3075
  };
3043
3076
  return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(VariablesContext.Provider, { value: contextValue, children: [
3044
3077
  children,
@@ -3049,6 +3082,7 @@ function VariablesProvider({
3049
3082
  setEditing(void 0);
3050
3083
  const { name, ...varValue } = val;
3051
3084
  onChange({ ...value, [name]: varValue });
3085
+ events.emit("update", name);
3052
3086
  },
3053
3087
  onCancel: () => setEditing(void 0),
3054
3088
  variable: editing
@@ -3064,51 +3098,106 @@ function useVariables() {
3064
3098
  return context;
3065
3099
  }
3066
3100
 
3101
+ // src/components/Variables/useOnVariableUpdated.ts
3102
+ function useOnVariableUpdated(fn, disabled) {
3103
+ const { variables, events } = useVariables();
3104
+ (0, import_react30.useEffect)(() => {
3105
+ if (disabled) {
3106
+ return;
3107
+ }
3108
+ events.on("update", fn);
3109
+ return () => events.off("update", fn);
3110
+ }, [disabled, events, fn, variables]);
3111
+ }
3112
+
3113
+ // src/components/Variables/variablesToList.ts
3114
+ function variablesToList(variables) {
3115
+ return Object.entries(variables || {}).sort(([aKey, a], [bKey, b]) => {
3116
+ var _a, _b;
3117
+ if (a.order && b.order) {
3118
+ return a.order - b.order;
3119
+ } else if (a.order) {
3120
+ return 1;
3121
+ } else if (b.order) {
3122
+ return -1;
3123
+ }
3124
+ return ((_a = a.displayName) != null ? _a : aKey).localeCompare((_b = b.displayName) != null ? _b : bKey);
3125
+ }).map(([name, definition]) => ({
3126
+ name,
3127
+ ...definition
3128
+ }));
3129
+ }
3130
+
3067
3131
  // src/components/Variables/InsertVariableMenu.tsx
3068
3132
  var import_jsx_runtime30 = require("@emotion/react/jsx-runtime");
3069
3133
  var InsertVariableMenu = ({
3070
- onVariableClick,
3134
+ onSelectVariable,
3071
3135
  children,
3072
3136
  textValue,
3073
3137
  trigger = "${",
3074
- showAddVariableMenuOption = false
3138
+ showAddVariableMenuOption = false,
3139
+ disabled = false,
3140
+ forceVisible
3075
3141
  }) => {
3076
- const { variables, dispatch } = useVariables();
3077
- const btnRef = (0, import_react30.useRef)(null);
3078
- const tip = "Tip: access this list by typing ${";
3079
- (0, import_react30.useEffect)(() => {
3142
+ const { variables, dispatch, isEditing } = useVariables();
3143
+ const btnRef = (0, import_react31.useRef)(null);
3144
+ const tip = `Tip: access this list by typing ${trigger}`;
3145
+ (0, import_react31.useEffect)(() => {
3080
3146
  if (textValue === trigger && btnRef.current && btnRef.current.getAttribute("aria-expanded") === "false") {
3081
3147
  btnRef.current.click();
3082
3148
  }
3083
3149
  }, [textValue, btnRef, trigger]);
3150
+ const [openedAdd, setOpenedAdd] = (0, import_react31.useState)(false);
3151
+ useOnVariableUpdated((varName) => {
3152
+ onSelectVariable == null ? void 0 : onSelectVariable({ name: varName, default: "" });
3153
+ }, !openedAdd);
3154
+ (0, import_react31.useEffect)(() => {
3155
+ if (openedAdd && !isEditing) {
3156
+ setOpenedAdd(false);
3157
+ }
3158
+ }, [isEditing, openedAdd]);
3159
+ if (disabled) {
3160
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_jsx_runtime30.Fragment, { children });
3161
+ }
3162
+ const variablesList = variablesToList(variables);
3084
3163
  return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { css: menuContainer, children: [
3085
3164
  children,
3086
3165
  /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
3087
3166
  import_design_system15.Menu,
3088
3167
  {
3089
3168
  placement: "bottom-start",
3169
+ forceVisible,
3090
3170
  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" }) }),
3091
3171
  menuLabel: "Insert variable",
3092
3172
  children: [
3093
- Object.entries(variables).map(([key, value]) => {
3094
- const { helpText } = value;
3173
+ variablesList.map((variable) => {
3174
+ const { name, helpText } = variable;
3095
3175
  return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
3096
3176
  import_design_system15.MenuItem,
3097
3177
  {
3098
- id: key,
3178
+ id: name,
3099
3179
  css: menuItemTextGroup,
3100
- onClick: () => onVariableClick(decodeURI(`\${${key}}`)),
3180
+ onClick: () => onSelectVariable == null ? void 0 : onSelectVariable(variable),
3101
3181
  children: [
3102
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: key }),
3182
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: name }),
3103
3183
  helpText ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("small", { css: smallText, children: helpText }) : null
3104
3184
  ]
3105
3185
  },
3106
- key
3186
+ name
3107
3187
  );
3108
3188
  }),
3109
3189
  showAddVariableMenuOption ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
3110
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_design_system15.MenuItemSeparator, {}),
3111
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_design_system15.MenuItem, { onClick: () => dispatch({ type: "edit", variable: "" }), children: "Add Variable" })
3190
+ variablesList.length ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_design_system15.MenuItemSeparator, {}) : null,
3191
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3192
+ import_design_system15.MenuItem,
3193
+ {
3194
+ onClick: () => {
3195
+ setOpenedAdd(true);
3196
+ dispatch({ type: "edit", variable: "" });
3197
+ },
3198
+ children: "Add Variable"
3199
+ }
3200
+ )
3112
3201
  ] }) : null,
3113
3202
  Object.entries(variables).length || showAddVariableMenuOption ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_design_system15.MenuItemSeparator, {}) : null,
3114
3203
  /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("i", { css: variablesTipText, children: tip })
@@ -3123,13 +3212,15 @@ var import_jsx_runtime31 = require("@emotion/react/jsx-runtime");
3123
3212
  function InputVariables({
3124
3213
  "aria-label": ariaLabel,
3125
3214
  value,
3126
- // disableVariables,
3215
+ disableVariables,
3127
3216
  onChange,
3128
3217
  onPaste,
3129
- onVariableClick,
3130
3218
  showAddVariableMenuOption,
3219
+ variablePrefix = "${",
3220
+ variableSuffix = "}",
3131
3221
  ...inputProps
3132
3222
  }) {
3223
+ var _a, _b;
3133
3224
  const { variables, dispatch } = useVariables();
3134
3225
  const currentVariables = React11.useRef(variables);
3135
3226
  const currentDispatch = React11.useRef(dispatch);
@@ -3144,21 +3235,40 @@ function InputVariables({
3144
3235
  React11.useEffect(() => {
3145
3236
  currentSetValue.current = onChange;
3146
3237
  }, [onChange]);
3147
- React11.useEffect(() => {
3148
- var _a, _b;
3149
- if (((_a = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _a.value) && onPaste) {
3150
- onPaste((_b = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _b.value);
3151
- }
3152
- });
3238
+ const onPasteHandler = () => {
3239
+ setTimeout(() => {
3240
+ if (!inputRef.current) {
3241
+ return;
3242
+ }
3243
+ onPaste == null ? void 0 : onPaste(inputRef.current.value);
3244
+ });
3245
+ };
3246
+ const handleInsertVariable = (variable) => {
3247
+ var _a2, _b2;
3248
+ handleSetValue(
3249
+ insertVariableIntoText({
3250
+ variableName: variable.name,
3251
+ value,
3252
+ variablePrefix,
3253
+ variableSuffix,
3254
+ selectionEnd: (_a2 = inputRef.current) == null ? void 0 : _a2.selectionEnd,
3255
+ selectionStart: (_b2 = inputRef.current) == null ? void 0 : _b2.selectionStart
3256
+ })
3257
+ );
3258
+ };
3153
3259
  const handleSetValue = (rawValue) => {
3154
3260
  currentSetValue.current(rawValue);
3155
3261
  };
3262
+ const currentCursor = (_b = (_a = inputRef.current) == null ? void 0 : _a.selectionStart) != null ? _b : value.length;
3263
+ const forceMenu = value.substring(currentCursor - 2, currentCursor) === "${";
3156
3264
  return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3157
3265
  InsertVariableMenu,
3158
3266
  {
3159
3267
  showAddVariableMenuOption,
3160
3268
  textValue: value,
3161
- onVariableClick,
3269
+ onSelectVariable: handleInsertVariable,
3270
+ disabled: disableVariables,
3271
+ forceVisible: forceMenu || void 0,
3162
3272
  children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3163
3273
  import_design_system16.Input,
3164
3274
  {
@@ -3167,6 +3277,7 @@ function InputVariables({
3167
3277
  showLabel: false,
3168
3278
  value,
3169
3279
  onChange: (e) => handleSetValue(e.currentTarget.value),
3280
+ onPaste: onPasteHandler,
3170
3281
  ...inputProps
3171
3282
  }
3172
3283
  )
@@ -3175,13 +3286,13 @@ function InputVariables({
3175
3286
  }
3176
3287
 
3177
3288
  // src/components/Variables/VariablesList.tsx
3178
- var import_react32 = require("@emotion/react");
3289
+ var import_react33 = require("@emotion/react");
3179
3290
  var import_design_system17 = require("@uniformdev/design-system");
3180
3291
  var import_react_beautiful_dnd2 = require("react-beautiful-dnd");
3181
3292
 
3182
3293
  // src/components/Variables/styles/VariablesList.styles.ts
3183
- var import_react31 = require("@emotion/react");
3184
- var tableRow = (isDragging) => import_react31.css`
3294
+ var import_react32 = require("@emotion/react");
3295
+ var tableRow = (isDragging) => import_react32.css`
3185
3296
  position: relative;
3186
3297
  ${isDragging ? `
3187
3298
  display: table;
@@ -3189,7 +3300,7 @@ var tableRow = (isDragging) => import_react31.css`
3189
3300
  top: auto !important;
3190
3301
  ` : void 0}
3191
3302
  `;
3192
- var tableCellDragIcon = import_react31.css`
3303
+ var tableCellDragIcon = import_react32.css`
3193
3304
  &::after {
3194
3305
  content: '';
3195
3306
  display: block;
@@ -3207,7 +3318,7 @@ var tableCellDragIcon = import_react31.css`
3207
3318
  opacity: 1;
3208
3319
  }
3209
3320
  `;
3210
- var variableName = import_react31.css`
3321
+ var variableName = import_react32.css`
3211
3322
  border: none;
3212
3323
  color: var(--brand-secondary-5);
3213
3324
  font-weight: var(--fw-medium);
@@ -3218,31 +3329,13 @@ var variableName = import_react31.css`
3218
3329
  white-space: nowrap;
3219
3330
  max-width: 20ch;
3220
3331
  `;
3221
- var variableValue = import_react31.css`
3332
+ var variableValue = import_react32.css`
3222
3333
  overflow: hidden;
3223
3334
  text-overflow: ellipsis;
3224
3335
  white-space: nowrap;
3225
3336
  max-width: 20ch;
3226
3337
  `;
3227
3338
 
3228
- // src/components/Variables/variablesToList.ts
3229
- function variablesToList(variables) {
3230
- return Object.entries(variables || {}).sort(([aKey, a], [bKey, b]) => {
3231
- var _a, _b;
3232
- if (a.order && b.order) {
3233
- return a.order - b.order;
3234
- } else if (a.order) {
3235
- return 1;
3236
- } else if (b.order) {
3237
- return -1;
3238
- }
3239
- return ((_a = a.displayName) != null ? _a : aKey).localeCompare((_b = b.displayName) != null ? _b : bKey);
3240
- }).map(([name, definition]) => ({
3241
- name,
3242
- ...definition
3243
- }));
3244
- }
3245
-
3246
3339
  // src/components/Variables/VariablesList.tsx
3247
3340
  var import_jsx_runtime32 = require("@emotion/react/jsx-runtime");
3248
3341
  function VariablesList() {
@@ -3312,7 +3405,7 @@ function VariablesList() {
3312
3405
  title: `delete ${text}`,
3313
3406
  css: [
3314
3407
  import_design_system17.button,
3315
- import_react32.css`
3408
+ import_react33.css`
3316
3409
  background: transparent;
3317
3410
  `
3318
3411
  ],
@@ -3407,9 +3500,9 @@ function TextVariableRenderer({ definition, value, setValue }) {
3407
3500
  }
3408
3501
 
3409
3502
  // src/components/Request/RequestBody.tsx
3410
- var import_react34 = require("@emotion/react");
3503
+ var import_react35 = require("@emotion/react");
3411
3504
  var import_design_system19 = require("@uniformdev/design-system");
3412
- var import_react35 = require("react");
3505
+ var import_react36 = require("react");
3413
3506
 
3414
3507
  // src/components/Request/RequestProvider.tsx
3415
3508
  var React12 = __toESM(require("react"));
@@ -3493,11 +3586,11 @@ function useRequest() {
3493
3586
  }
3494
3587
 
3495
3588
  // src/components/Request/styles/Request.styles.ts
3496
- var import_react33 = require("@emotion/react");
3497
- var innerContentStyles = import_react33.css`
3589
+ var import_react34 = require("@emotion/react");
3590
+ var innerContentStyles = import_react34.css`
3498
3591
  background: var(--white);
3499
3592
  `;
3500
- var requestTypeContainer = (bgColor) => import_react33.css`
3593
+ var requestTypeContainer = (bgColor) => import_react34.css`
3501
3594
  align-items: start;
3502
3595
  background: ${bgColor};
3503
3596
  display: grid;
@@ -3535,11 +3628,11 @@ var LANGUAGE_TO_CONTENT_TYPE = {
3535
3628
  };
3536
3629
  function RequestBody() {
3537
3630
  const { request, dispatch } = useRequest();
3538
- const [language, setLanguage] = (0, import_react35.useState)("json");
3631
+ const [language, setLanguage] = (0, import_react36.useState)("json");
3539
3632
  return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
3540
3633
  "div",
3541
3634
  {
3542
- css: import_react34.css`
3635
+ css: import_react35.css`
3543
3636
  background: var(--white);
3544
3637
  `,
3545
3638
  children: [
@@ -3547,7 +3640,7 @@ function RequestBody() {
3547
3640
  RequestTypeContainer,
3548
3641
  {
3549
3642
  bgColor: "var(--gray-100)",
3550
- css: import_react34.css`
3643
+ css: import_react35.css`
3551
3644
  padding: var(--spacing-sm) var(--spacing-base);
3552
3645
  `,
3553
3646
  children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
@@ -3654,7 +3747,8 @@ function RequestHeaders({ disableVariables }) {
3654
3747
  {
3655
3748
  value: header.value,
3656
3749
  onChange: (value) => handleUpdateParamFromMenu({ key: header.key, value, index }),
3657
- onVariableClick: (value) => handleUpdateParamFromMenu({ key: header.key, value, index }),
3750
+ disableVariables,
3751
+ showAddVariableMenuOption: true,
3658
3752
  "data-test-id": "header-value"
3659
3753
  }
3660
3754
  ) : null })
@@ -3753,12 +3847,9 @@ function RequestParameters({ disableVariables }) {
3753
3847
  value: selectedVariable,
3754
3848
  index
3755
3849
  }),
3756
- onVariableClick: (selectedVariable) => handleUpdateParamFromMenu({
3757
- key: parameter.key,
3758
- value: selectedVariable,
3759
- index
3760
- }),
3761
- "data-test-id": "parameter-value"
3850
+ disableVariables,
3851
+ "data-test-id": "parameter-value",
3852
+ showAddVariableMenuOption: true
3762
3853
  }
3763
3854
  ) : null })
3764
3855
  ] }, index);
@@ -3768,8 +3859,8 @@ function RequestParameters({ disableVariables }) {
3768
3859
  }
3769
3860
 
3770
3861
  // src/components/Request/RequestUrl.tsx
3771
- var import_react36 = require("@emotion/react");
3772
- var import_react37 = require("react");
3862
+ var import_react37 = require("@emotion/react");
3863
+ var import_react38 = require("react");
3773
3864
 
3774
3865
  // src/components/Request/urlEncodeRequestParameter.ts
3775
3866
  function urlEncodeRequestUrl(url, varValues) {
@@ -3795,7 +3886,7 @@ function RequestUrl() {
3795
3886
  var _a, _b;
3796
3887
  const { variables } = useVariables();
3797
3888
  const { request } = useRequest();
3798
- const mergedParameters = (0, import_react37.useMemo)(() => {
3889
+ const mergedParameters = (0, import_react38.useMemo)(() => {
3799
3890
  var _a2;
3800
3891
  if (!((_a2 = request.baseRequest) == null ? void 0 : _a2.parameters)) {
3801
3892
  return request.parameters;
@@ -3805,7 +3896,7 @@ function RequestUrl() {
3805
3896
  return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
3806
3897
  "small",
3807
3898
  {
3808
- css: import_react36.css`
3899
+ css: import_react37.css`
3809
3900
  display: inline-block;
3810
3901
  margin-bottom: var(--spacing-xs);
3811
3902
  word-break: break-word;
@@ -3865,9 +3956,6 @@ function RequestUrlInput(props) {
3865
3956
  onChange: (value) => {
3866
3957
  dispatch({ type: "setRelativeUrl", relativeUrl: value });
3867
3958
  },
3868
- onVariableClick: (selectedValue) => {
3869
- dispatch({ type: "setRelativeUrl", relativeUrl: request.relativeUrl.concat(selectedValue) });
3870
- },
3871
3959
  showAddVariableMenuOption: true
3872
3960
  }
3873
3961
  );
@@ -4020,12 +4108,12 @@ var import_design_system23 = require("@uniformdev/design-system");
4020
4108
 
4021
4109
  // src/hooks/useInitializeUniformMeshSdk.ts
4022
4110
  var import_mesh_sdk = require("@uniformdev/mesh-sdk");
4023
- var import_react38 = require("react");
4111
+ var import_react39 = require("react");
4024
4112
  var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
4025
- const [error, setError] = (0, import_react38.useState)();
4026
- const [sdk, setSdk] = (0, import_react38.useState)();
4027
- const initializationInProgress = (0, import_react38.useRef)(false);
4028
- (0, import_react38.useEffect)(
4113
+ const [error, setError] = (0, import_react39.useState)();
4114
+ const [sdk, setSdk] = (0, import_react39.useState)();
4115
+ const initializationInProgress = (0, import_react39.useRef)(false);
4116
+ (0, import_react39.useEffect)(
4029
4117
  () => {
4030
4118
  if (typeof window === "undefined" || sdk) {
4031
4119
  return;
@@ -4083,7 +4171,7 @@ var MeshApp = ({
4083
4171
  };
4084
4172
 
4085
4173
  // src/components/ObjectSearch/DataRefreshButton.tsx
4086
- var import_react39 = require("@emotion/react");
4174
+ var import_react40 = require("@emotion/react");
4087
4175
  var import_design_system24 = require("@uniformdev/design-system");
4088
4176
  var import_jsx_runtime45 = require("@emotion/react/jsx-runtime");
4089
4177
  var DataRefreshButton = ({
@@ -4096,7 +4184,7 @@ var DataRefreshButton = ({
4096
4184
  !isLoading ? null : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
4097
4185
  import_design_system24.LoadingIndicator,
4098
4186
  {
4099
- css: import_react39.css`
4187
+ css: import_react40.css`
4100
4188
  ${isLoading ? "opacity: 0.2;" : void 0}
4101
4189
  `
4102
4190
  }
@@ -4124,12 +4212,12 @@ var ObjectSearchContainer = ({
4124
4212
 
4125
4213
  // src/components/ObjectSearch/ObjectSearchFilter.tsx
4126
4214
  var import_design_system26 = require("@uniformdev/design-system");
4127
- var import_react42 = require("react");
4215
+ var import_react43 = require("react");
4128
4216
 
4129
4217
  // src/components/ObjectSearch/hooks/ObjectSearchContext.tsx
4130
- var import_react40 = require("react");
4218
+ var import_react41 = require("react");
4131
4219
  var import_jsx_runtime47 = require("@emotion/react/jsx-runtime");
4132
- var ObjectSearchContext = (0, import_react40.createContext)({
4220
+ var ObjectSearchContext = (0, import_react41.createContext)({
4133
4221
  onSetQuery: () => {
4134
4222
  },
4135
4223
  onSelectItem: () => {
@@ -4146,14 +4234,14 @@ var ObjectSearchContext = (0, import_react40.createContext)({
4146
4234
  }
4147
4235
  });
4148
4236
  var ObjectSearchProvider = ({ currentlySelectedItems, children }) => {
4149
- const [query, setQuery] = (0, import_react40.useState)({
4237
+ const [query, setQuery] = (0, import_react41.useState)({
4150
4238
  contentType: "",
4151
4239
  keyword: ""
4152
4240
  });
4153
- const querySearchDeferred = (0, import_react40.useDeferredValue)(query);
4154
- const [selectedItems, setSelectedItems] = (0, import_react40.useState)(currentlySelectedItems != null ? currentlySelectedItems : []);
4155
- const [list, setList] = (0, import_react40.useState)({});
4156
- const onSetQuery = (0, import_react40.useCallback)(
4241
+ const querySearchDeferred = (0, import_react41.useDeferredValue)(query);
4242
+ const [selectedItems, setSelectedItems] = (0, import_react41.useState)(currentlySelectedItems != null ? currentlySelectedItems : []);
4243
+ const [list, setList] = (0, import_react41.useState)({});
4244
+ const onSetQuery = (0, import_react41.useCallback)(
4157
4245
  (value) => {
4158
4246
  if (Array.isArray(value.contentType) && value.contentType.length > 0) {
4159
4247
  return setQuery({
@@ -4165,7 +4253,7 @@ var ObjectSearchProvider = ({ currentlySelectedItems, children }) => {
4165
4253
  },
4166
4254
  [setQuery]
4167
4255
  );
4168
- const onSelectItem = (0, import_react40.useCallback)(
4256
+ const onSelectItem = (0, import_react41.useCallback)(
4169
4257
  (selectedResult) => {
4170
4258
  if (Array.isArray(selectedResult)) {
4171
4259
  setSelectedItems(selectedResult);
@@ -4179,10 +4267,10 @@ var ObjectSearchProvider = ({ currentlySelectedItems, children }) => {
4179
4267
  },
4180
4268
  [setSelectedItems, selectedItems]
4181
4269
  );
4182
- const onRemoveAllSelectedItems = (0, import_react40.useCallback)(() => {
4270
+ const onRemoveAllSelectedItems = (0, import_react41.useCallback)(() => {
4183
4271
  setSelectedItems([]);
4184
4272
  }, [setSelectedItems]);
4185
- const onSetList = (0, import_react40.useCallback)(
4273
+ const onSetList = (0, import_react41.useCallback)(
4186
4274
  (value) => {
4187
4275
  setList(value);
4188
4276
  },
@@ -4205,13 +4293,13 @@ var ObjectSearchProvider = ({ currentlySelectedItems, children }) => {
4205
4293
  );
4206
4294
  };
4207
4295
  var useObjectSearchContext = () => {
4208
- const contextValues = (0, import_react40.useContext)(ObjectSearchContext);
4296
+ const contextValues = (0, import_react41.useContext)(ObjectSearchContext);
4209
4297
  return { ...contextValues };
4210
4298
  };
4211
4299
 
4212
4300
  // src/components/ObjectSearch/styles/ObjectSearchFilterContainer.styles.ts
4213
- var import_react41 = require("@emotion/react");
4214
- var ObjectSearchFilterContainerLabel = import_react41.css`
4301
+ var import_react42 = require("@emotion/react");
4302
+ var ObjectSearchFilterContainerLabel = import_react42.css`
4215
4303
  align-items: center;
4216
4304
  display: flex;
4217
4305
  font-size: var(--fs-sm);
@@ -4219,14 +4307,14 @@ var ObjectSearchFilterContainerLabel = import_react41.css`
4219
4307
  line-height: 1rem;
4220
4308
  margin-bottom: var(--spacing-sm);
4221
4309
  `;
4222
- var ObjectSearchFilterContainer = import_react41.css`
4310
+ var ObjectSearchFilterContainer = import_react42.css`
4223
4311
  display: grid;
4224
4312
  gap: var(--spacing-base);
4225
4313
  `;
4226
- var ObjectSearchFilterDropdownAndTextSearch = import_react41.css`
4314
+ var ObjectSearchFilterDropdownAndTextSearch = import_react42.css`
4227
4315
  grid-template-columns: 0.5fr 1fr;
4228
4316
  `;
4229
- var ObjectSearchFilterGrid = (gridColumns) => import_react41.css`
4317
+ var ObjectSearchFilterGrid = (gridColumns) => import_react42.css`
4230
4318
  display: grid;
4231
4319
  grid-template-columns: ${gridColumns};
4232
4320
  gap: var(--spacing-base);
@@ -4243,7 +4331,7 @@ var ObjectSearchFilter = ({
4243
4331
  selectOptions
4244
4332
  }) => {
4245
4333
  const { query, onSetQuery } = useObjectSearchContext();
4246
- const [searchState, setSearchState] = (0, import_react42.useState)({
4334
+ const [searchState, setSearchState] = (0, import_react43.useState)({
4247
4335
  contentType: "",
4248
4336
  keyword: ""
4249
4337
  });
@@ -4297,9 +4385,9 @@ var ObjectSearchFilterContainer2 = ({ label, children }) => {
4297
4385
  var import_design_system28 = require("@uniformdev/design-system");
4298
4386
 
4299
4387
  // src/components/ObjectSearch/styles/ObjectSearchListItem.styles.ts
4300
- var import_react43 = require("@emotion/react");
4388
+ var import_react44 = require("@emotion/react");
4301
4389
  var import_design_system27 = require("@uniformdev/design-system");
4302
- var ObjectListItemContainer = import_react43.css`
4390
+ var ObjectListItemContainer = import_react44.css`
4303
4391
  align-items: center;
4304
4392
  border: 1px solid var(--gray-300);
4305
4393
  border-radius: var(--rounded-base);
@@ -4312,7 +4400,7 @@ var ObjectListItemContainer = import_react43.css`
4312
4400
  display: none;
4313
4401
  }
4314
4402
  `;
4315
- var ObjectListItemLoading = import_react43.css`
4403
+ var ObjectListItemLoading = import_react44.css`
4316
4404
  animation: ${import_design_system27.skeletonLoading} 1s linear infinite alternate;
4317
4405
  border-color: transparent;
4318
4406
  min-height: 42px;
@@ -4336,31 +4424,31 @@ var ObjectListItemLoading = import_react43.css`
4336
4424
  width: 1rem;
4337
4425
  }
4338
4426
  `;
4339
- var ObjectListItemHeadingGroup = import_react43.css`
4427
+ var ObjectListItemHeadingGroup = import_react44.css`
4340
4428
  align-items: center;
4341
4429
  display: grid;
4342
4430
  `;
4343
- var ObjectListItemTitle = import_react43.css`
4431
+ var ObjectListItemTitle = import_react44.css`
4344
4432
  color: var(--brand-secondary-1);
4345
4433
  display: block;
4346
4434
  font-size: var(--fs-sm);
4347
4435
  `;
4348
- var ObjectListItemSubtitle = import_react43.css`
4436
+ var ObjectListItemSubtitle = import_react44.css`
4349
4437
  color: var(--gray-500);
4350
4438
  display: block;
4351
4439
  font-size: var(--fs-xs);
4352
4440
  line-height: 1;
4353
4441
  `;
4354
- var ObjectListItemInfoContainer = import_react43.css`
4442
+ var ObjectListItemInfoContainer = import_react44.css`
4355
4443
  align-items: center;
4356
4444
  display: flex;
4357
4445
  justify-content: center;
4358
4446
  `;
4359
- var ObjectListItemControlledContent = import_react43.css`
4447
+ var ObjectListItemControlledContent = import_react44.css`
4360
4448
  display: flex;
4361
4449
  gap: var(--spacing-sm);
4362
4450
  `;
4363
- var ObjectListItemUnControlledContent = import_react43.css`
4451
+ var ObjectListItemUnControlledContent = import_react44.css`
4364
4452
  margin-top: var(--spacing-sm);
4365
4453
  grid-column: 1 / -1;
4366
4454
  `;
@@ -4411,9 +4499,9 @@ var import_design_system30 = require("@uniformdev/design-system");
4411
4499
  var import_timeago3 = require("timeago.js");
4412
4500
 
4413
4501
  // src/components/ObjectSearch/styles/ObjectSearchResultItemButton.styles.ts
4414
- var import_react44 = require("@emotion/react");
4502
+ var import_react45 = require("@emotion/react");
4415
4503
  var import_design_system29 = require("@uniformdev/design-system");
4416
- var ButtonStyles = import_react44.css`
4504
+ var ButtonStyles = import_react45.css`
4417
4505
  ${import_design_system29.button}
4418
4506
  background: transparent;
4419
4507
  border: 1px solid var(--brand-secondary-1);
@@ -4440,7 +4528,7 @@ var ButtonStyles = import_react44.css`
4440
4528
  text-decoration: none;
4441
4529
  }
4442
4530
  `;
4443
- var ButtonIcon = import_react44.css`
4531
+ var ButtonIcon = import_react45.css`
4444
4532
  width: 1rem;
4445
4533
  height: 1rem;
4446
4534
  `;
@@ -4469,8 +4557,8 @@ var LinkButton = ({
4469
4557
  };
4470
4558
 
4471
4559
  // src/components/ObjectSearch/styles/ObjectSearchResultItem.styles.ts
4472
- var import_react45 = require("@emotion/react");
4473
- var ObjectSearchResultItemContainer = import_react45.css`
4560
+ var import_react46 = require("@emotion/react");
4561
+ var ObjectSearchResultItemContainer = import_react46.css`
4474
4562
  align-items: center;
4475
4563
  border: 1px solid var(--gray-300);
4476
4564
  border-radius: var(--rounded-base);
@@ -4486,7 +4574,7 @@ var ObjectSearchResultItemContainer = import_react45.css`
4486
4574
  }
4487
4575
  }
4488
4576
  `;
4489
- var ObjectSearchDragHandle = import_react45.css`
4577
+ var ObjectSearchDragHandle = import_react46.css`
4490
4578
  border-left: 2px dotted var(--gray-300);
4491
4579
  border-right: 2px dotted var(--gray-300);
4492
4580
  position: absolute;
@@ -4495,35 +4583,35 @@ var ObjectSearchDragHandle = import_react45.css`
4495
4583
  transition: opacity var(--duration-fast) var(--timing-ease-out);
4496
4584
  opacity: 0;
4497
4585
  `;
4498
- var ObjectSearchResultItemSubtitle = import_react45.css`
4586
+ var ObjectSearchResultItemSubtitle = import_react46.css`
4499
4587
  color: var(--gray-500);
4500
4588
  display: block;
4501
4589
  font-size: var(--fs-xs);
4502
4590
  line-height: 1;
4503
4591
  `;
4504
- var ObjectSearchResultItemTitle = import_react45.css`
4592
+ var ObjectSearchResultItemTitle = import_react46.css`
4505
4593
  align-items: center;
4506
4594
  color: var(--brand-secondary-1);
4507
4595
  display: flex;
4508
4596
  gap: var(--spacing-xs);
4509
4597
  `;
4510
- var ObjectSearchResultItemTimeStamp = import_react45.css`
4598
+ var ObjectSearchResultItemTimeStamp = import_react46.css`
4511
4599
  color: var(--gray-500);
4512
4600
  font-size: var(--fs-xs);
4513
4601
  `;
4514
- var ObjectSearchAuthorStateGroup = import_react45.css`
4602
+ var ObjectSearchAuthorStateGroup = import_react46.css`
4515
4603
  align-items: center;
4516
4604
  display: flex;
4517
4605
  gap: var(--spacing-sm);
4518
4606
  `;
4519
- var ObjectSearchUpdateGroup = import_react45.css`
4607
+ var ObjectSearchUpdateGroup = import_react46.css`
4520
4608
  display: grid;
4521
4609
  `;
4522
- var ObjectSearchContentContainer = import_react45.css`
4610
+ var ObjectSearchContentContainer = import_react46.css`
4523
4611
  display: flex;
4524
4612
  gap: var(--spacing-base);
4525
4613
  `;
4526
- var ObjectSearchImage = import_react45.css`
4614
+ var ObjectSearchImage = import_react46.css`
4527
4615
  width: 56px;
4528
4616
  object-fit: contain;
4529
4617
  `;
@@ -4591,22 +4679,22 @@ var import_design_system31 = require("@uniformdev/design-system");
4591
4679
  var import_react_beautiful_dnd3 = require("react-beautiful-dnd");
4592
4680
 
4593
4681
  // src/components/ObjectSearch/styles/ObjectSearchResultList.styles.ts
4594
- var import_react46 = require("@emotion/react");
4595
- var ObjectSearchResultListContainer = import_react46.css`
4682
+ var import_react47 = require("@emotion/react");
4683
+ var ObjectSearchResultListContainer = import_react47.css`
4596
4684
  align-items: center;
4597
4685
  display: flex;
4598
4686
  gap: var(--spacing-sm);
4599
4687
  justify-content: space-between;
4600
4688
  `;
4601
- var ObjectSearchDragContainer = import_react46.css`
4689
+ var ObjectSearchDragContainer = import_react47.css`
4602
4690
  margin: 0 0 var(--spacing-sm);
4603
4691
  `;
4604
- var ObjectSearchResultListCounterContainer = import_react46.css`
4692
+ var ObjectSearchResultListCounterContainer = import_react47.css`
4605
4693
  align-items: center;
4606
4694
  display: flex;
4607
4695
  gap: var(--spacing-sm);
4608
4696
  `;
4609
- var ObjectSearchResultListTitle = import_react46.css`
4697
+ var ObjectSearchResultListTitle = import_react47.css`
4610
4698
  font-weight: var(--fw-bold);
4611
4699
  line-height: 1;
4612
4700
  `;
@@ -4681,7 +4769,7 @@ var ObjectSearchResultList = ({
4681
4769
 
4682
4770
  // src/components/ObjectSearch/QueryFilter.tsx
4683
4771
  var import_design_system32 = require("@uniformdev/design-system");
4684
- var import_react47 = require("react");
4772
+ var import_react48 = require("react");
4685
4773
  var import_jsx_runtime54 = require("@emotion/react/jsx-runtime");
4686
4774
  var QueryFilter = ({
4687
4775
  requireContentType,
@@ -4712,7 +4800,7 @@ var QueryFilter = ({
4712
4800
  }) => {
4713
4801
  var _a, _b;
4714
4802
  const { query, onSetQuery } = useObjectSearchContext();
4715
- const [queryState, setQueryState] = (0, import_react47.useState)({
4803
+ const [queryState, setQueryState] = (0, import_react48.useState)({
4716
4804
  contentType: "",
4717
4805
  keyword: "",
4718
4806
  count: countValue != null ? countValue : 5,
@@ -4723,7 +4811,7 @@ var QueryFilter = ({
4723
4811
  setQueryState((prev) => ({ ...prev, ...value }));
4724
4812
  onSetQuery({ ...query, ...value });
4725
4813
  };
4726
- (0, import_react47.useEffect)(() => {
4814
+ (0, import_react48.useEffect)(() => {
4727
4815
  onSetQuery(queryState);
4728
4816
  }, [onSetQuery, queryState]);
4729
4817
  return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("fieldset", { children: [