@uniformdev/mesh-sdk-react 19.22.1-alpha.8 → 19.23.1-alpha.12

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
@@ -166,9 +166,9 @@ var require_p_limit = __commonJS({
166
166
  // src/index.ts
167
167
  var src_exports = {};
168
168
  __export(src_exports, {
169
- AddListButton: () => import_design_system34.AddListButton,
170
- Button: () => import_design_system34.Button,
171
- Callout: () => import_design_system34.Callout,
169
+ AddListButton: () => import_design_system36.AddListButton,
170
+ Button: () => import_design_system36.Button,
171
+ Callout: () => import_design_system36.Callout,
172
172
  DamSelectedItem: () => DamSelectedItem,
173
173
  DataRefreshButton: () => DataRefreshButton,
174
174
  DataResourceDynamicInputProvider: () => DataResourceDynamicInputProvider,
@@ -179,20 +179,20 @@ __export(src_exports, {
179
179
  DefaultSearchRow: () => DefaultSearchRow,
180
180
  DefaultSelectedItem: () => DefaultSelectedItem,
181
181
  EntrySearch: () => EntrySearch,
182
- Heading: () => import_design_system34.Heading,
182
+ Heading: () => import_design_system36.Heading,
183
183
  Icons: () => icons_exports,
184
- Input: () => import_design_system34.Input,
185
- InputComboBox: () => import_design_system34.InputComboBox,
186
- InputKeywordSearch: () => import_design_system34.InputKeywordSearch,
187
- InputSelect: () => import_design_system34.InputSelect,
188
- InputToggle: () => import_design_system34.InputToggle,
184
+ Input: () => import_design_system36.Input,
185
+ InputComboBox: () => import_design_system36.InputComboBox,
186
+ InputKeywordSearch: () => import_design_system36.InputKeywordSearch,
187
+ InputSelect: () => import_design_system36.InputSelect,
188
+ InputToggle: () => import_design_system36.InputToggle,
189
189
  InputVariables: () => InputVariables,
190
- Label: () => import_design_system34.Label,
190
+ Label: () => import_design_system36.Label,
191
191
  LinkButton: () => LinkButton,
192
- LoadingIndicator: () => import_design_system34.LoadingIndicator,
193
- LoadingOverlay: () => import_design_system34.LoadingOverlay,
194
- Menu: () => import_design_system34.Menu,
195
- MenuItem: () => import_design_system34.MenuItem,
192
+ LoadingIndicator: () => import_design_system36.LoadingIndicator,
193
+ LoadingOverlay: () => import_design_system36.LoadingOverlay,
194
+ Menu: () => import_design_system36.Menu,
195
+ MenuItem: () => import_design_system36.MenuItem,
196
196
  MeshApp: () => MeshApp,
197
197
  ObjectSearchContainer: () => ObjectSearchContainer,
198
198
  ObjectSearchFilter: () => ObjectSearchFilter,
@@ -203,21 +203,21 @@ __export(src_exports, {
203
203
  ObjectSearchResultItem: () => ObjectSearchResultItem,
204
204
  ObjectSearchResultItemButton: () => ObjectSearchResultItemButton,
205
205
  ObjectSearchResultList: () => ObjectSearchResultList,
206
- ParameterGroup: () => import_design_system34.ParameterGroup,
207
- ParameterImage: () => import_design_system34.ParameterImage,
208
- ParameterImageInner: () => import_design_system34.ParameterImageInner,
209
- ParameterInput: () => import_design_system34.ParameterInput,
210
- ParameterInputInner: () => import_design_system34.ParameterInputInner,
211
- ParameterLabel: () => import_design_system34.ParameterLabel,
212
- ParameterMenuButton: () => import_design_system34.ParameterMenuButton,
213
- ParameterSelect: () => import_design_system34.ParameterSelect,
214
- ParameterSelectInner: () => import_design_system34.ParameterSelectInner,
215
- ParameterShell: () => import_design_system34.ParameterShell,
216
- ParameterShellContext: () => import_design_system33.ParameterShellContext,
217
- ParameterTextarea: () => import_design_system34.ParameterTextarea,
218
- ParameterTextareaInner: () => import_design_system34.ParameterTextareaInner,
219
- ParameterToggle: () => import_design_system34.ParameterToggle,
220
- ParameterToggleInner: () => import_design_system34.ParameterToggleInner,
206
+ ParameterGroup: () => import_design_system36.ParameterGroup,
207
+ ParameterImage: () => import_design_system36.ParameterImage,
208
+ ParameterImageInner: () => import_design_system36.ParameterImageInner,
209
+ ParameterInput: () => import_design_system36.ParameterInput,
210
+ ParameterInputInner: () => import_design_system36.ParameterInputInner,
211
+ ParameterLabel: () => import_design_system36.ParameterLabel,
212
+ ParameterMenuButton: () => import_design_system36.ParameterMenuButton,
213
+ ParameterSelect: () => import_design_system36.ParameterSelect,
214
+ ParameterSelectInner: () => import_design_system36.ParameterSelectInner,
215
+ ParameterShell: () => import_design_system36.ParameterShell,
216
+ ParameterShellContext: () => import_design_system35.ParameterShellContext,
217
+ ParameterTextarea: () => import_design_system36.ParameterTextarea,
218
+ ParameterTextareaInner: () => import_design_system36.ParameterTextareaInner,
219
+ ParameterToggle: () => import_design_system36.ParameterToggle,
220
+ ParameterToggleInner: () => import_design_system36.ParameterToggleInner,
221
221
  ProductPreviewList: () => ProductPreviewList,
222
222
  ProductQuery: () => ProductQuery,
223
223
  ProductQueryContext: () => ProductQueryContext,
@@ -235,13 +235,13 @@ __export(src_exports, {
235
235
  RequestUrl: () => RequestUrl,
236
236
  RequestUrlInput: () => RequestUrlInput,
237
237
  ResolvableLoadingValue: () => ResolvableLoadingValue,
238
- ScrollableList: () => import_design_system34.ScrollableList,
239
- ScrollableListItem: () => import_design_system34.ScrollableListItem,
238
+ ScrollableList: () => import_design_system36.ScrollableList,
239
+ ScrollableListItem: () => import_design_system36.ScrollableListItem,
240
240
  SelectionField: () => SelectionField,
241
- Switch: () => import_design_system34.Switch,
241
+ Switch: () => import_design_system36.Switch,
242
242
  TextVariableRenderer: () => TextVariableRenderer,
243
- Textarea: () => import_design_system34.Textarea,
244
- Theme: () => import_design_system34.Theme,
243
+ Textarea: () => import_design_system36.Textarea,
244
+ Theme: () => import_design_system36.Theme,
245
245
  VariableEditor: () => VariableEditor,
246
246
  VariablesList: () => VariablesList,
247
247
  VariablesProvider: () => VariablesProvider,
@@ -312,7 +312,7 @@ __export(src_exports, {
312
312
  urlEncodeRequestUrl: () => urlEncodeRequestUrl,
313
313
  useMeshLocation: () => useMeshLocation,
314
314
  useObjectSearchContext: () => useObjectSearchContext,
315
- useParameterShell: () => import_design_system33.useParameterShell,
315
+ useParameterShell: () => import_design_system35.useParameterShell,
316
316
  useProductQueryContext: () => useProductQueryContext,
317
317
  useProductSearchContext: () => useProductSearchContext,
318
318
  useRequest: () => useRequest,
@@ -320,7 +320,6 @@ __export(src_exports, {
320
320
  useRequestParameter: () => useRequestParameter,
321
321
  useUniformMeshSdk: () => useUniformMeshSdk,
322
322
  useVariables: () => useVariables,
323
- variableExpression: () => variableExpression,
324
323
  variablePrefix: () => variablePrefix,
325
324
  variableSuffix: () => variableSuffix,
326
325
  variablesToList: () => variablesToList
@@ -3077,42 +3076,203 @@ function useMeshLocation(expectedLocation) {
3077
3076
 
3078
3077
  // src/components/Variables/InputVariables.tsx
3079
3078
  init_emotion_jsx_shim();
3080
- var import_design_system16 = require("@uniformdev/design-system");
3079
+ var import_design_system18 = require("@uniformdev/design-system");
3081
3080
  var React11 = __toESM(require("react"));
3082
- var import_uuid2 = require("uuid");
3081
+ var import_react41 = require("react");
3082
+ var import_uuid3 = require("uuid");
3083
3083
 
3084
- // src/components/Variables/SelectVariableMenu.tsx
3084
+ // src/components/Variables/composer/PasteTransformerPlugin.tsx
3085
3085
  init_emotion_jsx_shim();
3086
- var import_design_system15 = require("@uniformdev/design-system");
3087
- var import_react31 = require("react");
3088
- var import_cg5 = require("react-icons/cg");
3086
+ var import_LexicalComposerContext = require("@lexical/react/LexicalComposerContext");
3087
+ var import_lexical = require("lexical");
3088
+ var import_react28 = require("react");
3089
+ function PasteTransformerPlugin({ transformPaste }) {
3090
+ const [editor] = (0, import_LexicalComposerContext.useLexicalComposerContext)();
3091
+ (0, import_react28.useEffect)(() => {
3092
+ editor.registerCommand(
3093
+ import_lexical.PASTE_COMMAND,
3094
+ (event) => {
3095
+ var _a;
3096
+ const selection = (0, import_lexical.$getSelection)();
3097
+ const pastedText = (_a = event.clipboardData) == null ? void 0 : _a.getData("text/plain");
3098
+ if (pastedText && transformPaste && (0, import_lexical.$isRangeSelection)(selection)) {
3099
+ const result = transformPaste(pastedText);
3100
+ if (result !== void 0) {
3101
+ selection.insertText(result);
3102
+ return true;
3103
+ }
3104
+ }
3105
+ return false;
3106
+ },
3107
+ import_lexical.COMMAND_PRIORITY_HIGH
3108
+ );
3109
+ }, [editor, transformPaste]);
3110
+ return null;
3111
+ }
3089
3112
 
3090
- // src/components/Variables/styles/InsertVariableMenu.styles.ts
3113
+ // src/components/Variables/styles/InputVariables.styles.ts
3091
3114
  init_emotion_jsx_shim();
3092
- var import_react28 = require("@emotion/react");
3093
- var menuBtn = import_react28.css`
3094
- background: none;
3095
- border: none;
3096
- color: var(--gray-500);
3097
- padding: 0;
3115
+ var import_react29 = require("@emotion/react");
3116
+ var menuContainer = import_react29.css`
3117
+ position: relative;
3098
3118
  `;
3099
- var menuItemTextGroup = import_react28.css`
3100
- align-items: flex-start;
3101
- display: flex;
3102
- flex-direction: column;
3119
+ var menuBtn = import_react29.css`
3120
+ position: absolute;
3121
+ top: 50%;
3122
+ right: var(--spacing-sm);
3123
+ transform: translateY(-50%);
3103
3124
  `;
3104
- var smallText = import_react28.css`
3105
- font-size: var(--fs-xs);
3125
+ var input = import_react29.css`
3126
+ appearance: none;
3127
+ background-color: var(--white);
3128
+ border: 1px solid var(--gray-400);
3129
+ border-radius: var(--rounded-md);
3130
+ color: var(--gray-700);
3131
+ padding-block: var(--spacing-sm);
3132
+ padding-left: var(--spacing-base);
3133
+ padding-right: var(--spacing-lg);
3134
+ line-height: 2.5;
3135
+ width: 100%;
3136
+ position: relative;
3137
+ transition: background var(--duration-fast) var(--timing-ease-out),
3138
+ border-color var(--duration-fast) var(--timing-ease-out),
3139
+ color var(--duration-fast) var(--timing-ease-out);
3140
+
3141
+ &:focus,
3142
+ &:focus-within {
3143
+ border-color: var(--brand-secondary-1);
3144
+ box-shadow: none;
3145
+ outline: none;
3146
+ }
3147
+
3148
+ &:disabled,
3149
+ &:disabled::placeholder {
3150
+ cursor: not-allowed;
3151
+ color: var(--gray-300);
3152
+ border-color: var(--gray-300);
3153
+ }
3154
+
3155
+ > p {
3156
+ margin: 0;
3157
+ }
3106
3158
  `;
3107
- var variablesTipText = import_react28.css`
3108
- ${smallText}
3109
- color: var(--gray-500);
3110
- padding: 0 var(--spacing-sm);
3159
+
3160
+ // src/components/Variables/util/getReferencedVariables.ts
3161
+ init_emotion_jsx_shim();
3162
+
3163
+ // src/components/Variables/util/parseVariableExpression.ts
3164
+ init_emotion_jsx_shim();
3165
+
3166
+ // src/components/Variables/util/variableExpression.ts
3167
+ init_emotion_jsx_shim();
3168
+ var variablePrefix = "${";
3169
+ var variableSuffix = "}";
3170
+
3171
+ // src/components/Variables/util/parseVariableExpression.ts
3172
+ function parseVariableExpression(serialized, onToken) {
3173
+ let buf = [];
3174
+ let state = "text";
3175
+ for (let index = 0; index < serialized.length; index++) {
3176
+ const char = serialized[index];
3177
+ if (char === "$" && serialized.at(index + 1) === "{") {
3178
+ if (serialized.at(index - 1) === "\\") {
3179
+ buf.pop();
3180
+ buf.push(char);
3181
+ continue;
3182
+ }
3183
+ state = "variable";
3184
+ if (buf.length) {
3185
+ onToken(buf.join(""), "text");
3186
+ buf = [];
3187
+ }
3188
+ index++;
3189
+ continue;
3190
+ }
3191
+ if (char === "}" && state === "variable") {
3192
+ state = "text";
3193
+ if (buf.length) {
3194
+ onToken(buf.join(""), "variable");
3195
+ buf = [];
3196
+ }
3197
+ continue;
3198
+ }
3199
+ buf.push(char);
3200
+ }
3201
+ if (buf.length) {
3202
+ if (state === "variable") {
3203
+ state = "text";
3204
+ buf.unshift(variablePrefix);
3205
+ }
3206
+ onToken(buf.join(""), state);
3207
+ }
3208
+ }
3209
+
3210
+ // src/components/Variables/util/getReferencedVariables.ts
3211
+ function getReferencedVariables(value) {
3212
+ const result = [];
3213
+ parseVariableExpression(value, (token, type) => {
3214
+ if (type === "variable") {
3215
+ result.push(token);
3216
+ }
3217
+ });
3218
+ return result;
3219
+ }
3220
+
3221
+ // src/components/Variables/VariableField.tsx
3222
+ init_emotion_jsx_shim();
3223
+
3224
+ // src/components/Variables/styles/VariableField.styles.ts
3225
+ init_emotion_jsx_shim();
3226
+ var import_react30 = require("@emotion/react");
3227
+ var labelText = import_react30.css`
3228
+ align-items: center;
3229
+ display: flex;
3230
+ gap: var(--spacing-xs);
3231
+ font-weight: var(--fw-regular);
3232
+ margin: 0 0 var(--spacing-xs);
3233
+ `;
3234
+ var variableBindButton = import_react30.css`
3235
+ align-items: center;
3236
+ border: none;
3237
+ border-radius: var(--rounded-base);
3238
+ background: none;
3239
+ display: flex;
3240
+ height: 1.2rem;
3241
+ padding: var(--spacing-2xs);
3242
+ transition: background var(--duration-fast) var(--timing-ease-out),
3243
+ color var(--duration-fast) var(--timing-ease-out);
3244
+ width: 1.2rem;
3245
+
3246
+ &:hover,
3247
+ &[aria-pressed='true']:not(:disabled) {
3248
+ background: var(--brand-secondary-3);
3249
+ color: var(--white);
3250
+ }
3251
+
3252
+ &[aria-disabled='true'] {
3253
+ background: none;
3254
+ color: currentColor;
3255
+ }
3111
3256
  `;
3112
3257
 
3258
+ // src/components/Variables/VariablesComposerVariableMenu.tsx
3259
+ init_emotion_jsx_shim();
3260
+ var import_LexicalComposerContext3 = require("@lexical/react/LexicalComposerContext");
3261
+ var import_lexical4 = require("lexical");
3262
+
3263
+ // src/components/Variables/composer/VariablesPlugin.tsx
3264
+ init_emotion_jsx_shim();
3265
+ var import_react34 = require("@emotion/react");
3266
+ var import_LexicalComposerContext2 = require("@lexical/react/LexicalComposerContext");
3267
+ var import_LexicalTypeaheadMenuPlugin = require("@lexical/react/LexicalTypeaheadMenuPlugin");
3268
+ var import_design_system16 = require("@uniformdev/design-system");
3269
+ var import_lexical3 = require("lexical");
3270
+ var import_react35 = require("react");
3271
+ var import_react_dom = require("react-dom");
3272
+
3113
3273
  // src/components/Variables/useOnVariableUpdated.ts
3114
3274
  init_emotion_jsx_shim();
3115
- var import_react30 = require("react");
3275
+ var import_react32 = require("react");
3116
3276
 
3117
3277
  // src/components/Variables/VariablesProvider.tsx
3118
3278
  init_emotion_jsx_shim();
@@ -3128,13 +3288,13 @@ var import_zod2 = require("zod");
3128
3288
 
3129
3289
  // src/components/Variables/styles/VariableEditor.styles.ts
3130
3290
  init_emotion_jsx_shim();
3131
- var import_react29 = require("@emotion/react");
3132
- var variablesFormContainer = import_react29.css`
3291
+ var import_react31 = require("@emotion/react");
3292
+ var variablesFormContainer = import_react31.css`
3133
3293
  > * {
3134
3294
  margin: var(--spacing-base) 0 0;
3135
3295
  }
3136
3296
  `;
3137
- var variablesFormBtnGroup = import_react29.css`
3297
+ var variablesFormBtnGroup = import_react31.css`
3138
3298
  display: flex;
3139
3299
  gap: var(--spacing-sm);
3140
3300
  `;
@@ -3235,17 +3395,27 @@ function VariablesProvider({
3235
3395
  value,
3236
3396
  onChange,
3237
3397
  editVariableComponent,
3398
+ readOnly,
3238
3399
  children
3239
3400
  }) {
3240
3401
  const [editing, setEditing] = React10.useState();
3241
3402
  const events = React10.useMemo(() => (0, import_mitt.default)(), []);
3403
+ if (!readOnly && !onChange) {
3404
+ throw new Error("onChange must be provided when readOnly is false");
3405
+ }
3242
3406
  const Editor = editVariableComponent != null ? editVariableComponent : VariableEditor;
3243
3407
  const contextValue = {
3244
3408
  flatVariables: flattenVariables(value),
3245
3409
  dispatch: (event) => {
3410
+ if (readOnly) {
3411
+ console.warn(
3412
+ `Received ignored mutation event in read-only variables context: ${JSON.stringify(event)}`
3413
+ );
3414
+ return;
3415
+ }
3246
3416
  if (event.type === "set") {
3247
3417
  const { name, ...varValue } = event.variable;
3248
- onChange({ ...contextValue.variables, [event.variable.name]: varValue });
3418
+ onChange == null ? void 0 : onChange({ ...contextValue.variables, [event.variable.name]: varValue });
3249
3419
  if (event.openEditor) {
3250
3420
  setEditing(event.variable.name);
3251
3421
  }
@@ -3254,9 +3424,9 @@ function VariablesProvider({
3254
3424
  } else if (event.type === "remove") {
3255
3425
  const newValue = { ...value };
3256
3426
  delete newValue[event.variable];
3257
- onChange(newValue);
3427
+ onChange == null ? void 0 : onChange(newValue);
3258
3428
  } else if (event.type === "reorder") {
3259
- onChange(event.result);
3429
+ onChange == null ? void 0 : onChange(event.result);
3260
3430
  } else {
3261
3431
  throw new Error(`Unknown event ${JSON.stringify(event)}`);
3262
3432
  }
@@ -3274,7 +3444,7 @@ function VariablesProvider({
3274
3444
  onSubmit: (val) => {
3275
3445
  setEditing(void 0);
3276
3446
  const { name, ...varValue } = val;
3277
- onChange({ ...value, [name]: varValue });
3447
+ onChange == null ? void 0 : onChange({ ...value, [name]: varValue });
3278
3448
  events.emit("update", name);
3279
3449
  },
3280
3450
  onCancel: () => setEditing(void 0),
@@ -3313,7 +3483,7 @@ function flattenVariables(variables) {
3313
3483
  // src/components/Variables/useOnVariableUpdated.ts
3314
3484
  function useOnVariableUpdated(fn2, disabled) {
3315
3485
  const { variables, events } = useVariables();
3316
- (0, import_react30.useEffect)(() => {
3486
+ (0, import_react32.useEffect)(() => {
3317
3487
  if (disabled) {
3318
3488
  return;
3319
3489
  }
@@ -3322,6 +3492,9 @@ function useOnVariableUpdated(fn2, disabled) {
3322
3492
  }, [disabled, events, fn2, variables]);
3323
3493
  }
3324
3494
 
3495
+ // src/components/Variables/variablesToGroupedList.ts
3496
+ init_emotion_jsx_shim();
3497
+
3325
3498
  // src/components/Variables/variablesToList.ts
3326
3499
  init_emotion_jsx_shim();
3327
3500
  function variablesToList(variables) {
@@ -3341,8 +3514,392 @@ function variablesToList(variables) {
3341
3514
  }));
3342
3515
  }
3343
3516
 
3344
- // src/components/Variables/SelectVariableMenu.tsx
3517
+ // src/components/Variables/variablesToGroupedList.ts
3518
+ function variablesToGroupedList(variables) {
3519
+ const groups = {};
3520
+ Object.entries(variables || {}).forEach(([name, definition]) => {
3521
+ var _a;
3522
+ const group = (_a = definition.source) != null ? _a : "";
3523
+ if (!groups[group]) {
3524
+ groups[group] = {};
3525
+ }
3526
+ groups[group][name] = definition;
3527
+ });
3528
+ return Object.entries(groups).map(([group, variables2]) => ({
3529
+ name: group,
3530
+ variables: variablesToList(variables2)
3531
+ })).sort((a2, b2) => {
3532
+ var _a, _b;
3533
+ return ((_a = a2.name) != null ? _a : "").localeCompare((_b = b2.name) != null ? _b : "");
3534
+ });
3535
+ }
3536
+
3537
+ // src/components/Variables/composer/VariableNode.tsx
3538
+ init_emotion_jsx_shim();
3539
+ var import_design_system15 = require("@uniformdev/design-system");
3540
+ var import_lexical2 = require("lexical");
3541
+ var import_react33 = require("react");
3345
3542
  var import_jsx_runtime30 = require("@emotion/react/jsx-runtime");
3543
+ var VariableNode = class extends import_lexical2.DecoratorNode {
3544
+ constructor(reference, state, key) {
3545
+ super(key);
3546
+ this.reference = reference;
3547
+ this.__state = state;
3548
+ }
3549
+ static getType() {
3550
+ return "variable";
3551
+ }
3552
+ static clone(node) {
3553
+ return new VariableNode(node.reference, { ...node.__state }, node.__key);
3554
+ }
3555
+ /** Imports the node from serialized JSON (i.e. the data provided to the editor's initial state) */
3556
+ static importJSON(serializedNode) {
3557
+ return $createVariableNode(serializedNode.reference, {
3558
+ displayName: serializedNode.reference,
3559
+ referenceIsValid: true,
3560
+ hasClickEvent: void 0
3561
+ });
3562
+ }
3563
+ /**
3564
+ * Updates the node's variables state so it knows its current validity, display name, etc
3565
+ * The plugin updates this whenever the variables prop changes.
3566
+ */
3567
+ setState(state) {
3568
+ this.getWritable().__state = state;
3569
+ }
3570
+ /**
3571
+ * Serializes the node to JSON for editor initial state
3572
+ */
3573
+ exportJSON() {
3574
+ return {
3575
+ reference: this.reference,
3576
+ type: VariableNode.getType(),
3577
+ version: 1
3578
+ };
3579
+ }
3580
+ /**
3581
+ * Copy variable to clipboard in a format we will read back if pasted
3582
+ * (albeit it won't get the fancy chip-node)
3583
+ */
3584
+ getTextContent() {
3585
+ return `\${${this.reference}}`;
3586
+ }
3587
+ /** Creates the DOM wrapper that hosts the node */
3588
+ createDOM() {
3589
+ return document.createElement("span");
3590
+ }
3591
+ updateDOM() {
3592
+ return false;
3593
+ }
3594
+ /**
3595
+ * Render the variable node using React.
3596
+ * NOTE: this is effectively an island of React, and you may not call hooks,
3597
+ * rely on Context, etc in this renderer.
3598
+ */
3599
+ decorate(editor) {
3600
+ const { displayName, hasClickEvent, referenceIsValid } = this.__state;
3601
+ const Wrapper = referenceIsValid ? import_react33.Fragment : UndefinedVariableReference;
3602
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3603
+ import_design_system15.Chip,
3604
+ {
3605
+ text: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Wrapper, { children: displayName || this.reference }),
3606
+ title: !referenceIsValid ? `${this.reference} is not defined.` : hasClickEvent ? "Click to edit" : void 0,
3607
+ onClick: () => {
3608
+ editor.dispatchCommand(EDIT_VARIABLE_COMMAND, {
3609
+ reference: this.reference
3610
+ });
3611
+ }
3612
+ }
3613
+ );
3614
+ }
3615
+ /** Enables keyboard navigation to hop over the node to previous text */
3616
+ isIsolated() {
3617
+ return true;
3618
+ }
3619
+ };
3620
+ function $createVariableNode(variableReference, state) {
3621
+ return new VariableNode(variableReference, state);
3622
+ }
3623
+ function UndefinedVariableReference({ children }) {
3624
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3625
+ "span",
3626
+ {
3627
+ style: {
3628
+ textDecoration: "underline",
3629
+ textDecorationStyle: "wavy",
3630
+ textDecorationColor: "red"
3631
+ },
3632
+ children
3633
+ }
3634
+ );
3635
+ }
3636
+
3637
+ // src/components/Variables/composer/VariablesPlugin.tsx
3638
+ var import_jsx_runtime31 = require("@emotion/react/jsx-runtime");
3639
+ var EDIT_VARIABLE_COMMAND = (0, import_lexical3.createCommand)("uniform:edit-variable");
3640
+ var INSERT_VARIABLE_COMMAND = (0, import_lexical3.createCommand)("uniform:insert-variable");
3641
+ var PUNCTUATION = `\\.,\\+\\*\\?\\$\\@\\|#{}\\(\\)\\^\\-\\[\\]\\\\/!%'"~=<>_:;`;
3642
+ var NAME = "\\b[A-Z][^\\s" + PUNCTUATION + "]";
3643
+ var DocumentVariablesRegex = {
3644
+ NAME,
3645
+ PUNCTUATION
3646
+ };
3647
+ var PUNC = DocumentVariablesRegex.PUNCTUATION;
3648
+ var TRIGGERS = ["$"].join("");
3649
+ var VALID_CHARS = "[^" + TRIGGERS + PUNC + "\\s]";
3650
+ var VALID_JOINS = "(?:\\.[ |$]| |[" + PUNC + "]|)";
3651
+ var LENGTH_LIMIT = 75;
3652
+ var DollarSignVariablesRegex = new RegExp(
3653
+ "(^.*)([" + TRIGGERS + "]((?:" + VALID_CHARS + VALID_JOINS + "){0," + LENGTH_LIMIT + "}))$"
3654
+ );
3655
+ function getPossibleQueryMatch(text) {
3656
+ const match = DollarSignVariablesRegex.exec(text);
3657
+ if (match !== null) {
3658
+ const maybeLeadingWhitespace = match[1];
3659
+ const matchingString = match[3];
3660
+ return {
3661
+ leadOffset: match.index + maybeLeadingWhitespace.length,
3662
+ matchingString,
3663
+ replaceableString: match[2]
3664
+ };
3665
+ }
3666
+ return null;
3667
+ }
3668
+ var ADD_VARIABLE_OPTION = "$$add-variable$$";
3669
+ var SOURCE_SEPARATOR = "--";
3670
+ function VariablesPlugin({
3671
+ disableVariables,
3672
+ showAddVariableMenuOption,
3673
+ enableEditingVariables
3674
+ }) {
3675
+ const [editor] = (0, import_LexicalComposerContext2.useLexicalComposerContext)();
3676
+ const { variables, dispatch, isEditing, canDispatch, readOnly } = useVariables();
3677
+ const canEditVariable = canDispatch && enableEditingVariables && !readOnly;
3678
+ const [openedAdd, setOpenedAdd] = (0, import_react35.useState)(false);
3679
+ useOnVariableUpdated((varName) => {
3680
+ editor.update(() => {
3681
+ editor.dispatchCommand(INSERT_VARIABLE_COMMAND, { reference: varName });
3682
+ });
3683
+ }, !openedAdd);
3684
+ (0, import_react35.useEffect)(() => {
3685
+ if (openedAdd && !isEditing) {
3686
+ setOpenedAdd(false);
3687
+ }
3688
+ }, [isEditing, openedAdd]);
3689
+ const [queryString, setQueryString] = (0, import_react35.useState)(null);
3690
+ const { groupedVariables, menuOptions } = (0, import_react35.useMemo)(() => {
3691
+ const groupedVariables2 = variablesToGroupedList(variables);
3692
+ if (showAddVariableMenuOption) {
3693
+ groupedVariables2.push({
3694
+ name: SOURCE_SEPARATOR,
3695
+ variables: [{ name: ADD_VARIABLE_OPTION, displayName: "Add\u2026", default: "" }]
3696
+ });
3697
+ }
3698
+ const menuOptions2 = [];
3699
+ groupedVariables2.forEach(
3700
+ (group) => group.variables.forEach((variable) => {
3701
+ menuOptions2.push(new import_LexicalTypeaheadMenuPlugin.MenuOption(variable.name));
3702
+ })
3703
+ );
3704
+ return { menuOptions: menuOptions2, groupedVariables: groupedVariables2 };
3705
+ }, [variables, showAddVariableMenuOption]);
3706
+ const { filteredGroupedVariables, filteredMenuOptions } = (0, import_react35.useMemo)(() => {
3707
+ if (!queryString) {
3708
+ return {
3709
+ filteredGroupedVariables: groupedVariables,
3710
+ filteredMenuOptions: menuOptions
3711
+ };
3712
+ }
3713
+ const query = queryString.toLowerCase();
3714
+ return {
3715
+ filteredGroupedVariables: groupedVariables.map((group) => ({
3716
+ name: group.name,
3717
+ variables: group.variables.filter(
3718
+ (option) => option.name.toLowerCase().includes(query) || option.name === ADD_VARIABLE_OPTION
3719
+ )
3720
+ })).filter((group) => group.variables.length > 0),
3721
+ filteredMenuOptions: menuOptions.filter(
3722
+ (option) => option.key.includes(query) || option.key === ADD_VARIABLE_OPTION
3723
+ )
3724
+ };
3725
+ }, [queryString, groupedVariables, menuOptions]);
3726
+ const onSelectOption = (0, import_react35.useCallback)(
3727
+ (selectedOption, nodeToReplace, closeMenu) => {
3728
+ if (selectedOption.key === ADD_VARIABLE_OPTION) {
3729
+ setOpenedAdd(true);
3730
+ editor.update(() => {
3731
+ nodeToReplace == null ? void 0 : nodeToReplace.remove();
3732
+ });
3733
+ editor.dispatchCommand(EDIT_VARIABLE_COMMAND, {
3734
+ reference: queryString != null ? queryString : ""
3735
+ });
3736
+ } else {
3737
+ editor.update(() => {
3738
+ var _a;
3739
+ const variableNode = $createVariableNode(selectedOption.key, {
3740
+ displayName: ((_a = variables[selectedOption.key]) == null ? void 0 : _a.displayName) || selectedOption.key,
3741
+ hasClickEvent: canEditVariable,
3742
+ referenceIsValid: Boolean(variables[selectedOption.key])
3743
+ });
3744
+ if (nodeToReplace) {
3745
+ nodeToReplace.replace(variableNode);
3746
+ }
3747
+ });
3748
+ }
3749
+ closeMenu();
3750
+ },
3751
+ [editor, queryString, variables, canEditVariable]
3752
+ );
3753
+ (0, import_react35.useEffect)(() => {
3754
+ editor.registerCommand(
3755
+ EDIT_VARIABLE_COMMAND,
3756
+ ({ reference }) => {
3757
+ if (!disableVariables && canEditVariable) {
3758
+ dispatch({ type: "edit", variable: reference });
3759
+ }
3760
+ return true;
3761
+ },
3762
+ import_lexical3.COMMAND_PRIORITY_NORMAL
3763
+ );
3764
+ editor.registerCommand(
3765
+ INSERT_VARIABLE_COMMAND,
3766
+ ({ reference }) => {
3767
+ var _a;
3768
+ if (!disableVariables) {
3769
+ const variableNode = $createVariableNode(reference, {
3770
+ displayName: ((_a = variables[reference]) == null ? void 0 : _a.displayName) || reference,
3771
+ hasClickEvent: canEditVariable,
3772
+ referenceIsValid: Boolean(variables[reference])
3773
+ });
3774
+ (0, import_lexical3.$insertNodes)([variableNode]);
3775
+ }
3776
+ return true;
3777
+ },
3778
+ import_lexical3.COMMAND_PRIORITY_NORMAL
3779
+ );
3780
+ }, [editor, disableVariables, variables, canDispatch, dispatch, canEditVariable, readOnly]);
3781
+ (0, import_react35.useEffect)(() => {
3782
+ editor.update(() => {
3783
+ (0, import_lexical3.$nodesOfType)(VariableNode).forEach((variableNode) => {
3784
+ const targetVar = variables[variableNode.reference];
3785
+ variableNode.setState({
3786
+ displayName: (targetVar == null ? void 0 : targetVar.displayName) || variableNode.reference,
3787
+ hasClickEvent: canEditVariable,
3788
+ referenceIsValid: Boolean(targetVar)
3789
+ });
3790
+ });
3791
+ });
3792
+ }, [editor, variables, canEditVariable]);
3793
+ if (disableVariables) {
3794
+ return null;
3795
+ }
3796
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3797
+ import_LexicalTypeaheadMenuPlugin.LexicalTypeaheadMenuPlugin,
3798
+ {
3799
+ onQueryChange: setQueryString,
3800
+ onSelectOption,
3801
+ triggerFn: getPossibleQueryMatch,
3802
+ options: filteredMenuOptions,
3803
+ menuRenderFn: (anchorElementRef, { selectOptionAndCleanUp, setHighlightedIndex, selectedIndex }) => {
3804
+ if (!anchorElementRef.current || groupedVariables.length === 0 || openedAdd) {
3805
+ return null;
3806
+ }
3807
+ let currentCumulativeMenuIndex = -1;
3808
+ return (0, import_react_dom.createPortal)(
3809
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3810
+ "div",
3811
+ {
3812
+ css: import_react34.css`
3813
+ box-shadow: var(--shadow-base);
3814
+ border-radius: var(--rounded-base);
3815
+ background: var(--gray-50);
3816
+ display: flex;
3817
+ flex-direction: column;
3818
+ min-width: 250px;
3819
+ padding: var(--spacing-sm);
3820
+ outline: none;
3821
+ overflow: hidden;
3822
+ position: relative;
3823
+ z-index: var(--z-50);
3824
+ `,
3825
+ children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { children: filteredGroupedVariables.map((group, index) => {
3826
+ var _a, _b;
3827
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
3828
+ import_design_system16.MenuGroup,
3829
+ {
3830
+ title: group.name === SOURCE_SEPARATOR ? "" : (_a = group.name) != null ? _a : "",
3831
+ children: [
3832
+ group.name === SOURCE_SEPARATOR ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system16.MenuItemSeparator, {}) : null,
3833
+ group.variables.map((variable) => {
3834
+ var _a2;
3835
+ currentCumulativeMenuIndex++;
3836
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
3837
+ import_design_system16.MenuItem,
3838
+ {
3839
+ active: selectedIndex === currentCumulativeMenuIndex,
3840
+ onClick: () => {
3841
+ setHighlightedIndex(currentCumulativeMenuIndex);
3842
+ selectOptionAndCleanUp(new import_LexicalTypeaheadMenuPlugin.MenuOption(variable.name));
3843
+ },
3844
+ onMouseEnter: () => {
3845
+ setHighlightedIndex(currentCumulativeMenuIndex);
3846
+ },
3847
+ children: [
3848
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { children: (_a2 = variable.displayName) != null ? _a2 : variable.name }),
3849
+ variable.helpText ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system16.Caption, { children: variable.helpText }) : null
3850
+ ]
3851
+ },
3852
+ variable.name
3853
+ );
3854
+ })
3855
+ ]
3856
+ },
3857
+ (_b = group.name) != null ? _b : `none${index}`
3858
+ );
3859
+ }) })
3860
+ }
3861
+ ),
3862
+ anchorElementRef.current
3863
+ );
3864
+ }
3865
+ }
3866
+ );
3867
+ }
3868
+
3869
+ // src/components/Variables/SelectVariableMenu.tsx
3870
+ init_emotion_jsx_shim();
3871
+ var import_design_system17 = require("@uniformdev/design-system");
3872
+ var import_react37 = require("react");
3873
+ var import_cg5 = require("react-icons/cg");
3874
+
3875
+ // src/components/Variables/styles/InsertVariableMenu.styles.ts
3876
+ init_emotion_jsx_shim();
3877
+ var import_react36 = require("@emotion/react");
3878
+ var menuBtn2 = import_react36.css`
3879
+ background: none;
3880
+ border: none;
3881
+ color: var(--gray-500);
3882
+ padding: 0;
3883
+ `;
3884
+ var menuItemTextGroup = import_react36.css`
3885
+ align-items: flex-start;
3886
+ display: flex;
3887
+ flex-direction: column;
3888
+ gap: 0;
3889
+ line-height: 1em;
3890
+ `;
3891
+ var smallText = import_react36.css`
3892
+ font-size: var(--fs-xs);
3893
+ color: var(--gray-500);
3894
+ `;
3895
+ var variablesTipText = import_react36.css`
3896
+ ${smallText}
3897
+ color: var(--gray-500);
3898
+ padding: 0 var(--spacing-sm);
3899
+ `;
3900
+
3901
+ // src/components/Variables/SelectVariableMenu.tsx
3902
+ var import_jsx_runtime32 = require("@emotion/react/jsx-runtime");
3346
3903
  var SelectVariableMenu = ({
3347
3904
  onSelectVariable,
3348
3905
  onResetVariables,
@@ -3353,168 +3910,103 @@ var SelectVariableMenu = ({
3353
3910
  tip
3354
3911
  }) => {
3355
3912
  const { variables, dispatch, isEditing, canDispatch } = useVariables();
3356
- const btnRef = (0, import_react31.useRef)(null);
3357
- const [openedAdd, setOpenedAdd] = (0, import_react31.useState)(false);
3913
+ const btnRef = (0, import_react37.useRef)(null);
3914
+ const [openedAdd, setOpenedAdd] = (0, import_react37.useState)(false);
3358
3915
  useOnVariableUpdated((varName) => {
3359
3916
  onSelectVariable == null ? void 0 : onSelectVariable({ name: varName, default: "" });
3360
3917
  }, !openedAdd);
3361
- (0, import_react31.useEffect)(() => {
3918
+ (0, import_react37.useEffect)(() => {
3362
3919
  if (openedAdd && !isEditing) {
3363
3920
  setOpenedAdd(false);
3364
3921
  }
3365
3922
  }, [isEditing, openedAdd]);
3366
- const variablesList = variablesToList(variables);
3923
+ const variablesGroups = variablesToGroupedList(variables);
3367
3924
  const menuHasVariableOptions = Object.entries(variables).length || showAddVariableMenuOption;
3368
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
3369
- import_design_system15.Menu,
3925
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
3926
+ import_design_system17.Menu,
3370
3927
  {
3371
3928
  placement: "bottom-start",
3372
3929
  forceVisible,
3373
- menuTrigger: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3930
+ menuTrigger: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3374
3931
  "button",
3375
3932
  {
3376
3933
  title: "Insert variable",
3377
3934
  ...buttonProps,
3378
3935
  ref: btnRef,
3379
- css: [menuBtn, buttonCss],
3936
+ css: [menuBtn2, buttonCss],
3380
3937
  type: "button",
3381
- children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_cg5.CgUsbC, { size: "1.4rem" })
3938
+ children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_cg5.CgUsbC, { size: "1.4rem" })
3382
3939
  }
3383
3940
  ),
3384
3941
  menuLabel: "Insert variable",
3385
3942
  children: [
3386
- variablesList.map((variable) => {
3387
- const { name, helpText } = variable;
3388
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
3389
- import_design_system15.MenuItem,
3390
- {
3391
- id: name,
3392
- css: menuItemTextGroup,
3393
- onClick: () => onSelectVariable == null ? void 0 : onSelectVariable(variable),
3394
- children: [
3395
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: name }),
3396
- helpText ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("small", { css: smallText, children: helpText }) : null
3397
- ]
3398
- },
3399
- name
3400
- );
3401
- }),
3402
- showAddVariableMenuOption && canDispatch ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
3403
- variablesList.length ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_design_system15.MenuItemSeparator, {}) : null,
3404
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3405
- import_design_system15.MenuItem,
3406
- {
3407
- onClick: () => {
3408
- setOpenedAdd(true);
3409
- dispatch({ type: "edit", variable: "" });
3410
- },
3411
- children: "Add Variable"
3412
- }
3413
- )
3414
- ] }) : null,
3415
- menuHasVariableOptions && onResetVariables ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_design_system15.MenuItemSeparator, {}) : null,
3416
- onResetVariables ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_design_system15.MenuItem, { onClick: onResetVariables, css: { color: "var(--brand-secondary-5)" }, children: "Reset" }) : null,
3417
- tip && (menuHasVariableOptions || onResetVariables) ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_design_system15.MenuItemSeparator, {}) : null,
3418
- tip ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("i", { css: variablesTipText, children: tip }) : null
3419
- ]
3420
- }
3421
- );
3422
- };
3423
-
3424
- // src/components/Variables/styles/InputVariables.styles.ts
3425
- init_emotion_jsx_shim();
3426
- var import_react32 = require("@emotion/react");
3427
- var menuContainer = import_react32.css`
3428
- position: relative;
3429
- `;
3430
- var menuBtn2 = import_react32.css`
3431
- position: absolute;
3432
- bottom: 25%;
3433
- right: var(--spacing-sm);
3434
- `;
3435
-
3436
- // src/components/Variables/util/getReferencedVariables.ts
3437
- init_emotion_jsx_shim();
3438
-
3439
- // src/components/Variables/util/variableExpression.ts
3440
- init_emotion_jsx_shim();
3441
- var variableExpression = /(?<!\\)\${([^}]+)}/g;
3442
- var variablePrefix = "${";
3443
- var variableSuffix = "}";
3444
-
3445
- // src/components/Variables/util/getReferencedVariables.ts
3446
- function getReferencedVariables(value) {
3447
- const result = [];
3448
- for (const match of value.matchAll(variableExpression)) {
3449
- result.push(match[1]);
3450
- }
3451
- return result;
3452
- }
3453
-
3454
- // src/components/Variables/util/insertVariableIntoText.ts
3455
- init_emotion_jsx_shim();
3456
- function insertVariableIntoText({
3457
- variableName: variableName2,
3458
- value,
3459
- selectionStart = null,
3460
- selectionEnd = null
3461
- }) {
3462
- const variableExpression2 = `${variablePrefix}${variableName2}${variableSuffix}`;
3463
- if (selectionStart !== null && selectionEnd !== null && selectionStart !== selectionEnd) {
3464
- return `${value.substring(0, selectionStart)}${variableExpression2}${value.substring(selectionEnd)}`;
3465
- }
3466
- const hasCursorPosition = selectionStart !== null;
3467
- let startOffset = 0;
3468
- if (hasCursorPosition && value.substring(selectionStart - variablePrefix.length, selectionStart) === variablePrefix) {
3469
- startOffset = variablePrefix.length;
3470
- }
3471
- if (hasCursorPosition) {
3472
- return `${value.substring(0, selectionStart - startOffset)}${variableExpression2}${value.substring(
3473
- selectionStart
3474
- )}`;
3475
- }
3476
- return `${value}${variableExpression2}`;
3477
- }
3478
-
3479
- // src/components/Variables/VariableField.tsx
3480
- init_emotion_jsx_shim();
3481
-
3482
- // src/components/Variables/styles/VariableField.styles.ts
3483
- init_emotion_jsx_shim();
3484
- var import_react33 = require("@emotion/react");
3485
- var labelText = import_react33.css`
3486
- align-items: center;
3487
- display: flex;
3488
- gap: var(--spacing-xs);
3489
- font-weight: var(--fw-regular);
3490
- margin: 0 0 var(--spacing-xs);
3491
- `;
3492
- var variableBindButton = import_react33.css`
3493
- align-items: center;
3494
- border: none;
3495
- border-radius: var(--rounded-base);
3496
- background: none;
3497
- display: flex;
3498
- height: 1.2rem;
3499
- padding: var(--spacing-2xs);
3500
- transition: background var(--duration-fast) var(--timing-ease-out),
3501
- color var(--duration-fast) var(--timing-ease-out);
3502
- width: 1.2rem;
3503
-
3504
- &:hover,
3505
- &[aria-pressed='true']:not(:disabled) {
3506
- background: var(--brand-secondary-3);
3507
- color: var(--white);
3508
- }
3943
+ variablesGroups.map((group) => {
3944
+ var _a;
3945
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system17.MenuGroup, { title: (_a = group.name) != null ? _a : "", children: group.variables.map((variable) => {
3946
+ const { name, helpText } = variable;
3947
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
3948
+ import_design_system17.MenuItem,
3949
+ {
3950
+ id: name,
3951
+ css: menuItemTextGroup,
3952
+ onClick: () => onSelectVariable == null ? void 0 : onSelectVariable(variable),
3953
+ children: [
3954
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { children: name }),
3955
+ helpText ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("small", { css: smallText, children: helpText }) : null
3956
+ ]
3957
+ },
3958
+ name
3959
+ );
3960
+ }) }, group.name);
3961
+ }),
3962
+ showAddVariableMenuOption && canDispatch ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
3963
+ variablesGroups.length ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system17.MenuItemSeparator, {}) : null,
3964
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3965
+ import_design_system17.MenuItem,
3966
+ {
3967
+ onClick: () => {
3968
+ setOpenedAdd(true);
3969
+ dispatch({ type: "edit", variable: "" });
3970
+ },
3971
+ children: "Add\u2026"
3972
+ }
3973
+ )
3974
+ ] }) : null,
3975
+ menuHasVariableOptions && onResetVariables ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system17.MenuItemSeparator, {}) : null,
3976
+ onResetVariables ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system17.MenuItem, { onClick: onResetVariables, css: { color: "var(--brand-secondary-5)" }, children: "Reset" }) : null,
3977
+ tip && (menuHasVariableOptions || onResetVariables) ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system17.MenuItemSeparator, {}) : null,
3978
+ tip ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("i", { css: variablesTipText, children: tip }) : null
3979
+ ]
3980
+ }
3981
+ );
3982
+ };
3509
3983
 
3510
- &[aria-disabled='true'] {
3511
- background: none;
3512
- color: currentColor;
3513
- }
3514
- `;
3984
+ // src/components/Variables/VariablesComposerVariableMenu.tsx
3985
+ var import_jsx_runtime33 = require("@emotion/react/jsx-runtime");
3986
+ var VariablesComposerVariableMenu = (props) => {
3987
+ const [editor] = (0, import_LexicalComposerContext3.useLexicalComposerContext)();
3988
+ const onSelectVariable = (selectedVariable) => {
3989
+ editor.dispatchCommand(INSERT_VARIABLE_COMMAND, {
3990
+ reference: selectedVariable.name
3991
+ });
3992
+ };
3993
+ const onResetVariable = () => {
3994
+ var _a;
3995
+ editor.dispatchCommand(import_lexical4.CLEAR_EDITOR_COMMAND, void 0);
3996
+ (_a = props.onResetVariables) == null ? void 0 : _a.call(props);
3997
+ };
3998
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3999
+ SelectVariableMenu,
4000
+ {
4001
+ ...props,
4002
+ onSelectVariable,
4003
+ onResetVariables: props.onResetVariables ? onResetVariable : void 0
4004
+ }
4005
+ );
4006
+ };
3515
4007
 
3516
4008
  // src/components/Variables/VariableField.tsx
3517
- var import_jsx_runtime31 = require("@emotion/react/jsx-runtime");
4009
+ var import_jsx_runtime34 = require("@emotion/react/jsx-runtime");
3518
4010
  function VariableField({
3519
4011
  label,
3520
4012
  selectVariableMenuOptions,
@@ -3525,25 +4017,191 @@ function VariableField({
3525
4017
  }) {
3526
4018
  const { variables } = useVariables(true);
3527
4019
  const varCount = Object.keys(variables).length;
3528
- const variableSelector = varCount > 0 && (selectVariableMenuOptions == null ? void 0 : selectVariableMenuOptions.onSelectVariable) && !disableVariables ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3529
- SelectVariableMenu,
4020
+ const variableSelector = varCount > 0 && !disableVariables ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
4021
+ VariablesComposerVariableMenu,
3530
4022
  {
3531
4023
  ...selectVariableMenuOptions,
3532
4024
  buttonCss: [variableBindButton, selectVariableMenuOptions == null ? void 0 : selectVariableMenuOptions.buttonCss],
3533
4025
  buttonProps: isActive ? { "aria-pressed": "true" } : void 0
3534
4026
  }
3535
4027
  ) : null;
3536
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { children: [
3537
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { htmlFor: id, css: labelText, children: [
4028
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { children: [
4029
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("label", { htmlFor: id, css: labelText, children: [
3538
4030
  variableSelector,
3539
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: label })
4031
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { children: label })
3540
4032
  ] }),
3541
4033
  children
3542
4034
  ] });
3543
4035
  }
3544
4036
 
4037
+ // src/components/Variables/VariablesComposer.tsx
4038
+ init_emotion_jsx_shim();
4039
+ var import_LexicalClearEditorPlugin = require("@lexical/react/LexicalClearEditorPlugin");
4040
+ var import_LexicalComposer = require("@lexical/react/LexicalComposer");
4041
+ var import_LexicalContentEditable = require("@lexical/react/LexicalContentEditable");
4042
+ var import_LexicalErrorBoundary = __toESM(require("@lexical/react/LexicalErrorBoundary"));
4043
+ var import_LexicalOnChangePlugin = require("@lexical/react/LexicalOnChangePlugin");
4044
+ var import_LexicalPlainTextPlugin = require("@lexical/react/LexicalPlainTextPlugin");
4045
+ var import_lexical6 = require("lexical");
4046
+ var import_react40 = require("react");
4047
+ var import_uuid2 = require("uuid");
4048
+
4049
+ // src/components/Variables/composer/DisablePlugin.tsx
4050
+ init_emotion_jsx_shim();
4051
+ var import_LexicalComposerContext4 = require("@lexical/react/LexicalComposerContext");
4052
+ var import_react38 = require("react");
4053
+ function DisablePlugin({ disabled }) {
4054
+ const [editor] = (0, import_LexicalComposerContext4.useLexicalComposerContext)();
4055
+ (0, import_react38.useEffect)(() => {
4056
+ editor.setEditable(!disabled);
4057
+ }, [editor, disabled]);
4058
+ return null;
4059
+ }
4060
+
4061
+ // src/components/Variables/composer/SingleLineTextPlugin.tsx
4062
+ init_emotion_jsx_shim();
4063
+ var import_LexicalComposerContext5 = require("@lexical/react/LexicalComposerContext");
4064
+ var import_lexical5 = require("lexical");
4065
+ var import_react39 = require("react");
4066
+ function SingleLineTextPlugin() {
4067
+ const [editor] = (0, import_LexicalComposerContext5.useLexicalComposerContext)();
4068
+ (0, import_react39.useEffect)(() => {
4069
+ editor.registerNodeTransform(import_lexical5.LineBreakNode, (node) => {
4070
+ node.remove();
4071
+ });
4072
+ }, [editor]);
4073
+ return null;
4074
+ }
4075
+
4076
+ // src/components/Variables/VariablesComposer.tsx
4077
+ var import_jsx_runtime35 = require("@emotion/react/jsx-runtime");
4078
+ function VariablesComposer(props) {
4079
+ const { value, children, onChange, disabled, disableVariables, ...variablesPluginProps } = props;
4080
+ const [namespace] = (0, import_react40.useState)((0, import_uuid2.v4)());
4081
+ const [lastEmittedValue, setLastEmittedValue] = (0, import_react40.useState)(value);
4082
+ const editorConfig = (0, import_react40.useMemo)(
4083
+ () => ({
4084
+ namespace,
4085
+ onError(error) {
4086
+ throw error;
4087
+ },
4088
+ nodes: [VariableNode],
4089
+ editorState: deserializeEditorState(props.value)
4090
+ }),
4091
+ // eslint-disable-next-line react-hooks/exhaustive-deps
4092
+ [namespace]
4093
+ );
4094
+ const editorState = (0, import_react40.useRef)();
4095
+ const updateTimeout = (0, import_react40.useRef)();
4096
+ if (typeof document === "undefined")
4097
+ return null;
4098
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_LexicalComposer.LexicalComposer, { initialConfig: editorConfig, children: [
4099
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
4100
+ import_LexicalOnChangePlugin.OnChangePlugin,
4101
+ {
4102
+ onChange: (state) => {
4103
+ editorState.current = state;
4104
+ if (updateTimeout.current) {
4105
+ clearTimeout(updateTimeout.current);
4106
+ }
4107
+ setTimeout(() => {
4108
+ if (editorState.current) {
4109
+ const valueToEmit = serializeEditorState(editorState.current);
4110
+ if (valueToEmit !== lastEmittedValue) {
4111
+ setLastEmittedValue(valueToEmit);
4112
+ onChange(valueToEmit);
4113
+ }
4114
+ }
4115
+ }, 400);
4116
+ }
4117
+ }
4118
+ ),
4119
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SingleLineTextPlugin, {}),
4120
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_LexicalClearEditorPlugin.ClearEditorPlugin, {}),
4121
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(VariablesPlugin, { ...variablesPluginProps }),
4122
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(DisablePlugin, { disabled }),
4123
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_jsx_runtime35.Fragment, { children })
4124
+ ] });
4125
+ }
4126
+ function VariablesComposerInput(props) {
4127
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
4128
+ import_LexicalPlainTextPlugin.PlainTextPlugin,
4129
+ {
4130
+ contentEditable: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_LexicalContentEditable.ContentEditable, { css: input, ...props }),
4131
+ placeholder: null,
4132
+ ErrorBoundary: import_LexicalErrorBoundary.default
4133
+ }
4134
+ ) });
4135
+ }
4136
+ function deserializeEditorState(serialized) {
4137
+ const result = [];
4138
+ parseVariableExpression(serialized, (token, type) => {
4139
+ if (type === "text") {
4140
+ const node = {
4141
+ type: import_lexical6.TextNode.getType(),
4142
+ text: token,
4143
+ mode: "normal",
4144
+ version: 1,
4145
+ detail: 0,
4146
+ format: 0,
4147
+ style: ""
4148
+ };
4149
+ result.push(node);
4150
+ }
4151
+ if (type === "variable") {
4152
+ const node = {
4153
+ type: "variable",
4154
+ reference: token,
4155
+ version: 1
4156
+ };
4157
+ result.push(node);
4158
+ }
4159
+ });
4160
+ const rez = JSON.stringify({
4161
+ root: {
4162
+ children: [
4163
+ {
4164
+ children: result,
4165
+ direction: "ltr",
4166
+ format: "",
4167
+ indent: 0,
4168
+ type: "paragraph",
4169
+ version: 1
4170
+ }
4171
+ ],
4172
+ direction: "ltr",
4173
+ format: "",
4174
+ indent: 0,
4175
+ type: "root",
4176
+ version: 1
4177
+ }
4178
+ });
4179
+ return rez;
4180
+ }
4181
+ function serializeEditorState(editorState) {
4182
+ const buf = [];
4183
+ serializeRecursive(editorState.toJSON().root, buf);
4184
+ return buf.join("");
4185
+ }
4186
+ function serializeRecursive(node, buffer) {
4187
+ if (node.type === import_lexical6.TextNode.getType()) {
4188
+ buffer.push(node.text);
4189
+ }
4190
+ if (node.type === VariableNode.getType()) {
4191
+ buffer.push(`\${${node.reference}}`);
4192
+ }
4193
+ if (node.type === import_lexical6.LineBreakNode.getType()) {
4194
+ buffer.push("\n");
4195
+ }
4196
+ if ("children" in node && node.children) {
4197
+ for (const child of node.children) {
4198
+ serializeRecursive(child, buffer);
4199
+ }
4200
+ }
4201
+ }
4202
+
3545
4203
  // src/components/Variables/InputVariables.tsx
3546
- var import_jsx_runtime32 = require("@emotion/react/jsx-runtime");
4204
+ var import_jsx_runtime36 = require("@emotion/react/jsx-runtime");
3547
4205
  function InputVariables({
3548
4206
  id,
3549
4207
  "aria-label": ariaLabel,
@@ -3551,38 +4209,20 @@ function InputVariables({
3551
4209
  value,
3552
4210
  disableVariables,
3553
4211
  disableReset,
4212
+ enableEditingVariables,
3554
4213
  disableInlineMenu,
3555
4214
  onChange,
3556
- onPaste,
4215
+ transformPaste,
3557
4216
  showAddVariableMenuOption,
3558
4217
  inputWhenNoVariables,
3559
4218
  caption,
3560
4219
  errorMessage,
3561
4220
  warningMessage,
3562
4221
  infoMessage,
3563
- ...inputProps
4222
+ "data-test-id": dataTestId
3564
4223
  }) {
3565
- var _a, _b;
3566
- const { variables } = useVariables(true);
3567
- const inputRef = React11.useRef(null);
3568
- const [finalId] = React11.useState(id != null ? id : () => (0, import_uuid2.v4)());
3569
- const onPasteHandler = (e) => {
3570
- var _a2, _b2, _c;
3571
- if (!onPaste) {
3572
- return;
3573
- }
3574
- const pastedValue = (_a2 = e.clipboardData) == null ? void 0 : _a2.getData("text/plain");
3575
- if (!pastedValue || !e.currentTarget) {
3576
- return;
3577
- }
3578
- const selectionStart = (_b2 = e.currentTarget.selectionStart) != null ? _b2 : 0;
3579
- const selectionEnd = (_c = e.currentTarget.selectionEnd) != null ? _c : 0;
3580
- const newValue = e.currentTarget.value.substring(0, selectionStart) + pastedValue + e.currentTarget.value.substring(selectionEnd);
3581
- onPaste(newValue);
3582
- e.preventDefault();
3583
- };
3584
- const currentCursor = (_b = (_a = inputRef.current) == null ? void 0 : _a.selectionStart) != null ? _b : value.length;
3585
- const forceMenu = value.substring(currentCursor - 2, currentCursor) === variablePrefix;
4224
+ const { variables, readOnly } = useVariables(true);
4225
+ const [finalId] = React11.useState(id != null ? id : () => (0, import_uuid3.v4)());
3586
4226
  const hasVariablesInValue = getReferencedVariables(value).length > 0;
3587
4227
  const [hadVariablesInValue, setHadVariablesInValue] = React11.useState(hasVariablesInValue);
3588
4228
  React11.useEffect(() => {
@@ -3590,60 +4230,35 @@ function InputVariables({
3590
4230
  setHadVariablesInValue(true);
3591
4231
  }
3592
4232
  }, [hasVariablesInValue]);
3593
- const disableVariablesForReals = disableVariables || Object.keys(variables).length === 0 && !showAddVariableMenuOption;
4233
+ const disableVariablesForReals = disableVariables || Object.keys(variables).length === 0 && !showAddVariableMenuOption || readOnly;
3594
4234
  const disableInlineVariablesForReals = disableVariablesForReals || disableInlineMenu;
3595
- const handleInsertVariable = (variable) => {
3596
- var _a2, _b2;
3597
- const baseValue = inputWhenNoVariables && !hasVariablesInValue ? "" : value;
3598
- handleSetValue(
3599
- insertVariableIntoText({
3600
- variableName: variable.name,
3601
- value: baseValue,
3602
- selectionEnd: (_a2 = inputRef.current) == null ? void 0 : _a2.selectionEnd,
3603
- selectionStart: (_b2 = inputRef.current) == null ? void 0 : _b2.selectionStart
3604
- })
3605
- );
3606
- };
3607
- const handleSetValue = (rawValue) => {
3608
- onChange(rawValue);
3609
- };
3610
- const sharedMenuProps = {
3611
- onSelectVariable: handleInsertVariable,
3612
- showAddVariableMenuOption,
3613
- onResetVariables: hadVariablesInValue && !disableReset ? () => {
3614
- handleSetValue("");
3615
- setHadVariablesInValue(false);
3616
- } : void 0
3617
- };
3618
- const input = /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { children: [
3619
- inputWhenNoVariables && !hadVariablesInValue ? inputWhenNoVariables : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3620
- InputVariablesShell,
4235
+ const sharedMenuProps = (0, import_react41.useMemo)(
4236
+ () => ({
4237
+ showAddVariableMenuOption,
4238
+ onResetVariables: disableReset ? void 0 : () => {
4239
+ setHadVariablesInValue(false);
4240
+ }
4241
+ }),
4242
+ [disableReset, showAddVariableMenuOption]
4243
+ );
4244
+ const input2 = /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { children: [
4245
+ inputWhenNoVariables && !hadVariablesInValue ? inputWhenNoVariables : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(InputVariablesMenu, { ...sharedMenuProps, disabled: disableInlineVariablesForReals, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
4246
+ VariablesComposerInput,
3621
4247
  {
3622
- ...sharedMenuProps,
3623
- disabled: disableInlineVariablesForReals,
3624
- forceVisible: forceMenu || void 0,
3625
- children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3626
- import_design_system16.Input,
3627
- {
3628
- id: finalId,
3629
- ref: inputRef,
3630
- label: ariaLabel,
3631
- showLabel: false,
3632
- value,
3633
- onChange: (e) => handleSetValue(e.currentTarget.value),
3634
- onPaste: onPasteHandler,
3635
- ...inputProps
3636
- }
3637
- )
4248
+ id: finalId,
4249
+ "aria-label": ariaLabel,
4250
+ "data-testid": dataTestId,
4251
+ "data-text-value": value
3638
4252
  }
3639
- ),
3640
- caption ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system16.Caption, { children: caption }) : null,
3641
- errorMessage ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system16.ErrorMessage, { message: errorMessage }) : null,
3642
- warningMessage ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system16.WarningMessage, { message: warningMessage }) : null,
3643
- infoMessage ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system16.InfoMessage, { message: infoMessage }) : null
4253
+ ) }),
4254
+ caption ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_design_system18.Caption, { children: caption }) : null,
4255
+ errorMessage ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_design_system18.ErrorMessage, { message: errorMessage }) : null,
4256
+ warningMessage ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_design_system18.WarningMessage, { message: warningMessage }) : null,
4257
+ infoMessage ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_design_system18.InfoMessage, { message: infoMessage }) : null
3644
4258
  ] });
4259
+ let body = input2;
3645
4260
  if (label) {
3646
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
4261
+ body = /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
3647
4262
  VariableField,
3648
4263
  {
3649
4264
  label,
@@ -3651,36 +4266,56 @@ function InputVariables({
3651
4266
  id: finalId,
3652
4267
  isActive: hadVariablesInValue,
3653
4268
  disableVariables: disableVariablesForReals,
3654
- children: input
4269
+ children: input2
3655
4270
  }
3656
4271
  );
3657
4272
  }
3658
- return input;
4273
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
4274
+ VariablesComposer,
4275
+ {
4276
+ onChange,
4277
+ value,
4278
+ disableVariables: disableVariablesForReals,
4279
+ showAddVariableMenuOption,
4280
+ enableEditingVariables,
4281
+ children: [
4282
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(PasteTransformerPlugin, { transformPaste }),
4283
+ body
4284
+ ]
4285
+ }
4286
+ );
3659
4287
  }
3660
- function InputVariablesShell({
4288
+ function InputVariablesMenu({
3661
4289
  children,
3662
4290
  disabled,
3663
4291
  ...props
3664
4292
  }) {
3665
4293
  if (disabled) {
3666
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_jsx_runtime32.Fragment, { children });
4294
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_jsx_runtime36.Fragment, { children });
3667
4295
  }
3668
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { css: menuContainer, children: [
4296
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { css: menuContainer, children: [
3669
4297
  children,
3670
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(SelectVariableMenu, { ...props, tip: "Tip: access this list by typing ${", buttonCss: menuBtn2 })
4298
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
4299
+ VariablesComposerVariableMenu,
4300
+ {
4301
+ ...props,
4302
+ tip: "Tip: access this list by typing $",
4303
+ buttonCss: menuBtn
4304
+ }
4305
+ )
3671
4306
  ] });
3672
4307
  }
3673
4308
 
3674
4309
  // src/components/Variables/VariablesList.tsx
3675
4310
  init_emotion_jsx_shim();
3676
- var import_react35 = require("@emotion/react");
3677
- var import_design_system17 = require("@uniformdev/design-system");
4311
+ var import_react43 = require("@emotion/react");
4312
+ var import_design_system19 = require("@uniformdev/design-system");
3678
4313
  var import_react_beautiful_dnd2 = require("react-beautiful-dnd");
3679
4314
 
3680
4315
  // src/components/Variables/styles/VariablesList.styles.ts
3681
4316
  init_emotion_jsx_shim();
3682
- var import_react34 = require("@emotion/react");
3683
- var tableRow = (isDragging) => import_react34.css`
4317
+ var import_react42 = require("@emotion/react");
4318
+ var tableRow = (isDragging) => import_react42.css`
3684
4319
  position: relative;
3685
4320
  ${isDragging ? `
3686
4321
  display: table;
@@ -3688,7 +4323,7 @@ var tableRow = (isDragging) => import_react34.css`
3688
4323
  top: auto !important;
3689
4324
  ` : void 0}
3690
4325
  `;
3691
- var tableCellDragIcon = import_react34.css`
4326
+ var tableCellDragIcon = import_react42.css`
3692
4327
  &::after {
3693
4328
  content: '';
3694
4329
  display: block;
@@ -3706,7 +4341,7 @@ var tableCellDragIcon = import_react34.css`
3706
4341
  opacity: 1;
3707
4342
  }
3708
4343
  `;
3709
- var variableName = import_react34.css`
4344
+ var variableName = import_react42.css`
3710
4345
  border: none;
3711
4346
  color: var(--brand-secondary-5);
3712
4347
  font-weight: var(--fw-medium);
@@ -3717,7 +4352,7 @@ var variableName = import_react34.css`
3717
4352
  white-space: nowrap;
3718
4353
  max-width: 20ch;
3719
4354
  `;
3720
- var variableValue = import_react34.css`
4355
+ var variableValue = import_react42.css`
3721
4356
  overflow: hidden;
3722
4357
  text-overflow: ellipsis;
3723
4358
  white-space: nowrap;
@@ -3725,7 +4360,7 @@ var variableValue = import_react34.css`
3725
4360
  `;
3726
4361
 
3727
4362
  // src/components/Variables/VariablesList.tsx
3728
- var import_jsx_runtime33 = require("@emotion/react/jsx-runtime");
4363
+ var import_jsx_runtime37 = require("@emotion/react/jsx-runtime");
3729
4364
  function VariablesList() {
3730
4365
  const { variables, dispatch } = useVariables();
3731
4366
  const sorted = variablesToList(variables);
@@ -3746,24 +4381,24 @@ function VariablesList() {
3746
4381
  return result;
3747
4382
  }
3748
4383
  };
3749
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
3750
- /* @__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: [
3751
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system17.TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_design_system17.TableRow, { children: [
3752
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system17.TableCellHead, { children: "Name" }),
3753
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system17.TableCellHead, { children: "Default Value" }),
3754
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system17.TableCellHead, {})
4384
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
4385
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react_beautiful_dnd2.DragDropContext, { onDragEnd: (res) => onDragEnd(res), children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react_beautiful_dnd2.Droppable, { droppableId: "variables-table", children: (provided) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_design_system19.Table, { ...provided.droppableProps, ref: provided.innerRef, children: [
4386
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_design_system19.TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_design_system19.TableRow, { children: [
4387
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_design_system19.TableCellHead, { children: "Name" }),
4388
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_design_system19.TableCellHead, { children: "Default Value" }),
4389
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_design_system19.TableCellHead, {})
3755
4390
  ] }) }),
3756
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_design_system17.TableBody, { children: [
4391
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_design_system19.TableBody, { children: [
3757
4392
  sorted.map(({ name, displayName, default: defaultValue }, index) => {
3758
4393
  const text = displayName != null ? displayName : name;
3759
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4394
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3760
4395
  import_react_beautiful_dnd2.Draggable,
3761
4396
  {
3762
4397
  draggableId: name,
3763
4398
  index,
3764
4399
  isDragDisabled: sorted.length === 1,
3765
- children: (provided2, snapshot) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
3766
- import_design_system17.TableRow,
4400
+ children: (provided2, snapshot) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
4401
+ import_design_system19.TableRow,
3767
4402
  {
3768
4403
  ref: provided2.innerRef,
3769
4404
  ...provided2.dragHandleProps,
@@ -3772,7 +4407,7 @@ function VariablesList() {
3772
4407
  css: tableRow(snapshot.isDragging),
3773
4408
  "data-dragging": snapshot.isDragging,
3774
4409
  children: [
3775
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system17.TableCellData, { css: sorted.length > 1 ? tableCellDragIcon : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4410
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_design_system19.TableCellData, { css: sorted.length > 1 ? tableCellDragIcon : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3776
4411
  "button",
3777
4412
  {
3778
4413
  css: variableName,
@@ -3785,21 +4420,21 @@ function VariablesList() {
3785
4420
  children: text
3786
4421
  }
3787
4422
  ) }),
3788
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system17.TableCellData, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { css: variableValue, title: defaultValue, children: defaultValue }) }),
3789
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system17.TableCellData, { align: "right", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4423
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_design_system19.TableCellData, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { css: variableValue, title: defaultValue, children: defaultValue }) }),
4424
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_design_system19.TableCellData, { align: "right", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3790
4425
  "button",
3791
4426
  {
3792
4427
  type: "button",
3793
4428
  title: `delete ${text}`,
3794
4429
  css: [
3795
- import_design_system17.button,
3796
- import_react35.css`
4430
+ import_design_system19.button,
4431
+ import_react43.css`
3797
4432
  background: transparent;
3798
4433
  `
3799
4434
  ],
3800
4435
  "aria-controls": text,
3801
4436
  onClick: () => dispatch({ type: "remove", variable: name }),
3802
- children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system17.Icon, { icon: "trash", iconColor: "red" })
4437
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_design_system19.Icon, { icon: "trash", iconColor: "red" })
3803
4438
  }
3804
4439
  ) })
3805
4440
  ]
@@ -3812,8 +4447,8 @@ function VariablesList() {
3812
4447
  provided.placeholder
3813
4448
  ] })
3814
4449
  ] }) }) }),
3815
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3816
- import_design_system17.AddListButton,
4450
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
4451
+ import_design_system19.AddListButton,
3817
4452
  {
3818
4453
  onButtonClick: () => dispatch({ type: "edit", variable: "" }),
3819
4454
  "aria-label": "Add variable",
@@ -3826,49 +4461,36 @@ function VariablesList() {
3826
4461
  }
3827
4462
 
3828
4463
  // src/components/DataResourceDynamicInputProvider.tsx
3829
- var import_jsx_runtime34 = require("@emotion/react/jsx-runtime");
4464
+ var import_jsx_runtime38 = require("@emotion/react/jsx-runtime");
3830
4465
  function DataResourceDynamicInputProvider({
3831
4466
  children,
3832
4467
  dynamicInputs
3833
4468
  }) {
3834
4469
  if (dynamicInputs) {
3835
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(DataResourceDynamicInputProviderRenderer, { dynamicInputs, children });
4470
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(DataResourceDynamicInputProviderRenderer, { dynamicInputs, children });
3836
4471
  }
3837
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(DataResourceDynamicInputProviderContextShim, { children });
4472
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(DataResourceDynamicInputProviderContextShim, { children });
3838
4473
  }
3839
4474
  function DataResourceDynamicInputProviderContextShim(props) {
3840
4475
  const {
3841
4476
  metadata: { dynamicInputs }
3842
4477
  } = useMeshLocation("dataResource");
3843
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(DataResourceDynamicInputProviderRenderer, { ...props, dynamicInputs });
4478
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(DataResourceDynamicInputProviderRenderer, { ...props, dynamicInputs });
3844
4479
  }
3845
4480
  function DataResourceDynamicInputProviderRenderer({
3846
4481
  children,
3847
4482
  dynamicInputs
3848
4483
  }) {
3849
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3850
- VariablesProvider,
3851
- {
3852
- value: convertDynamicInputsToVariables(dynamicInputs),
3853
- onChange: () => {
3854
- throw new Error("Cannot change dynamic inputs. Make sure that add variable is disabled.");
3855
- },
3856
- editVariableComponent: () => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { children: "Cannot edit dynamic inputs." }),
3857
- children
3858
- }
3859
- );
4484
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(VariablesProvider, { value: convertDynamicInputsToVariables(dynamicInputs), readOnly: true, children });
3860
4485
  }
3861
4486
  function convertDynamicInputsToVariables(dynamicInputs) {
3862
4487
  return Object.entries(dynamicInputs).reduce(
3863
- (acc, [name, input]) => {
4488
+ (acc, [name, input2]) => {
3864
4489
  acc[name] = {
3865
- type: input.type,
3866
- default: input.value,
3867
- helpText: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
3868
- input.value || /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("em", { children: "not provided" }),
3869
- ", from ",
3870
- input.type === "path" ? "URL path" : "query string"
3871
- ] })
4490
+ type: input2.type,
4491
+ default: input2.value,
4492
+ source: `from ${input2.type === "path" ? "URL path" : "query string"}`,
4493
+ helpText: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_jsx_runtime38.Fragment, { children: input2.value || /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("em", { children: "not provided" }) })
3872
4494
  // type abuse! 💚
3873
4495
  };
3874
4496
  return acc;
@@ -3879,14 +4501,14 @@ function convertDynamicInputsToVariables(dynamicInputs) {
3879
4501
 
3880
4502
  // src/components/DataResourceVariablesList.tsx
3881
4503
  init_emotion_jsx_shim();
3882
- var import_design_system18 = require("@uniformdev/design-system");
3883
- var import_jsx_runtime35 = require("@emotion/react/jsx-runtime");
4504
+ var import_design_system20 = require("@uniformdev/design-system");
4505
+ var import_jsx_runtime39 = require("@emotion/react/jsx-runtime");
3884
4506
  function DataResourceVariablesList(props) {
3885
4507
  const {
3886
4508
  value,
3887
4509
  metadata: { dataType, dynamicInputs }
3888
4510
  } = useMeshLocation("dataResource");
3889
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
4511
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
3890
4512
  DataResourceVariablesListExplicit,
3891
4513
  {
3892
4514
  ...props,
@@ -3907,14 +4529,14 @@ function DataResourceVariablesListExplicit({
3907
4529
  const variableDefinitions = variablesToList(dataType.variables);
3908
4530
  if (variableDefinitions.length === 0) {
3909
4531
  if (NoVariablesComponent) {
3910
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(NoVariablesComponent, {});
4532
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(NoVariablesComponent, {});
3911
4533
  }
3912
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_design_system18.Callout, { type: "note", children: "No settings are required." });
4534
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_design_system20.Callout, { type: "note", children: "No settings are required." });
3913
4535
  }
3914
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(DataResourceDynamicInputProvider, { dynamicInputs, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { children: variableDefinitions.map((variableDefinition) => {
4536
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DataResourceDynamicInputProvider, { dynamicInputs, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { children: variableDefinitions.map((variableDefinition) => {
3915
4537
  var _a, _b, _c;
3916
4538
  const VariableRenderer = variableDefinition.type ? (_a = typeRenderers == null ? void 0 : typeRenderers[variableDefinition.type]) != null ? _a : TextVariableRenderer : TextVariableRenderer;
3917
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
4539
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
3918
4540
  VariableRenderer,
3919
4541
  {
3920
4542
  definition: variableDefinition,
@@ -3937,7 +4559,7 @@ function DataResourceVariablesListExplicit({
3937
4559
  }
3938
4560
  function TextVariableRenderer({ definition, value, setValue }) {
3939
4561
  var _a;
3940
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
4562
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
3941
4563
  InputVariables,
3942
4564
  {
3943
4565
  label: definition.displayName || definition.name,
@@ -3953,14 +4575,14 @@ init_emotion_jsx_shim();
3953
4575
 
3954
4576
  // src/components/Request/RequestBody.tsx
3955
4577
  init_emotion_jsx_shim();
3956
- var import_react37 = require("@emotion/react");
3957
- var import_design_system19 = require("@uniformdev/design-system");
3958
- var import_react38 = require("react");
4578
+ var import_react45 = require("@emotion/react");
4579
+ var import_design_system21 = require("@uniformdev/design-system");
4580
+ var import_react46 = require("react");
3959
4581
 
3960
4582
  // src/components/Request/RequestProvider.tsx
3961
4583
  init_emotion_jsx_shim();
3962
4584
  var React12 = __toESM(require("react"));
3963
- var import_jsx_runtime36 = require("@emotion/react/jsx-runtime");
4585
+ var import_jsx_runtime40 = require("@emotion/react/jsx-runtime");
3964
4586
  var RequestContext = React12.createContext(null);
3965
4587
  function RequestProvider({ value, onChange, children }) {
3966
4588
  const contextValue = React12.useMemo(() => {
@@ -4029,7 +4651,7 @@ function RequestProvider({ value, onChange, children }) {
4029
4651
  request: value
4030
4652
  };
4031
4653
  }, [onChange, value]);
4032
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(RequestContext.Provider, { value: contextValue, children });
4654
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(RequestContext.Provider, { value: contextValue, children });
4033
4655
  }
4034
4656
  function useRequest() {
4035
4657
  const context = React12.useContext(RequestContext);
@@ -4044,11 +4666,11 @@ init_emotion_jsx_shim();
4044
4666
 
4045
4667
  // src/components/Request/styles/Request.styles.ts
4046
4668
  init_emotion_jsx_shim();
4047
- var import_react36 = require("@emotion/react");
4048
- var innerContentStyles = import_react36.css`
4669
+ var import_react44 = require("@emotion/react");
4670
+ var innerContentStyles = import_react44.css`
4049
4671
  background: var(--white);
4050
4672
  `;
4051
- var requestTypeContainer = (bgColor) => import_react36.css`
4673
+ var requestTypeContainer = (bgColor) => import_react44.css`
4052
4674
  align-items: start;
4053
4675
  background: ${bgColor};
4054
4676
  display: grid;
@@ -4057,17 +4679,17 @@ var requestTypeContainer = (bgColor) => import_react36.css`
4057
4679
  `;
4058
4680
 
4059
4681
  // src/components/Request/RequestTypeContainer.tsx
4060
- var import_jsx_runtime37 = require("@emotion/react/jsx-runtime");
4682
+ var import_jsx_runtime41 = require("@emotion/react/jsx-runtime");
4061
4683
  var RequestTypeContainer = ({
4062
4684
  bgColor = "transparent",
4063
4685
  children,
4064
4686
  ...props
4065
4687
  }) => {
4066
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { css: requestTypeContainer(bgColor), ...props, children });
4688
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { css: requestTypeContainer(bgColor), ...props, children });
4067
4689
  };
4068
4690
 
4069
4691
  // src/components/Request/RequestBody.tsx
4070
- var import_jsx_runtime38 = require("@emotion/react/jsx-runtime");
4692
+ var import_jsx_runtime42 = require("@emotion/react/jsx-runtime");
4071
4693
  var LANGUAGE_OPTIONS = [
4072
4694
  { label: "Text", value: "plaintext" },
4073
4695
  { label: "JSON", value: "json" },
@@ -4086,23 +4708,23 @@ var LANGUAGE_TO_CONTENT_TYPE = {
4086
4708
  };
4087
4709
  function RequestBody() {
4088
4710
  const { request, dispatch } = useRequest();
4089
- const [language, setLanguage] = (0, import_react38.useState)("json");
4090
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
4711
+ const [language, setLanguage] = (0, import_react46.useState)("json");
4712
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
4091
4713
  "div",
4092
4714
  {
4093
- css: import_react37.css`
4715
+ css: import_react45.css`
4094
4716
  background: var(--white);
4095
4717
  `,
4096
4718
  children: [
4097
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
4719
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
4098
4720
  RequestTypeContainer,
4099
4721
  {
4100
4722
  bgColor: "var(--gray-100)",
4101
- css: import_react37.css`
4723
+ css: import_react45.css`
4102
4724
  padding: var(--spacing-sm) var(--spacing-base);
4103
4725
  `,
4104
- children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
4105
- import_design_system19.InputSelect,
4726
+ children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
4727
+ import_design_system21.InputSelect,
4106
4728
  {
4107
4729
  label: "Language",
4108
4730
  showLabel: false,
@@ -4124,8 +4746,8 @@ function RequestBody() {
4124
4746
  )
4125
4747
  }
4126
4748
  ),
4127
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
4128
- import_design_system19.JsonEditor,
4749
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
4750
+ import_design_system21.JsonEditor,
4129
4751
  {
4130
4752
  height: 200,
4131
4753
  defaultValue: request.body,
@@ -4143,8 +4765,8 @@ function RequestBody() {
4143
4765
 
4144
4766
  // src/components/Request/RequestHeaders.tsx
4145
4767
  init_emotion_jsx_shim();
4146
- var import_design_system20 = require("@uniformdev/design-system");
4147
- var import_jsx_runtime39 = require("@emotion/react/jsx-runtime");
4768
+ var import_design_system22 = require("@uniformdev/design-system");
4769
+ var import_jsx_runtime43 = require("@emotion/react/jsx-runtime");
4148
4770
  function RequestHeaders({ disableVariables }) {
4149
4771
  var _a, _b;
4150
4772
  const { dispatch, request } = useRequest();
@@ -4160,29 +4782,29 @@ function RequestHeaders({ disableVariables }) {
4160
4782
  index
4161
4783
  });
4162
4784
  };
4163
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { css: innerContentStyles, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_design_system20.Table, { children: [
4164
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_design_system20.TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_design_system20.TableRow, { children: [
4165
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_design_system20.TableCellHead, { children: "Name" }),
4166
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_design_system20.TableCellHead, { children: "Value" })
4785
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { css: innerContentStyles, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_design_system22.Table, { children: [
4786
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_design_system22.TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_design_system22.TableRow, { children: [
4787
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_design_system22.TableCellHead, { children: "Name" }),
4788
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_design_system22.TableCellHead, { children: "Value" })
4167
4789
  ] }) }),
4168
- /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_design_system20.TableBody, { children: [
4790
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_design_system22.TableBody, { children: [
4169
4791
  (_b = (_a = request.baseRequest) == null ? void 0 : _a.headers) == null ? void 0 : _b.map((baseHeader) => {
4170
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_design_system20.TableRow, { children: [
4171
- /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_design_system20.TableCellData, { width: "50%", children: [
4792
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_design_system22.TableRow, { children: [
4793
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_design_system22.TableCellData, { width: "50%", children: [
4172
4794
  baseHeader.key,
4173
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("br", {}),
4174
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("i", { css: { color: "var(--gray-500)" }, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("small", { children: "from data source" }) })
4795
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("br", {}),
4796
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("i", { css: { color: "var(--gray-500)" }, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("small", { children: "from data source" }) })
4175
4797
  ] }),
4176
- /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_design_system20.TableCellData, { width: "50%", children: [
4177
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("i", { css: { color: "var(--gray-500)" }, children: baseHeader.value }),
4178
- request.headers.find((p2) => p2.key === baseHeader.key) ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_design_system20.WarningMessage, { message: "overridden below" }) : null
4798
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_design_system22.TableCellData, { width: "50%", children: [
4799
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("i", { css: { color: "var(--gray-500)" }, children: baseHeader.value }),
4800
+ request.headers.find((p2) => p2.key === baseHeader.key) ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_design_system22.WarningMessage, { message: "overridden below" }) : null
4179
4801
  ] })
4180
4802
  ] }, baseHeader.key);
4181
4803
  }),
4182
4804
  deezHeaders.map((header, index) => {
4183
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_design_system20.TableRow, { children: [
4184
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_design_system20.TableCellData, { width: "50%", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
4185
- import_design_system20.Input,
4805
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_design_system22.TableRow, { children: [
4806
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_design_system22.TableCellData, { width: "50%", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
4807
+ import_design_system22.Input,
4186
4808
  {
4187
4809
  label: header.key,
4188
4810
  value: header.key,
@@ -4201,13 +4823,15 @@ function RequestHeaders({ disableVariables }) {
4201
4823
  "data-test-id": "header-key"
4202
4824
  }
4203
4825
  ) }),
4204
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_design_system20.TableCellData, { width: "50%", children: header.key ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
4826
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_design_system22.TableCellData, { width: "50%", children: header.key ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
4205
4827
  InputVariables,
4206
4828
  {
4207
4829
  value: header.value,
4208
4830
  onChange: (value) => handleUpdateParamFromMenu({ key: header.key, value, index }),
4209
4831
  disableVariables,
4210
4832
  showAddVariableMenuOption: true,
4833
+ enableEditingVariables: true,
4834
+ disableReset: true,
4211
4835
  "data-test-id": "header-value"
4212
4836
  }
4213
4837
  ) : null })
@@ -4219,13 +4843,13 @@ function RequestHeaders({ disableVariables }) {
4219
4843
 
4220
4844
  // src/components/Request/RequestMethodSelect.tsx
4221
4845
  init_emotion_jsx_shim();
4222
- var import_design_system21 = require("@uniformdev/design-system");
4223
- var import_jsx_runtime40 = require("@emotion/react/jsx-runtime");
4846
+ var import_design_system23 = require("@uniformdev/design-system");
4847
+ var import_jsx_runtime44 = require("@emotion/react/jsx-runtime");
4224
4848
  function RequestMethodSelect(props) {
4225
4849
  var _a;
4226
4850
  const { request, dispatch } = useRequest();
4227
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
4228
- import_design_system21.InputSelect,
4851
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
4852
+ import_design_system23.InputSelect,
4229
4853
  {
4230
4854
  ...props,
4231
4855
  options: [
@@ -4241,8 +4865,8 @@ function RequestMethodSelect(props) {
4241
4865
 
4242
4866
  // src/components/Request/RequestParameters.tsx
4243
4867
  init_emotion_jsx_shim();
4244
- var import_design_system22 = require("@uniformdev/design-system");
4245
- var import_jsx_runtime41 = require("@emotion/react/jsx-runtime");
4868
+ var import_design_system24 = require("@uniformdev/design-system");
4869
+ var import_jsx_runtime45 = require("@emotion/react/jsx-runtime");
4246
4870
  function RequestParameters({ disableVariables }) {
4247
4871
  var _a, _b;
4248
4872
  const { dispatch, request } = useRequest();
@@ -4258,29 +4882,29 @@ function RequestParameters({ disableVariables }) {
4258
4882
  index
4259
4883
  });
4260
4884
  };
4261
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { css: innerContentStyles, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_design_system22.Table, { children: [
4262
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_design_system22.TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_design_system22.TableRow, { children: [
4263
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_design_system22.TableCellHead, { children: "Name" }),
4264
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_design_system22.TableCellHead, { children: "Value" })
4885
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { css: innerContentStyles, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system24.Table, { children: [
4886
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system24.TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system24.TableRow, { children: [
4887
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system24.TableCellHead, { children: "Name" }),
4888
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system24.TableCellHead, { children: "Value" })
4265
4889
  ] }) }),
4266
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_design_system22.TableBody, { children: [
4890
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system24.TableBody, { children: [
4267
4891
  (_b = (_a = request.baseRequest) == null ? void 0 : _a.parameters) == null ? void 0 : _b.map((baseParameter) => {
4268
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_design_system22.TableRow, { children: [
4269
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_design_system22.TableCellData, { width: "50%", children: [
4892
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system24.TableRow, { children: [
4893
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system24.TableCellData, { width: "50%", children: [
4270
4894
  baseParameter.key,
4271
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("br", {}),
4272
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("i", { css: { color: "var(--gray-500)" }, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("small", { children: "from data source" }) })
4895
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("br", {}),
4896
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("i", { css: { color: "var(--gray-500)" }, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("small", { children: "from data source" }) })
4273
4897
  ] }),
4274
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_design_system22.TableCellData, { width: "50%", children: [
4275
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("i", { css: { color: "var(--gray-500)" }, children: baseParameter.value }),
4276
- request.parameters.find((p2) => p2.key === baseParameter.key) ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_design_system22.WarningMessage, { message: "overridden below" }) : null
4898
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system24.TableCellData, { width: "50%", children: [
4899
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("i", { css: { color: "var(--gray-500)" }, children: baseParameter.value }),
4900
+ request.parameters.find((p2) => p2.key === baseParameter.key) ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system24.WarningMessage, { message: "overridden below" }) : null
4277
4901
  ] })
4278
4902
  ] }, baseParameter.key);
4279
4903
  }),
4280
4904
  deezParameters.map((parameter, index) => {
4281
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_design_system22.TableRow, { children: [
4282
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_design_system22.TableCellData, { width: "50%", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
4283
- import_design_system22.Input,
4905
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system24.TableRow, { children: [
4906
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system24.TableCellData, { width: "50%", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
4907
+ import_design_system24.Input,
4284
4908
  {
4285
4909
  label: parameter.key,
4286
4910
  value: parameter.key,
@@ -4299,7 +4923,7 @@ function RequestParameters({ disableVariables }) {
4299
4923
  "data-test-id": "parameter-key"
4300
4924
  }
4301
4925
  ) }),
4302
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_design_system22.TableCellData, { width: "50%", children: parameter.key ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
4926
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system24.TableCellData, { width: "50%", children: parameter.key ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
4303
4927
  InputVariables,
4304
4928
  {
4305
4929
  value: parameter.value,
@@ -4310,7 +4934,9 @@ function RequestParameters({ disableVariables }) {
4310
4934
  }),
4311
4935
  disableVariables,
4312
4936
  "data-test-id": "parameter-value",
4313
- showAddVariableMenuOption: true
4937
+ showAddVariableMenuOption: true,
4938
+ enableEditingVariables: true,
4939
+ disableReset: true
4314
4940
  }
4315
4941
  ) : null })
4316
4942
  ] }, index);
@@ -4321,8 +4947,8 @@ function RequestParameters({ disableVariables }) {
4321
4947
 
4322
4948
  // src/components/Request/RequestUrl.tsx
4323
4949
  init_emotion_jsx_shim();
4324
- var import_react39 = require("@emotion/react");
4325
- var import_react40 = require("react");
4950
+ var import_react47 = require("@emotion/react");
4951
+ var import_react48 = require("react");
4326
4952
 
4327
4953
  // src/components/Request/urlEncodeRequestParameter.ts
4328
4954
  init_emotion_jsx_shim();
@@ -4344,35 +4970,35 @@ function decodeVariablesInUrlEncodedString(string, varValues) {
4344
4970
  }
4345
4971
 
4346
4972
  // src/components/Request/RequestUrl.tsx
4347
- var import_jsx_runtime42 = require("@emotion/react/jsx-runtime");
4973
+ var import_jsx_runtime46 = require("@emotion/react/jsx-runtime");
4348
4974
  function RequestUrl() {
4349
4975
  var _a, _b;
4350
4976
  const { variables } = useVariables();
4351
4977
  const { request } = useRequest();
4352
- const mergedParameters = (0, import_react40.useMemo)(() => {
4978
+ const mergedParameters = (0, import_react48.useMemo)(() => {
4353
4979
  var _a2;
4354
4980
  if (!((_a2 = request.baseRequest) == null ? void 0 : _a2.parameters)) {
4355
4981
  return request.parameters;
4356
4982
  }
4357
4983
  return request.baseRequest.parameters.filter((baseParam) => !request.parameters.find((p2) => p2.key === baseParam.key)).concat(request.parameters);
4358
4984
  }, [(_a = request.baseRequest) == null ? void 0 : _a.parameters, request.parameters]);
4359
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
4985
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
4360
4986
  "small",
4361
4987
  {
4362
- css: import_react39.css`
4988
+ css: import_react47.css`
4363
4989
  display: inline-block;
4364
4990
  margin-bottom: var(--spacing-xs);
4365
4991
  word-break: break-word;
4366
4992
  `,
4367
4993
  children: [
4368
- request.baseRequest ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { children: (_b = request.baseRequest) == null ? void 0 : _b.baseUrl }) : null,
4369
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { css: { fontWeight: request.baseRequest ? "bold" : "inherit" }, children: [
4994
+ request.baseRequest ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: (_b = request.baseRequest) == null ? void 0 : _b.baseUrl }) : null,
4995
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { css: { fontWeight: request.baseRequest ? "bold" : "inherit" }, children: [
4370
4996
  urlEncodeRequestUrl(request.relativeUrl, variables),
4371
- mergedParameters.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
4997
+ mergedParameters.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
4372
4998
  "?",
4373
4999
  mergedParameters.map((param, index) => {
4374
5000
  const encoded = urlEncodeRequestParameter(param, variables);
4375
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { children: [
5001
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { children: [
4376
5002
  index > 0 ? "&" : null,
4377
5003
  encoded.key,
4378
5004
  "=",
@@ -4389,9 +5015,9 @@ function RequestUrl() {
4389
5015
  // src/components/Request/RequestUrlInput.tsx
4390
5016
  init_emotion_jsx_shim();
4391
5017
 
4392
- // src/components/Request/util/handlePastedUrl.ts
5018
+ // src/components/Request/util/transformPastedUrl.ts
4393
5019
  init_emotion_jsx_shim();
4394
- function handlePastedUrl(value, currentRequest, dispatch) {
5020
+ function transformPastedUrl(value, currentRequest, dispatch) {
4395
5021
  var _a, _b, _c;
4396
5022
  const indexOfQueryString = value.indexOf("?");
4397
5023
  const hasQueryString = indexOfQueryString >= 0;
@@ -4399,7 +5025,6 @@ function handlePastedUrl(value, currentRequest, dispatch) {
4399
5025
  if (((_a = currentRequest.baseRequest) == null ? void 0 : _a.baseUrl) && relativeUrl.startsWith((_b = currentRequest.baseRequest) == null ? void 0 : _b.baseUrl)) {
4400
5026
  relativeUrl = relativeUrl.substring((_c = currentRequest.baseRequest) == null ? void 0 : _c.baseUrl.length);
4401
5027
  }
4402
- dispatch({ type: "setRelativeUrl", relativeUrl });
4403
5028
  if (hasQueryString) {
4404
5029
  for (let index = currentRequest.parameters.length - 1; index >= 0; index--) {
4405
5030
  dispatch({ type: "removeParameter", index });
@@ -4412,25 +5037,25 @@ function handlePastedUrl(value, currentRequest, dispatch) {
4412
5037
  } catch (e) {
4413
5038
  }
4414
5039
  }
5040
+ return relativeUrl;
4415
5041
  }
4416
5042
 
4417
5043
  // src/components/Request/RequestUrlInput.tsx
4418
- var import_jsx_runtime43 = require("@emotion/react/jsx-runtime");
5044
+ var import_jsx_runtime47 = require("@emotion/react/jsx-runtime");
4419
5045
  function RequestUrlInput(props) {
4420
5046
  const { request, dispatch } = useRequest();
4421
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
5047
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
4422
5048
  InputVariables,
4423
5049
  {
4424
5050
  disableReset: true,
4425
5051
  ...props,
4426
5052
  value: request.relativeUrl,
4427
- onPaste: (value) => {
4428
- handlePastedUrl(value, request, dispatch);
4429
- },
5053
+ transformPaste: (value) => transformPastedUrl(value, request, dispatch),
4430
5054
  onChange: (value) => {
4431
5055
  dispatch({ type: "setRelativeUrl", relativeUrl: value });
4432
5056
  },
4433
5057
  showAddVariableMenuOption: true,
5058
+ enableEditingVariables: true,
4434
5059
  "data-test-id": "field-url"
4435
5060
  }
4436
5061
  );
@@ -4473,18 +5098,19 @@ function useRequestParameter(paramName) {
4473
5098
  }
4474
5099
 
4475
5100
  // src/components/DataSourceEditor.tsx
4476
- var import_jsx_runtime44 = require("@emotion/react/jsx-runtime");
5101
+ var import_jsx_runtime48 = require("@emotion/react/jsx-runtime");
4477
5102
  function DataSourceEditor({ onChange, children, editVariableComponent }) {
4478
5103
  var _a;
4479
5104
  const { value } = useMeshLocation("dataSource");
4480
5105
  const currentRequestValue = convertDataSourceToRequestData(value);
4481
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
5106
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
4482
5107
  VariablesProvider,
4483
5108
  {
4484
5109
  value: (_a = value.variables) != null ? _a : {},
4485
5110
  onChange: (newValue) => onChange((prev) => ({ newValue: { ...prev, variables: newValue } })),
4486
5111
  editVariableComponent,
4487
- children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
5112
+ readOnly: true,
5113
+ children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
4488
5114
  RequestProvider,
4489
5115
  {
4490
5116
  value: currentRequestValue,
@@ -4522,21 +5148,23 @@ function convertRequestDataToDataSource(dataSource, requestData) {
4522
5148
 
4523
5149
  // src/components/DataTypeEditor.tsx
4524
5150
  init_emotion_jsx_shim();
4525
- var import_jsx_runtime45 = require("@emotion/react/jsx-runtime");
5151
+ var import_jsx_runtime49 = require("@emotion/react/jsx-runtime");
4526
5152
  function DataTypeEditor({ onChange, children, editVariableComponent }) {
4527
5153
  var _a;
4528
5154
  const {
4529
5155
  value,
4530
- metadata: { dataSource }
5156
+ metadata: { dataSource },
5157
+ isReadOnly
4531
5158
  } = useMeshLocation("dataType");
4532
5159
  const currentRequestValue = convertDataTypeToRequestData(value, dataSource);
4533
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
5160
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
4534
5161
  VariablesProvider,
4535
5162
  {
4536
5163
  value: (_a = value.variables) != null ? _a : {},
4537
5164
  onChange: (newValue) => onChange((prev) => ({ newValue: { ...prev, variables: newValue } })),
4538
5165
  editVariableComponent,
4539
- children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
5166
+ readOnly: isReadOnly,
5167
+ children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
4540
5168
  RequestProvider,
4541
5169
  {
4542
5170
  value: currentRequestValue,
@@ -4583,17 +5211,17 @@ function convertRequestDataToDataType(dataType, requestData) {
4583
5211
 
4584
5212
  // src/components/MeshApp.tsx
4585
5213
  init_emotion_jsx_shim();
4586
- var import_design_system23 = require("@uniformdev/design-system");
5214
+ var import_design_system25 = require("@uniformdev/design-system");
4587
5215
 
4588
5216
  // src/hooks/useInitializeUniformMeshSdk.ts
4589
5217
  init_emotion_jsx_shim();
4590
5218
  var import_mesh_sdk = require("@uniformdev/mesh-sdk");
4591
- var import_react41 = require("react");
5219
+ var import_react49 = require("react");
4592
5220
  var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
4593
- const [error, setError] = (0, import_react41.useState)();
4594
- const [sdk, setSdk] = (0, import_react41.useState)();
4595
- const initializationInProgress = (0, import_react41.useRef)(false);
4596
- (0, import_react41.useEffect)(
5221
+ const [error, setError] = (0, import_react49.useState)();
5222
+ const [sdk, setSdk] = (0, import_react49.useState)();
5223
+ const initializationInProgress = (0, import_react49.useRef)(false);
5224
+ (0, import_react49.useEffect)(
4597
5225
  () => {
4598
5226
  if (typeof window === "undefined" || sdk) {
4599
5227
  return;
@@ -4626,7 +5254,7 @@ var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
4626
5254
  };
4627
5255
 
4628
5256
  // src/components/MeshApp.tsx
4629
- var import_jsx_runtime46 = require("@emotion/react/jsx-runtime");
5257
+ var import_jsx_runtime50 = require("@emotion/react/jsx-runtime");
4630
5258
  var MeshApp = ({
4631
5259
  children,
4632
5260
  loadingComponent,
@@ -4635,37 +5263,37 @@ var MeshApp = ({
4635
5263
  const { initializing, error, sdk } = useInitializeUniformMeshSdk();
4636
5264
  if (initializing || !sdk) {
4637
5265
  const LoadingComponent = loadingComponent;
4638
- return LoadingComponent ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(LoadingComponent, {}) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_design_system23.LoadingIndicator, {});
5266
+ return LoadingComponent ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(LoadingComponent, {}) : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system25.LoadingIndicator, {});
4639
5267
  }
4640
5268
  if (error) {
4641
5269
  const ErrorComponent = errorComponent;
4642
5270
  if (ErrorComponent) {
4643
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ErrorComponent, { error });
5271
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ErrorComponent, { error });
4644
5272
  }
4645
5273
  throw error;
4646
5274
  }
4647
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(UniformMeshSdkContext.Provider, { value: { sdk }, children: [
4648
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_design_system23.Theme, {}),
4649
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(UniformMeshLocationContextProvider, { children })
5275
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(UniformMeshSdkContext.Provider, { value: { sdk }, children: [
5276
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system25.Theme, {}),
5277
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(UniformMeshLocationContextProvider, { children })
4650
5278
  ] });
4651
5279
  };
4652
5280
 
4653
5281
  // src/components/ObjectSearch/DataRefreshButton.tsx
4654
5282
  init_emotion_jsx_shim();
4655
- var import_react42 = require("@emotion/react");
4656
- var import_design_system24 = require("@uniformdev/design-system");
4657
- var import_jsx_runtime47 = require("@emotion/react/jsx-runtime");
5283
+ var import_react50 = require("@emotion/react");
5284
+ var import_design_system26 = require("@uniformdev/design-system");
5285
+ var import_jsx_runtime51 = require("@emotion/react/jsx-runtime");
4658
5286
  var DataRefreshButton = ({
4659
5287
  buttonText,
4660
5288
  isLoading,
4661
5289
  onRefreshData,
4662
5290
  ...props
4663
5291
  }) => {
4664
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_design_system24.Button, { buttonType: "primaryInvert", onClick: onRefreshData, disabled: isLoading, ...props, children: [
4665
- !isLoading ? null : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
4666
- import_design_system24.LoadingIndicator,
5292
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_design_system26.Button, { buttonType: "primaryInvert", onClick: onRefreshData, disabled: isLoading, ...props, children: [
5293
+ !isLoading ? null : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
5294
+ import_design_system26.LoadingIndicator,
4667
5295
  {
4668
- css: import_react42.css`
5296
+ css: import_react50.css`
4669
5297
  ${isLoading ? "opacity: 0.2;" : void 0}
4670
5298
  `
4671
5299
  }
@@ -4676,7 +5304,6 @@ var DataRefreshButton = ({
4676
5304
 
4677
5305
  // src/components/ObjectSearch/ObjectSearchContainer.tsx
4678
5306
  init_emotion_jsx_shim();
4679
- var import_react44 = require("@emotion/react");
4680
5307
 
4681
5308
  // ../canvas/dist/index.mjs
4682
5309
  init_emotion_jsx_shim();
@@ -5838,13 +6465,13 @@ function bindVariablesToObjectRecursive({
5838
6465
  }
5839
6466
 
5840
6467
  // src/components/ObjectSearch/ObjectSearchContainer.tsx
5841
- var import_design_system25 = require("@uniformdev/design-system");
6468
+ var import_design_system27 = require("@uniformdev/design-system");
5842
6469
 
5843
6470
  // src/components/ObjectSearch/hooks/ObjectSearchContext.tsx
5844
6471
  init_emotion_jsx_shim();
5845
- var import_react43 = require("react");
5846
- var import_jsx_runtime48 = require("@emotion/react/jsx-runtime");
5847
- var ObjectSearchContext = (0, import_react43.createContext)({
6472
+ var import_react51 = require("react");
6473
+ var import_jsx_runtime52 = require("@emotion/react/jsx-runtime");
6474
+ var ObjectSearchContext = (0, import_react51.createContext)({
5848
6475
  onSetQuery: () => {
5849
6476
  },
5850
6477
  onSelectItem: () => {
@@ -5859,15 +6486,15 @@ var ObjectSearchContext = (0, import_react43.createContext)({
5859
6486
  }
5860
6487
  });
5861
6488
  var ObjectSearchProvider = ({ currentlySelectedItems, children }) => {
5862
- const [query, setQuery] = (0, import_react43.useState)({
6489
+ const [query, setQuery] = (0, import_react51.useState)({
5863
6490
  contentType: "",
5864
6491
  keyword: ""
5865
6492
  });
5866
6493
  const { flatVariables } = useVariables(true);
5867
- const querySearchDeferred = (0, import_react43.useDeferredValue)(query);
5868
- const [selectedItems, setSelectedItems] = (0, import_react43.useState)(currentlySelectedItems != null ? currentlySelectedItems : []);
5869
- const [list, setList] = (0, import_react43.useState)({});
5870
- const onSetQuery = (0, import_react43.useCallback)(
6494
+ const querySearchDeferred = (0, import_react51.useDeferredValue)(query);
6495
+ const [selectedItems, setSelectedItems] = (0, import_react51.useState)(currentlySelectedItems != null ? currentlySelectedItems : []);
6496
+ const [list, setList] = (0, import_react51.useState)({});
6497
+ const onSetQuery = (0, import_react51.useCallback)(
5871
6498
  (value2) => {
5872
6499
  if (Array.isArray(value2.contentType) && value2.contentType.length > 0) {
5873
6500
  return setQuery({
@@ -5879,7 +6506,7 @@ var ObjectSearchProvider = ({ currentlySelectedItems, children }) => {
5879
6506
  },
5880
6507
  [setQuery]
5881
6508
  );
5882
- const onSelectItem = (0, import_react43.useCallback)(
6509
+ const onSelectItem = (0, import_react51.useCallback)(
5883
6510
  (selectedResult) => {
5884
6511
  if (Array.isArray(selectedResult)) {
5885
6512
  setSelectedItems(selectedResult);
@@ -5893,17 +6520,17 @@ var ObjectSearchProvider = ({ currentlySelectedItems, children }) => {
5893
6520
  },
5894
6521
  [setSelectedItems, selectedItems]
5895
6522
  );
5896
- const onRemoveAllSelectedItems = (0, import_react43.useCallback)(() => {
6523
+ const onRemoveAllSelectedItems = (0, import_react51.useCallback)(() => {
5897
6524
  setSelectedItems([]);
5898
6525
  }, [setSelectedItems]);
5899
- const onSetList = (0, import_react43.useCallback)(
6526
+ const onSetList = (0, import_react51.useCallback)(
5900
6527
  (value2) => {
5901
6528
  setList(value2);
5902
6529
  },
5903
6530
  [setList]
5904
6531
  );
5905
- const boundQuery = (0, import_react43.useMemo)(() => bindQuery(query, flatVariables), [query, flatVariables]);
5906
- const value = (0, import_react43.useMemo)(
6532
+ const boundQuery = (0, import_react51.useMemo)(() => bindQuery(query, flatVariables), [query, flatVariables]);
6533
+ const value = (0, import_react51.useMemo)(
5907
6534
  () => ({
5908
6535
  boundQuery,
5909
6536
  onSetQuery,
@@ -5925,10 +6552,10 @@ var ObjectSearchProvider = ({ currentlySelectedItems, children }) => {
5925
6552
  onSetList
5926
6553
  ]
5927
6554
  );
5928
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ObjectSearchContext.Provider, { value, children });
6555
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ObjectSearchContext.Provider, { value, children });
5929
6556
  };
5930
6557
  function useObjectSearchContext() {
5931
- return (0, import_react43.useContext)(ObjectSearchContext);
6558
+ return (0, import_react51.useContext)(ObjectSearchContext);
5932
6559
  }
5933
6560
  function bindQuery(query, inputs) {
5934
6561
  const { result, errors } = bindVariablesToObject({
@@ -5943,7 +6570,7 @@ function bindQuery(query, inputs) {
5943
6570
  }
5944
6571
 
5945
6572
  // src/components/ObjectSearch/ObjectSearchContainer.tsx
5946
- var import_jsx_runtime49 = require("@emotion/react/jsx-runtime");
6573
+ var import_jsx_runtime53 = require("@emotion/react/jsx-runtime");
5947
6574
  var ObjectSearchContainer = ({
5948
6575
  label,
5949
6576
  enableDynamicInputToResultId,
@@ -5954,21 +6581,9 @@ var ObjectSearchContainer = ({
5954
6581
  var _a, _b;
5955
6582
  const { onSelectItem, selectedListItems, list } = useObjectSearchContext();
5956
6583
  const { flatVariables } = useVariables(true);
5957
- const body = /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_design_system25.VerticalRhythm, { children: [
6584
+ const body = /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_design_system27.VerticalRhythm, { children: [
5958
6585
  searchFilters,
5959
- !resultList ? null : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
5960
- import_design_system25.ScrollableList,
5961
- {
5962
- role: "list",
5963
- css: import_react44.css`
5964
- > div {
5965
- transition: max-height var(--duration-slow) var(--timing-ease-out);
5966
- max-height: ${selectedListItems.length === 0 ? "50vh" : "184px"};
5967
- }
5968
- `,
5969
- children: resultList
5970
- }
5971
- )
6586
+ !resultList ? null : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_design_system27.ScrollableList, { role: "list", children: resultList })
5972
6587
  ] });
5973
6588
  const handleSelectedVariableChange = (selectedValue) => {
5974
6589
  var _a2;
@@ -5997,8 +6612,8 @@ var ObjectSearchContainer = ({
5997
6612
  }
5998
6613
  ]);
5999
6614
  };
6000
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system25.IconsProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_design_system25.VerticalRhythm, { children: [
6001
- /* @__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)(
6615
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_design_system27.IconsProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_design_system27.VerticalRhythm, { children: [
6616
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_design_system27.Container, { backgroundColor: "gray-50", padding: "var(--spacing-base)", border: true, children: label ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
6002
6617
  InputVariables,
6003
6618
  {
6004
6619
  label,
@@ -6014,13 +6629,13 @@ var ObjectSearchContainer = ({
6014
6629
 
6015
6630
  // src/components/ObjectSearch/ObjectSearchFilter.tsx
6016
6631
  init_emotion_jsx_shim();
6017
- var import_design_system26 = require("@uniformdev/design-system");
6018
- var import_react46 = require("react");
6632
+ var import_design_system28 = require("@uniformdev/design-system");
6633
+ var import_react53 = require("react");
6019
6634
 
6020
6635
  // src/components/ObjectSearch/styles/ObjectSearchFilterContainer.styles.ts
6021
6636
  init_emotion_jsx_shim();
6022
- var import_react45 = require("@emotion/react");
6023
- var ObjectSearchFilterContainerLabel = import_react45.css`
6637
+ var import_react52 = require("@emotion/react");
6638
+ var ObjectSearchFilterContainerLabel = import_react52.css`
6024
6639
  align-items: center;
6025
6640
  display: flex;
6026
6641
  font-size: var(--fs-sm);
@@ -6028,21 +6643,21 @@ var ObjectSearchFilterContainerLabel = import_react45.css`
6028
6643
  line-height: 1rem;
6029
6644
  margin-bottom: var(--spacing-sm);
6030
6645
  `;
6031
- var ObjectSearchFilterContainer = import_react45.css`
6646
+ var ObjectSearchFilterContainer = import_react52.css`
6032
6647
  display: grid;
6033
6648
  gap: var(--spacing-base);
6034
6649
  `;
6035
- var ObjectSearchFilterDropdownAndTextSearch = import_react45.css`
6650
+ var ObjectSearchFilterDropdownAndTextSearch = import_react52.css`
6036
6651
  grid-template-columns: 0.5fr 1fr;
6037
6652
  `;
6038
- var ObjectSearchFilterGrid = (gridColumns) => import_react45.css`
6653
+ var ObjectSearchFilterGrid = (gridColumns) => import_react52.css`
6039
6654
  display: grid;
6040
6655
  grid-template-columns: ${gridColumns};
6041
6656
  gap: var(--spacing-base);
6042
6657
  `;
6043
6658
 
6044
6659
  // src/components/ObjectSearch/ObjectSearchFilter.tsx
6045
- var import_jsx_runtime50 = require("@emotion/react/jsx-runtime");
6660
+ var import_jsx_runtime54 = require("@emotion/react/jsx-runtime");
6046
6661
  var ObjectSearchFilter = ({
6047
6662
  requireContentType,
6048
6663
  typeSelectorAllTypesOptionText = "All content types",
@@ -6052,7 +6667,7 @@ var ObjectSearchFilter = ({
6052
6667
  selectOptions
6053
6668
  }) => {
6054
6669
  const { query, onSetQuery } = useObjectSearchContext();
6055
- const [searchState, setSearchState] = (0, import_react46.useState)({
6670
+ const [searchState, setSearchState] = (0, import_react53.useState)({
6056
6671
  contentType: "",
6057
6672
  keyword: ""
6058
6673
  });
@@ -6062,9 +6677,9 @@ var ObjectSearchFilter = ({
6062
6677
  });
6063
6678
  onSetQuery({ ...query, ...value });
6064
6679
  };
6065
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("fieldset", { css: [ObjectSearchFilterContainer, ObjectSearchFilterDropdownAndTextSearch], children: [
6066
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
6067
- import_design_system26.InputSelect,
6680
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("fieldset", { css: [ObjectSearchFilterContainer, ObjectSearchFilterDropdownAndTextSearch], children: [
6681
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
6682
+ import_design_system28.InputSelect,
6068
6683
  {
6069
6684
  label: selectLabel,
6070
6685
  showLabel: false,
@@ -6079,8 +6694,8 @@ var ObjectSearchFilter = ({
6079
6694
  value: query.contentType
6080
6695
  }
6081
6696
  ),
6082
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
6083
- import_design_system26.InputKeywordSearch,
6697
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
6698
+ import_design_system28.InputKeywordSearch,
6084
6699
  {
6085
6700
  inputFieldName: searchInputName,
6086
6701
  placeholder: searchInputPlaceholderText,
@@ -6095,33 +6710,37 @@ var ObjectSearchFilter = ({
6095
6710
 
6096
6711
  // src/components/ObjectSearch/ObjectSearchFilterContainer.tsx
6097
6712
  init_emotion_jsx_shim();
6098
- var import_jsx_runtime51 = require("@emotion/react/jsx-runtime");
6713
+ var import_jsx_runtime55 = require("@emotion/react/jsx-runtime");
6099
6714
  var ObjectSearchFilterContainer2 = ({ label, children }) => {
6100
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { children: [
6101
- label ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { css: ObjectSearchFilterContainerLabel, children: label }) : null,
6102
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { css: ObjectSearchFilterContainer, children })
6715
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { children: [
6716
+ label ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { css: ObjectSearchFilterContainerLabel, children: label }) : null,
6717
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { css: ObjectSearchFilterContainer, children })
6103
6718
  ] });
6104
6719
  };
6105
6720
 
6106
6721
  // src/components/ObjectSearch/ObjectSearchListItem.tsx
6107
6722
  init_emotion_jsx_shim();
6108
- var import_design_system28 = require("@uniformdev/design-system");
6723
+ var import_design_system30 = require("@uniformdev/design-system");
6109
6724
 
6110
6725
  // src/components/ObjectSearch/styles/ObjectSearchListItem.styles.ts
6111
6726
  init_emotion_jsx_shim();
6112
- var import_react47 = require("@emotion/react");
6113
- var import_design_system27 = require("@uniformdev/design-system");
6114
- var ObjectListItemContainer = import_react47.css`
6727
+ var import_react54 = require("@emotion/react");
6728
+ var import_design_system29 = require("@uniformdev/design-system");
6729
+ var ObjectListItemContainer = import_react54.css`
6115
6730
  align-items: center;
6116
6731
  border: 1px solid var(--gray-300);
6117
6732
  border-radius: var(--rounded-base);
6118
6733
  background: var(--white);
6119
6734
  display: grid;
6120
- grid-template-columns: 1fr auto;
6735
+ grid-template-columns: 1fr 32px;
6121
6736
  padding: var(--spacing-sm);
6737
+
6738
+ &[hidden] {
6739
+ display: none;
6740
+ }
6122
6741
  `;
6123
- var ObjectListItemLoading = import_react47.css`
6124
- animation: ${import_design_system27.skeletonLoading} 1s linear infinite alternate;
6742
+ var ObjectListItemLoading = import_react54.css`
6743
+ animation: ${import_design_system29.skeletonLoading} 1s linear infinite alternate;
6125
6744
  border-color: transparent;
6126
6745
  min-height: 42px;
6127
6746
  position: relative;
@@ -6144,38 +6763,37 @@ var ObjectListItemLoading = import_react47.css`
6144
6763
  width: 1rem;
6145
6764
  }
6146
6765
  `;
6147
- var ObjectListItemHeadingGroup = import_react47.css`
6766
+ var ObjectListItemHeadingGroup = import_react54.css`
6148
6767
  align-items: center;
6149
6768
  display: grid;
6150
6769
  `;
6151
- var ObjectListItemTitle = import_react47.css`
6770
+ var ObjectListItemTitle = import_react54.css`
6152
6771
  color: var(--brand-secondary-1);
6153
6772
  display: block;
6154
6773
  font-size: var(--fs-sm);
6155
6774
  `;
6156
- var ObjectListItemSubtitle = import_react47.css`
6775
+ var ObjectListItemSubtitle = import_react54.css`
6157
6776
  color: var(--gray-500);
6158
6777
  display: block;
6159
6778
  font-size: var(--fs-xs);
6160
6779
  line-height: 1;
6161
6780
  `;
6162
- var ObjectListItemInfoContainer = import_react47.css`
6781
+ var ObjectListItemInfoContainer = import_react54.css`
6163
6782
  align-items: center;
6164
6783
  display: flex;
6165
- gap: var(--spacing-sm);
6166
6784
  justify-content: center;
6167
6785
  `;
6168
- var ObjectListItemControlledContent = import_react47.css`
6786
+ var ObjectListItemControlledContent = import_react54.css`
6169
6787
  display: flex;
6170
6788
  gap: var(--spacing-sm);
6171
6789
  `;
6172
- var ObjectListItemUnControlledContent = import_react47.css`
6790
+ var ObjectListItemUnControlledContent = import_react54.css`
6173
6791
  margin-top: var(--spacing-sm);
6174
6792
  grid-column: 1 / -1;
6175
6793
  `;
6176
6794
 
6177
6795
  // src/components/ObjectSearch/ObjectSearchListItem.tsx
6178
- var import_jsx_runtime52 = require("@emotion/react/jsx-runtime");
6796
+ var import_jsx_runtime56 = require("@emotion/react/jsx-runtime");
6179
6797
  var ObjectSearchListItem = ({
6180
6798
  id,
6181
6799
  title,
@@ -6197,29 +6815,26 @@ var ObjectSearchListItem = ({
6197
6815
  }
6198
6816
  return onSelectItem([selectedItem]);
6199
6817
  };
6200
- const selected = selectedListItems.some((item) => item.id === id);
6201
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { role: "listitem", css: ObjectListItemContainer, children: [
6202
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { role: "button", onClick: handleSelectItem, css: ObjectListItemControlledContent, children: [
6203
- !image ? null : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("img", { ...image, loading: (image == null ? void 0 : image.width) && image.height ? "lazy" : "eager" }),
6204
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { role: "heading", css: ObjectListItemHeadingGroup, children: [
6205
- !contentType ? null : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { css: ObjectListItemSubtitle, children: formatedContentType }),
6206
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { css: ObjectListItemTitle, children: title })
6818
+ const hideWhenInSelectedList = selectedListItems.some((item) => item.id === id);
6819
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { role: "listitem", hidden: hideWhenInSelectedList, css: ObjectListItemContainer, children: [
6820
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { role: "button", onClick: handleSelectItem, css: ObjectListItemControlledContent, children: [
6821
+ !image ? null : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("img", { ...image, loading: (image == null ? void 0 : image.width) && image.height ? "lazy" : "eager" }),
6822
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { role: "heading", css: ObjectListItemHeadingGroup, children: [
6823
+ !contentType ? null : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { css: ObjectListItemSubtitle, children: formatedContentType }),
6824
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { css: ObjectListItemTitle, children: title })
6207
6825
  ] })
6208
6826
  ] }),
6209
- !popoverData ? null : /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { css: ObjectListItemInfoContainer, children: [
6210
- selected ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_design_system28.Chip, { text: "selected", size: "xs" }) : null,
6211
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_design_system28.Popover, { baseId: title, ariaLabel: title, buttonText: `See ${title} details`, iconColor: "default", children: popoverData })
6212
- ] }),
6213
- !children ? null : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { css: ObjectListItemUnControlledContent, children })
6827
+ !popoverData ? null : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { css: ObjectListItemInfoContainer, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_design_system30.Popover, { baseId: title, ariaLabel: title, buttonText: `See ${title} details`, children: popoverData }) }),
6828
+ !children ? null : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { css: ObjectListItemUnControlledContent, children })
6214
6829
  ] });
6215
6830
  };
6216
6831
  var ObjectSearchListItemLoadingSkeleton = () => {
6217
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { role: "presentation", css: [ObjectListItemContainer, ObjectListItemLoading] });
6832
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { role: "presentation", css: [ObjectListItemContainer, ObjectListItemLoading] });
6218
6833
  };
6219
6834
 
6220
6835
  // src/components/ObjectSearch/ObjectSearchResultItem.tsx
6221
6836
  init_emotion_jsx_shim();
6222
- var import_design_system30 = require("@uniformdev/design-system");
6837
+ var import_design_system32 = require("@uniformdev/design-system");
6223
6838
  var import_timeago3 = require("timeago.js");
6224
6839
 
6225
6840
  // src/components/ObjectSearch/ObjectSearchResultItemButton.tsx
@@ -6227,10 +6842,10 @@ init_emotion_jsx_shim();
6227
6842
 
6228
6843
  // src/components/ObjectSearch/styles/ObjectSearchResultItemButton.styles.ts
6229
6844
  init_emotion_jsx_shim();
6230
- var import_react48 = require("@emotion/react");
6231
- var import_design_system29 = require("@uniformdev/design-system");
6232
- var ButtonStyles = import_react48.css`
6233
- ${import_design_system29.button}
6845
+ var import_react55 = require("@emotion/react");
6846
+ var import_design_system31 = require("@uniformdev/design-system");
6847
+ var ButtonStyles = import_react55.css`
6848
+ ${import_design_system31.button}
6234
6849
  background: transparent;
6235
6850
  border: 1px solid var(--brand-secondary-1);
6236
6851
  color: var(--brand-secondary-1);
@@ -6256,20 +6871,20 @@ var ButtonStyles = import_react48.css`
6256
6871
  text-decoration: none;
6257
6872
  }
6258
6873
  `;
6259
- var ButtonIcon = import_react48.css`
6874
+ var ButtonIcon = import_react55.css`
6260
6875
  width: 1rem;
6261
6876
  height: 1rem;
6262
6877
  `;
6263
6878
 
6264
6879
  // src/components/ObjectSearch/ObjectSearchResultItemButton.tsx
6265
- var import_jsx_runtime53 = require("@emotion/react/jsx-runtime");
6880
+ var import_jsx_runtime57 = require("@emotion/react/jsx-runtime");
6266
6881
  var ObjectSearchResultItemButton = ({
6267
6882
  text,
6268
6883
  icon,
6269
6884
  ...props
6270
6885
  }) => {
6271
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("button", { type: "button", css: ButtonStyles, ...props, children: [
6272
- !icon ? null : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Image, { src: icon, css: ButtonIcon }),
6886
+ return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("button", { type: "button", css: ButtonStyles, ...props, children: [
6887
+ !icon ? null : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Image, { src: icon, css: ButtonIcon }),
6273
6888
  text
6274
6889
  ] });
6275
6890
  };
@@ -6278,16 +6893,16 @@ var LinkButton = ({
6278
6893
  icon,
6279
6894
  ...props
6280
6895
  }) => {
6281
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("a", { ...props, css: ButtonStyles, target: "_blank", rel: "noopener noreferrer", children: [
6282
- !icon ? null : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Image, { src: icon, css: ButtonIcon }),
6896
+ return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("a", { ...props, css: ButtonStyles, target: "_blank", rel: "noopener noreferrer", children: [
6897
+ !icon ? null : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Image, { src: icon, css: ButtonIcon }),
6283
6898
  text
6284
6899
  ] });
6285
6900
  };
6286
6901
 
6287
6902
  // src/components/ObjectSearch/styles/ObjectSearchResultItem.styles.ts
6288
6903
  init_emotion_jsx_shim();
6289
- var import_react49 = require("@emotion/react");
6290
- var ObjectSearchResultItemContainer = import_react49.css`
6904
+ var import_react56 = require("@emotion/react");
6905
+ var ObjectSearchResultItemContainer = import_react56.css`
6291
6906
  align-items: center;
6292
6907
  border: 1px solid var(--gray-300);
6293
6908
  border-radius: var(--rounded-base);
@@ -6303,7 +6918,7 @@ var ObjectSearchResultItemContainer = import_react49.css`
6303
6918
  }
6304
6919
  }
6305
6920
  `;
6306
- var ObjectSearchDragHandle = import_react49.css`
6921
+ var ObjectSearchDragHandle = import_react56.css`
6307
6922
  border-left: 2px dotted var(--gray-300);
6308
6923
  border-right: 2px dotted var(--gray-300);
6309
6924
  position: absolute;
@@ -6312,41 +6927,41 @@ var ObjectSearchDragHandle = import_react49.css`
6312
6927
  transition: opacity var(--duration-fast) var(--timing-ease-out);
6313
6928
  opacity: 0;
6314
6929
  `;
6315
- var ObjectSearchResultItemSubtitle = import_react49.css`
6930
+ var ObjectSearchResultItemSubtitle = import_react56.css`
6316
6931
  color: var(--gray-500);
6317
6932
  display: block;
6318
6933
  font-size: var(--fs-xs);
6319
6934
  line-height: 1;
6320
6935
  `;
6321
- var ObjectSearchResultItemTitle = import_react49.css`
6936
+ var ObjectSearchResultItemTitle = import_react56.css`
6322
6937
  align-items: center;
6323
6938
  color: var(--brand-secondary-1);
6324
6939
  display: flex;
6325
6940
  gap: var(--spacing-xs);
6326
6941
  `;
6327
- var ObjectSearchResultItemTimeStamp = import_react49.css`
6942
+ var ObjectSearchResultItemTimeStamp = import_react56.css`
6328
6943
  color: var(--gray-500);
6329
6944
  font-size: var(--fs-xs);
6330
6945
  `;
6331
- var ObjectSearchAuthorStateGroup = import_react49.css`
6946
+ var ObjectSearchAuthorStateGroup = import_react56.css`
6332
6947
  align-items: center;
6333
6948
  display: flex;
6334
6949
  gap: var(--spacing-sm);
6335
6950
  `;
6336
- var ObjectSearchUpdateGroup = import_react49.css`
6951
+ var ObjectSearchUpdateGroup = import_react56.css`
6337
6952
  display: grid;
6338
6953
  `;
6339
- var ObjectSearchContentContainer = import_react49.css`
6954
+ var ObjectSearchContentContainer = import_react56.css`
6340
6955
  display: flex;
6341
6956
  gap: var(--spacing-base);
6342
6957
  `;
6343
- var ObjectSearchImage = import_react49.css`
6958
+ var ObjectSearchImage = import_react56.css`
6344
6959
  width: 56px;
6345
6960
  object-fit: contain;
6346
6961
  `;
6347
6962
 
6348
6963
  // src/components/ObjectSearch/ObjectSearchResultItem.tsx
6349
- var import_jsx_runtime54 = require("@emotion/react/jsx-runtime");
6964
+ var import_jsx_runtime58 = require("@emotion/react/jsx-runtime");
6350
6965
  var ObjectSearchResultItem = ({
6351
6966
  id,
6352
6967
  title,
@@ -6370,79 +6985,75 @@ var ObjectSearchResultItem = ({
6370
6985
  onSelectItem({ id, title: id });
6371
6986
  onRemove == null ? void 0 : onRemove();
6372
6987
  };
6373
- return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { css: ObjectSearchResultItemContainer, children: [
6374
- disableDnD ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { role: "presentation", className: "drag-handle", css: ObjectSearchDragHandle }),
6375
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { css: ObjectSearchContentContainer, children: [
6376
- !imageUrl ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("img", { src: imageUrl, alt: `Thumbnail for ${title}`, css: ObjectSearchImage }),
6377
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { children: [
6378
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { css: ObjectSearchResultItemSubtitle, children: formatedContentType }),
6379
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { role: "heading", css: ObjectSearchResultItemTitle, children: [
6988
+ return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { css: ObjectSearchResultItemContainer, children: [
6989
+ disableDnD ? null : /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { role: "presentation", className: "drag-handle", css: ObjectSearchDragHandle }),
6990
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { css: ObjectSearchContentContainer, children: [
6991
+ !imageUrl ? null : /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("img", { src: imageUrl, alt: `Thumbnail for ${title}`, css: ObjectSearchImage }),
6992
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { children: [
6993
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { css: ObjectSearchResultItemSubtitle, children: formatedContentType }),
6994
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("span", { role: "heading", css: ObjectSearchResultItemTitle, children: [
6380
6995
  title != null ? title : name,
6381
- !popoverData ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_design_system30.Popover, { baseId: title, ariaLabel: title, buttonText: `See ${title} details`, children: popoverData })
6996
+ !popoverData ? null : /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_design_system32.Popover, { baseId: title, ariaLabel: title, buttonText: `See ${title} details`, children: popoverData })
6382
6997
  ] }),
6383
- !createdAt && !publishStatus ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { css: ObjectSearchAuthorStateGroup, children: [
6384
- !(publishStatus == null ? void 0 : publishStatus.text) ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_design_system30.Badge, { ...publishStatus, size: "sm", uppercaseText: true }),
6385
- !createdAt && !publishedAt ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { css: ObjectSearchUpdateGroup, children: [
6386
- !createdAt ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("small", { css: ObjectSearchResultItemTimeStamp, children: [
6387
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("strong", { children: "Last updated: " }),
6998
+ !createdAt && !publishStatus ? null : /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { css: ObjectSearchAuthorStateGroup, children: [
6999
+ !(publishStatus == null ? void 0 : publishStatus.text) ? null : /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_design_system32.Badge, { ...publishStatus, size: "sm", uppercaseText: true }),
7000
+ !createdAt && !publishedAt ? null : /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { css: ObjectSearchUpdateGroup, children: [
7001
+ !createdAt ? null : /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("small", { css: ObjectSearchResultItemTimeStamp, children: [
7002
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("strong", { children: "Last updated: " }),
6388
7003
  (0, import_timeago3.format)(createdAt)
6389
7004
  ] }),
6390
- !publishedAt ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("small", { css: ObjectSearchResultItemTimeStamp, children: [
6391
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("strong", { children: "Last published: " }),
7005
+ !publishedAt ? null : /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("small", { css: ObjectSearchResultItemTimeStamp, children: [
7006
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("strong", { children: "Last published: " }),
6392
7007
  (0, import_timeago3.format)(publishedAt)
6393
7008
  ] })
6394
7009
  ] })
6395
7010
  ] }),
6396
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { children })
7011
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { children })
6397
7012
  ] })
6398
7013
  ] }) }),
6399
- !editLink && hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { css: ObjectSearchAuthorStateGroup, children: [
6400
- !editLink ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(LinkButton, { text: "Edit", href: editLink, icon: editLinkIcon }),
6401
- hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_design_system30.Button, { buttonType: "ghostDestructive", onClick: onRemoveItem, children: "Remove" })
7014
+ !editLink && hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { css: ObjectSearchAuthorStateGroup, children: [
7015
+ !editLink ? null : /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(LinkButton, { text: "Edit", href: editLink, icon: editLinkIcon }),
7016
+ hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_design_system32.Button, { buttonType: "ghostDestructive", onClick: onRemoveItem, children: "Remove" })
6402
7017
  ] })
6403
7018
  ] });
6404
7019
  };
6405
7020
 
6406
7021
  // src/components/ObjectSearch/ObjectSearchResultList.tsx
6407
7022
  init_emotion_jsx_shim();
6408
- var import_design_system31 = require("@uniformdev/design-system");
7023
+ var import_design_system33 = require("@uniformdev/design-system");
6409
7024
  var import_react_beautiful_dnd3 = require("react-beautiful-dnd");
6410
7025
 
6411
7026
  // src/components/ObjectSearch/styles/ObjectSearchResultList.styles.ts
6412
7027
  init_emotion_jsx_shim();
6413
- var import_react50 = require("@emotion/react");
6414
- var ObjectSearchResultListContainer = import_react50.css`
7028
+ var import_react57 = require("@emotion/react");
7029
+ var ObjectSearchResultListContainer = import_react57.css`
6415
7030
  align-items: center;
6416
7031
  display: flex;
6417
7032
  gap: var(--spacing-sm);
6418
7033
  justify-content: space-between;
6419
7034
  `;
6420
- var ObjectSearchDragContainer = import_react50.css`
7035
+ var ObjectSearchDragContainer = import_react57.css`
6421
7036
  margin: 0 0 var(--spacing-sm);
6422
7037
  `;
6423
- var ObjectSearchContainerDragging = import_react50.css`
6424
- box-shadow: var(--shadow-base);
6425
- opacity: var(--opacity-50);
6426
- `;
6427
- var ObjectSearchResultListCounterContainer = import_react50.css`
7038
+ var ObjectSearchResultListCounterContainer = import_react57.css`
6428
7039
  align-items: center;
6429
7040
  display: flex;
6430
7041
  gap: var(--spacing-sm);
6431
7042
  `;
6432
- var ObjectSearchResultListTitle = import_react50.css`
7043
+ var ObjectSearchResultListTitle = import_react57.css`
6433
7044
  font-weight: var(--fw-bold);
6434
7045
  line-height: 1;
6435
7046
  `;
6436
7047
 
6437
7048
  // src/components/ObjectSearch/ObjectSearchResultList.tsx
6438
- var import_jsx_runtime55 = require("@emotion/react/jsx-runtime");
7049
+ var import_jsx_runtime59 = require("@emotion/react/jsx-runtime");
6439
7050
  function ObjectSearchResultList({
6440
7051
  resultLabelText = "Selected",
6441
7052
  removeButtonText = "Remove all",
6442
7053
  onRemoveAllSelected,
6443
7054
  hideRemoveButton = false,
6444
7055
  additionalButtons,
6445
- renderResultComponent = (value) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ObjectSearchResultItem, { ...value }),
7056
+ renderResultComponent = (value) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(ObjectSearchResultItem, { ...value, disableDnD }),
6446
7057
  multiSelectId,
6447
7058
  disableDnD = false,
6448
7059
  whenNothingSelected = null
@@ -6462,17 +7073,17 @@ function ObjectSearchResultList({
6462
7073
  return result;
6463
7074
  }
6464
7075
  };
6465
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
6466
- /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { role: "group", css: ObjectSearchResultListContainer, children: [
6467
- /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { role: "note", css: ObjectSearchResultListCounterContainer, children: [
6468
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { css: ObjectSearchResultListTitle, children: resultLabelText }),
7076
+ return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_jsx_runtime59.Fragment, { children: [
7077
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { role: "group", css: ObjectSearchResultListContainer, children: [
7078
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { role: "note", css: ObjectSearchResultListCounterContainer, children: [
7079
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { css: ObjectSearchResultListTitle, children: resultLabelText }),
6469
7080
  " ",
6470
- !selectedListItems.length ? null : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_design_system31.Counter, { count: selectedListItems.length })
7081
+ !selectedListItems.length ? null : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_design_system33.Counter, { count: selectedListItems.length })
6471
7082
  ] }),
6472
- /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { css: ObjectSearchResultListCounterContainer, children: [
7083
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { css: ObjectSearchResultListCounterContainer, children: [
6473
7084
  additionalButtons,
6474
- hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
6475
- import_design_system31.Button,
7085
+ hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
7086
+ import_design_system33.Button,
6476
7087
  {
6477
7088
  buttonType: "ghostDestructive",
6478
7089
  size: "xs",
@@ -6483,33 +7094,20 @@ function ObjectSearchResultList({
6483
7094
  )
6484
7095
  ] })
6485
7096
  ] }),
6486
- !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: [
7097
+ !selectedListItems.length ? whenNothingSelected : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_react_beautiful_dnd3.DragDropContext, { onDragEnd: (res) => onDragEnd(res), children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_react_beautiful_dnd3.Droppable, { droppableId: multiSelectId != null ? multiSelectId : "canvas-multi-select", children: (provided) => /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { ...provided.droppableProps, ref: provided.innerRef, children: [
6487
7098
  selectedListItems.map((item, i2) => {
6488
- const itemValues = selectedListItems.length === 1 ? { ...item, disableDnD: true } : { ...item, disableDnD };
6489
- const renderListItem = renderResultComponent(itemValues);
6490
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
6491
- import_react_beautiful_dnd3.Draggable,
7099
+ const renderListItem = renderResultComponent(item);
7100
+ return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_react_beautiful_dnd3.Draggable, { draggableId: item.id, index: i2, isDragDisabled: disableDnD, children: (provided2, snapshot) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
7101
+ "div",
6492
7102
  {
6493
- draggableId: item.id,
6494
- index: i2,
6495
- isDragDisabled: selectedListItems.length === 1 || disableDnD,
6496
- children: (provided2, snapshot) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
6497
- "div",
6498
- {
6499
- css: [
6500
- ObjectSearchDragContainer,
6501
- snapshot.isDragging ? ObjectSearchContainerDragging : void 0
6502
- ],
6503
- ref: provided2.innerRef,
6504
- "data-dragging": snapshot.isDragging,
6505
- ...provided2.draggableProps,
6506
- ...provided2.dragHandleProps,
6507
- children: renderListItem
6508
- }
6509
- )
6510
- },
6511
- item.id
6512
- );
7103
+ css: ObjectSearchDragContainer,
7104
+ ref: provided2.innerRef,
7105
+ "data-dragging": snapshot.isDragging,
7106
+ ...provided2.draggableProps,
7107
+ ...provided2.dragHandleProps,
7108
+ children: renderListItem
7109
+ }
7110
+ ) }, item.id);
6513
7111
  }),
6514
7112
  provided.placeholder
6515
7113
  ] }) }) })
@@ -6518,9 +7116,9 @@ function ObjectSearchResultList({
6518
7116
 
6519
7117
  // src/components/ObjectSearch/QueryFilter.tsx
6520
7118
  init_emotion_jsx_shim();
6521
- var import_design_system32 = require("@uniformdev/design-system");
6522
- var import_react51 = require("react");
6523
- var import_jsx_runtime56 = require("@emotion/react/jsx-runtime");
7119
+ var import_design_system34 = require("@uniformdev/design-system");
7120
+ var import_react58 = require("react");
7121
+ var import_jsx_runtime60 = require("@emotion/react/jsx-runtime");
6524
7122
  var QueryFilter = ({
6525
7123
  requireContentType,
6526
7124
  queryFilterTitle = "Configure Query",
@@ -6551,7 +7149,7 @@ var QueryFilter = ({
6551
7149
  }) => {
6552
7150
  var _a, _b, _c, _d;
6553
7151
  const { query, onSetQuery } = useObjectSearchContext();
6554
- const [queryState, setQueryState] = (0, import_react51.useState)({
7152
+ const [queryState, setQueryState] = (0, import_react58.useState)({
6555
7153
  contentType: "",
6556
7154
  keyword: "",
6557
7155
  count: countValue != null ? countValue : 5,
@@ -6562,13 +7160,13 @@ var QueryFilter = ({
6562
7160
  setQueryState((prev) => ({ ...prev, ...value }));
6563
7161
  onSetQuery({ ...query, ...value });
6564
7162
  };
6565
- (0, import_react51.useEffect)(() => {
7163
+ (0, import_react58.useEffect)(() => {
6566
7164
  onSetQuery(queryState);
6567
7165
  }, [onSetQuery, queryState]);
6568
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("fieldset", { children: [
6569
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { css: ObjectSearchFilterContainerLabel, children: queryFilterTitle }),
6570
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { css: ObjectSearchFilterContainer, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_design_system32.VerticalRhythm, { children: [
6571
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7166
+ return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("fieldset", { children: [
7167
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { css: ObjectSearchFilterContainerLabel, children: queryFilterTitle }),
7168
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { css: ObjectSearchFilterContainer, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_design_system34.VerticalRhythm, { children: [
7169
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
6572
7170
  InputVariables,
6573
7171
  {
6574
7172
  label: searchInputLabel,
@@ -6576,8 +7174,8 @@ var QueryFilter = ({
6576
7174
  onChange: (newQuery) => handleFilterChange({ keyword: newQuery }),
6577
7175
  disableInlineMenu: true,
6578
7176
  id: "qf_searchText",
6579
- inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
6580
- import_design_system32.InputKeywordSearch,
7177
+ inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
7178
+ import_design_system34.InputKeywordSearch,
6581
7179
  {
6582
7180
  id: "qf_searchText",
6583
7181
  inputFieldName: searchInputName,
@@ -6590,8 +7188,8 @@ var QueryFilter = ({
6590
7188
  )
6591
7189
  }
6592
7190
  ),
6593
- /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { css: ObjectSearchFilterGrid("1fr 100px"), children: [
6594
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7191
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { css: ObjectSearchFilterGrid("1fr 100px"), children: [
7192
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
6595
7193
  InputVariables,
6596
7194
  {
6597
7195
  label: contentTypeLabel,
@@ -6599,8 +7197,8 @@ var QueryFilter = ({
6599
7197
  value: (_d = queryState.contentType) != null ? _d : "",
6600
7198
  onChange: (newType) => handleFilterChange({ contentType: newType }),
6601
7199
  disableInlineMenu: true,
6602
- inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
6603
- import_design_system32.InputSelect,
7200
+ inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
7201
+ import_design_system34.InputSelect,
6604
7202
  {
6605
7203
  id: "qf_contentType",
6606
7204
  label: contentTypeLabel,
@@ -6618,7 +7216,7 @@ var QueryFilter = ({
6618
7216
  )
6619
7217
  }
6620
7218
  ),
6621
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7219
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
6622
7220
  InputVariables,
6623
7221
  {
6624
7222
  label: countLabel,
@@ -6626,8 +7224,8 @@ var QueryFilter = ({
6626
7224
  value: queryState.count.toString(10),
6627
7225
  onChange: (newCount) => handleFilterChange({ count: newCount }),
6628
7226
  disableInlineMenu: true,
6629
- inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
6630
- import_design_system32.Input,
7227
+ inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
7228
+ import_design_system34.Input,
6631
7229
  {
6632
7230
  id: "qf_count",
6633
7231
  label: countLabel,
@@ -6641,8 +7239,8 @@ var QueryFilter = ({
6641
7239
  }
6642
7240
  )
6643
7241
  ] }),
6644
- /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { css: ObjectSearchFilterGrid("2fr 1fr"), children: [
6645
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7242
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { css: ObjectSearchFilterGrid("2fr 1fr"), children: [
7243
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
6646
7244
  InputVariables,
6647
7245
  {
6648
7246
  id: "qf_sortBy",
@@ -6650,8 +7248,8 @@ var QueryFilter = ({
6650
7248
  value: queryState.sortBy,
6651
7249
  onChange: (newSortBy) => handleFilterChange({ sortBy: newSortBy }),
6652
7250
  disableInlineMenu: true,
6653
- inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
6654
- import_design_system32.InputSelect,
7251
+ inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
7252
+ import_design_system34.InputSelect,
6655
7253
  {
6656
7254
  label: sortLabel,
6657
7255
  id: "qf_sortBy",
@@ -6672,7 +7270,7 @@ var QueryFilter = ({
6672
7270
  )
6673
7271
  }
6674
7272
  ),
6675
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7273
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
6676
7274
  InputVariables,
6677
7275
  {
6678
7276
  label: sortOrderLabel,
@@ -6680,8 +7278,8 @@ var QueryFilter = ({
6680
7278
  value: queryState.sortOrder,
6681
7279
  onChange: (newSort) => handleFilterChange({ sortOrder: newSort }),
6682
7280
  disableInlineMenu: true,
6683
- inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
6684
- import_design_system32.InputSelect,
7281
+ inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
7282
+ import_design_system34.InputSelect,
6685
7283
  {
6686
7284
  label: sortOrderLabel,
6687
7285
  id: "qf_sortOrder",
@@ -6706,7 +7304,7 @@ var QueryFilter = ({
6706
7304
 
6707
7305
  // src/hooks/index.ts
6708
7306
  init_emotion_jsx_shim();
6709
- var import_design_system33 = require("@uniformdev/design-system");
7307
+ var import_design_system35 = require("@uniformdev/design-system");
6710
7308
 
6711
7309
  // src/utils/createLocationValidator.ts
6712
7310
  init_emotion_jsx_shim();
@@ -6718,7 +7316,7 @@ function createLocationValidator(setValue, validate) {
6718
7316
  }
6719
7317
 
6720
7318
  // src/index.ts
6721
- var import_design_system34 = require("@uniformdev/design-system");
7319
+ var import_design_system36 = require("@uniformdev/design-system");
6722
7320
  __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
6723
7321
  // Annotate the CommonJS export names for ESM import in node:
6724
7322
  0 && (module.exports = {
@@ -6876,7 +7474,6 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
6876
7474
  useRequestParameter,
6877
7475
  useUniformMeshSdk,
6878
7476
  useVariables,
6879
- variableExpression,
6880
7477
  variablePrefix,
6881
7478
  variableSuffix,
6882
7479
  variablesToList,