@uniformdev/mesh-sdk-react 19.79.1-alpha.13 → 19.79.1-alpha.25
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/LICENSE.txt +1 -1
- package/dist/index.d.mts +90 -17
- package/dist/index.d.ts +90 -17
- package/dist/index.esm.js +463 -329
- package/dist/index.js +530 -407
- package/dist/index.mjs +463 -329
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -33,9 +33,9 @@ var src_exports = {};
|
|
|
33
33
|
__export(src_exports, {
|
|
34
34
|
$createVariableNode: () => $createVariableNode,
|
|
35
35
|
$isVariableNode: () => $isVariableNode,
|
|
36
|
-
AddListButton: () =>
|
|
37
|
-
Button: () =>
|
|
38
|
-
Callout: () =>
|
|
36
|
+
AddListButton: () => import_design_system43.AddListButton,
|
|
37
|
+
Button: () => import_design_system43.Button,
|
|
38
|
+
Callout: () => import_design_system43.Callout,
|
|
39
39
|
ControlledValuePlugin: () => ControlledValuePlugin,
|
|
40
40
|
DISCONNECT_VARIABLE_COMMAND: () => DISCONNECT_VARIABLE_COMMAND,
|
|
41
41
|
DamSelectedItem: () => DamSelectedItem,
|
|
@@ -47,24 +47,24 @@ __export(src_exports, {
|
|
|
47
47
|
DataTypeEditor: () => DataTypeEditor,
|
|
48
48
|
DefaultSearchRow: () => DefaultSearchRow,
|
|
49
49
|
DefaultSelectedItem: () => DefaultSelectedItem,
|
|
50
|
-
DrawerContent: () =>
|
|
50
|
+
DrawerContent: () => import_design_system43.DrawerContent,
|
|
51
51
|
EDIT_VARIABLE_COMMAND: () => EDIT_VARIABLE_COMMAND,
|
|
52
52
|
EntrySearch: () => EntrySearch,
|
|
53
|
-
Heading: () =>
|
|
53
|
+
Heading: () => import_design_system43.Heading,
|
|
54
54
|
INSERT_VARIABLE_COMMAND: () => INSERT_VARIABLE_COMMAND,
|
|
55
55
|
Icons: () => icons_exports,
|
|
56
|
-
Input: () =>
|
|
57
|
-
InputComboBox: () =>
|
|
58
|
-
InputKeywordSearch: () =>
|
|
59
|
-
InputSelect: () =>
|
|
60
|
-
InputToggle: () =>
|
|
56
|
+
Input: () => import_design_system43.Input,
|
|
57
|
+
InputComboBox: () => import_design_system43.InputComboBox,
|
|
58
|
+
InputKeywordSearch: () => import_design_system43.InputKeywordSearch,
|
|
59
|
+
InputSelect: () => import_design_system43.InputSelect,
|
|
60
|
+
InputToggle: () => import_design_system43.InputToggle,
|
|
61
61
|
InputVariables: () => InputVariables,
|
|
62
|
-
Label: () =>
|
|
62
|
+
Label: () => import_design_system43.Label,
|
|
63
63
|
LinkButton: () => LinkButton,
|
|
64
|
-
LoadingIndicator: () =>
|
|
65
|
-
LoadingOverlay: () =>
|
|
66
|
-
Menu: () =>
|
|
67
|
-
MenuItem: () =>
|
|
64
|
+
LoadingIndicator: () => import_design_system43.LoadingIndicator,
|
|
65
|
+
LoadingOverlay: () => import_design_system43.LoadingOverlay,
|
|
66
|
+
Menu: () => import_design_system43.Menu,
|
|
67
|
+
MenuItem: () => import_design_system43.MenuItem,
|
|
68
68
|
MeshApp: () => MeshApp,
|
|
69
69
|
OPEN_INSERT_VARIABLE_COMMAND: () => OPEN_INSERT_VARIABLE_COMMAND,
|
|
70
70
|
ObjectSearchContainer: () => ObjectSearchContainer,
|
|
@@ -78,22 +78,22 @@ __export(src_exports, {
|
|
|
78
78
|
ObjectSearchResultList: () => ObjectSearchResultList,
|
|
79
79
|
ParamTypeDynamicDataProvider: () => ParamTypeDynamicDataProvider,
|
|
80
80
|
ParameterConnectionIndicator: () => ParameterConnectionIndicator,
|
|
81
|
-
ParameterGroup: () =>
|
|
82
|
-
ParameterImage: () =>
|
|
83
|
-
ParameterImageInner: () =>
|
|
84
|
-
ParameterInput: () =>
|
|
85
|
-
ParameterInputInner: () =>
|
|
86
|
-
ParameterLabel: () =>
|
|
87
|
-
ParameterMenuButton: () =>
|
|
81
|
+
ParameterGroup: () => import_design_system43.ParameterGroup,
|
|
82
|
+
ParameterImage: () => import_design_system43.ParameterImage,
|
|
83
|
+
ParameterImageInner: () => import_design_system43.ParameterImageInner,
|
|
84
|
+
ParameterInput: () => import_design_system43.ParameterInput,
|
|
85
|
+
ParameterInputInner: () => import_design_system43.ParameterInputInner,
|
|
86
|
+
ParameterLabel: () => import_design_system43.ParameterLabel,
|
|
87
|
+
ParameterMenuButton: () => import_design_system43.ParameterMenuButton,
|
|
88
88
|
ParameterOrSingleVariable: () => ParameterOrSingleVariable,
|
|
89
|
-
ParameterSelect: () =>
|
|
90
|
-
ParameterSelectInner: () =>
|
|
91
|
-
ParameterShell: () =>
|
|
89
|
+
ParameterSelect: () => import_design_system43.ParameterSelect,
|
|
90
|
+
ParameterSelectInner: () => import_design_system43.ParameterSelectInner,
|
|
91
|
+
ParameterShell: () => import_design_system43.ParameterShell,
|
|
92
92
|
ParameterShellContext: () => import_design_system14.ParameterShellContext,
|
|
93
|
-
ParameterTextarea: () =>
|
|
94
|
-
ParameterTextareaInner: () =>
|
|
95
|
-
ParameterToggle: () =>
|
|
96
|
-
ParameterToggleInner: () =>
|
|
93
|
+
ParameterTextarea: () => import_design_system43.ParameterTextarea,
|
|
94
|
+
ParameterTextareaInner: () => import_design_system43.ParameterTextareaInner,
|
|
95
|
+
ParameterToggle: () => import_design_system43.ParameterToggle,
|
|
96
|
+
ParameterToggleInner: () => import_design_system43.ParameterToggleInner,
|
|
97
97
|
ParameterVariables: () => ParameterVariables,
|
|
98
98
|
ProductPreviewList: () => ProductPreviewList,
|
|
99
99
|
ProductQuery: () => ProductQuery,
|
|
@@ -112,19 +112,20 @@ __export(src_exports, {
|
|
|
112
112
|
RequestUrl: () => RequestUrl,
|
|
113
113
|
RequestUrlInput: () => RequestUrlInput,
|
|
114
114
|
ResolvableLoadingValue: () => ResolvableLoadingValue,
|
|
115
|
-
ScrollableList: () =>
|
|
116
|
-
ScrollableListItem: () =>
|
|
115
|
+
ScrollableList: () => import_design_system43.ScrollableList,
|
|
116
|
+
ScrollableListItem: () => import_design_system43.ScrollableListItem,
|
|
117
117
|
SelectionField: () => SelectionField,
|
|
118
|
-
Switch: () =>
|
|
118
|
+
Switch: () => import_design_system43.Switch,
|
|
119
119
|
TextVariableRenderer: () => TextVariableRenderer,
|
|
120
|
-
Textarea: () =>
|
|
121
|
-
Theme: () =>
|
|
120
|
+
Textarea: () => import_design_system43.Textarea,
|
|
121
|
+
Theme: () => import_design_system43.Theme,
|
|
122
122
|
VariableEditor: () => VariableEditor,
|
|
123
123
|
VariableNode: () => VariableNode,
|
|
124
124
|
VariablesList: () => VariablesList,
|
|
125
125
|
VariablesPlugin: () => VariablesPlugin,
|
|
126
126
|
VariablesProvider: () => VariablesProvider,
|
|
127
127
|
badgeIcon: () => badgeIcon,
|
|
128
|
+
bindableFiltersMapper: () => bindableFiltersMapper,
|
|
128
129
|
convertConnectedDataToVariable: () => convertConnectedDataToVariable,
|
|
129
130
|
createLocationValidator: () => createLocationValidator,
|
|
130
131
|
damSelectItemImage: () => damSelectItemImage,
|
|
@@ -3242,23 +3243,67 @@ var variablesTipText = import_react33.css`
|
|
|
3242
3243
|
padding: 0 var(--spacing-sm);
|
|
3243
3244
|
`;
|
|
3244
3245
|
|
|
3245
|
-
// src/components/Variables/useVariableEditor.ts
|
|
3246
|
-
var import_react37 = require("react");
|
|
3247
|
-
|
|
3248
3246
|
// src/components/Variables/VariablesProvider.tsx
|
|
3249
3247
|
var import_mitt = __toESM(require("mitt"));
|
|
3250
|
-
var
|
|
3248
|
+
var import_react37 = require("react");
|
|
3249
|
+
|
|
3250
|
+
// src/components/Variables/util/useVariableEditTransaction.ts
|
|
3251
|
+
var import_react34 = require("react");
|
|
3252
|
+
function useVariableEditTransaction({
|
|
3253
|
+
events,
|
|
3254
|
+
dispatch,
|
|
3255
|
+
isEditing,
|
|
3256
|
+
variables
|
|
3257
|
+
}) {
|
|
3258
|
+
const [isEditingBinding, setIsEditingBinding] = (0, import_react34.useState)();
|
|
3259
|
+
(0, import_react34.useEffect)(() => {
|
|
3260
|
+
if (!isEditingBinding) {
|
|
3261
|
+
return;
|
|
3262
|
+
}
|
|
3263
|
+
const fn = (e) => {
|
|
3264
|
+
isEditingBinding.resolve(e);
|
|
3265
|
+
setIsEditingBinding(void 0);
|
|
3266
|
+
};
|
|
3267
|
+
events.on("editCompleted", fn);
|
|
3268
|
+
return () => events.off("editCompleted", fn);
|
|
3269
|
+
}, [events, isEditingBinding, variables]);
|
|
3270
|
+
(0, import_react34.useEffect)(() => {
|
|
3271
|
+
if (!isEditing) {
|
|
3272
|
+
if (isEditingBinding) {
|
|
3273
|
+
isEditingBinding.resolve({ canceled: true });
|
|
3274
|
+
}
|
|
3275
|
+
setIsEditingBinding(void 0);
|
|
3276
|
+
}
|
|
3277
|
+
}, [isEditing, isEditingBinding]);
|
|
3278
|
+
return (0, import_react34.useCallback)(
|
|
3279
|
+
async function editVariableTxn(variable, context) {
|
|
3280
|
+
if (isEditingBinding) {
|
|
3281
|
+
dispatch({ type: "cancelEdit" });
|
|
3282
|
+
}
|
|
3283
|
+
return new Promise((resolve) => {
|
|
3284
|
+
setTimeout(() => {
|
|
3285
|
+
setIsEditingBinding({
|
|
3286
|
+
resolve,
|
|
3287
|
+
variable
|
|
3288
|
+
});
|
|
3289
|
+
dispatch({ type: "edit", variable, context });
|
|
3290
|
+
});
|
|
3291
|
+
});
|
|
3292
|
+
},
|
|
3293
|
+
[dispatch, isEditingBinding]
|
|
3294
|
+
);
|
|
3295
|
+
}
|
|
3251
3296
|
|
|
3252
3297
|
// src/components/Variables/VariableEditor.tsx
|
|
3253
3298
|
var import_zod = require("@hookform/resolvers/zod");
|
|
3254
3299
|
var import_design_system16 = require("@uniformdev/design-system");
|
|
3255
|
-
var
|
|
3300
|
+
var import_react36 = require("react");
|
|
3256
3301
|
var import_react_hook_form = require("react-hook-form");
|
|
3257
3302
|
var import_zod2 = require("zod");
|
|
3258
3303
|
|
|
3259
3304
|
// src/components/Variables/styles/VariableEditor.styles.ts
|
|
3260
|
-
var
|
|
3261
|
-
var variablesFormContainer =
|
|
3305
|
+
var import_react35 = require("@emotion/react");
|
|
3306
|
+
var variablesFormContainer = import_react35.css`
|
|
3262
3307
|
> * {
|
|
3263
3308
|
margin: var(--spacing-base) 0 0;
|
|
3264
3309
|
}
|
|
@@ -3278,9 +3323,10 @@ function VariableEditor({
|
|
|
3278
3323
|
variable,
|
|
3279
3324
|
onSubmit,
|
|
3280
3325
|
onCancel,
|
|
3326
|
+
showDisplayName,
|
|
3281
3327
|
disableMeshTip
|
|
3282
3328
|
}) {
|
|
3283
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
3329
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3284
3330
|
const { variables } = useVariables();
|
|
3285
3331
|
const currentVariable = variables[variable];
|
|
3286
3332
|
const { register, handleSubmit, formState } = (0, import_react_hook_form.useForm)({
|
|
@@ -3310,9 +3356,9 @@ function VariableEditor({
|
|
|
3310
3356
|
},
|
|
3311
3357
|
activeWhenEditing: true
|
|
3312
3358
|
});
|
|
3313
|
-
const nameRef = (0,
|
|
3359
|
+
const nameRef = (0, import_react36.useRef)(null);
|
|
3314
3360
|
const { ref, ...nameRegister } = register("name");
|
|
3315
|
-
(0,
|
|
3361
|
+
(0, import_react36.useLayoutEffect)(() => {
|
|
3316
3362
|
if (nameRef.current && !nameRef.current.value) {
|
|
3317
3363
|
nameRef.current.focus();
|
|
3318
3364
|
}
|
|
@@ -3335,6 +3381,16 @@ function VariableEditor({
|
|
|
3335
3381
|
}
|
|
3336
3382
|
}
|
|
3337
3383
|
),
|
|
3384
|
+
showDisplayName ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3385
|
+
import_design_system16.Input,
|
|
3386
|
+
{
|
|
3387
|
+
...register("displayName"),
|
|
3388
|
+
label: "Display name",
|
|
3389
|
+
autoComplete: "off",
|
|
3390
|
+
caption: "This is the name that will be displayed in the UI. If not provided, the name will be used.",
|
|
3391
|
+
errorMessage: (_f = formState.errors.helpText) == null ? void 0 : _f.message
|
|
3392
|
+
}
|
|
3393
|
+
) : null,
|
|
3338
3394
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3339
3395
|
import_design_system16.Input,
|
|
3340
3396
|
{
|
|
@@ -3342,7 +3398,7 @@ function VariableEditor({
|
|
|
3342
3398
|
label: "Help Text",
|
|
3343
3399
|
caption: "Appears when entering a value for this variable.",
|
|
3344
3400
|
autoComplete: "off",
|
|
3345
|
-
errorMessage: (
|
|
3401
|
+
errorMessage: (_g = formState.errors.helpText) == null ? void 0 : _g.message
|
|
3346
3402
|
}
|
|
3347
3403
|
),
|
|
3348
3404
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
@@ -3351,7 +3407,7 @@ function VariableEditor({
|
|
|
3351
3407
|
...register("default"),
|
|
3352
3408
|
label: "Default Value",
|
|
3353
3409
|
autoComplete: "off",
|
|
3354
|
-
errorMessage: (
|
|
3410
|
+
errorMessage: (_h = formState.errors.default) == null ? void 0 : _h.message
|
|
3355
3411
|
}
|
|
3356
3412
|
),
|
|
3357
3413
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system16.HorizontalRhythm, { justify: "space-between", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_design_system16.HorizontalRhythm, { gap: "sm", children: [
|
|
@@ -3378,7 +3434,7 @@ function VariableEditor({
|
|
|
3378
3434
|
|
|
3379
3435
|
// src/components/Variables/VariablesProvider.tsx
|
|
3380
3436
|
var import_jsx_runtime32 = require("@emotion/react/jsx-runtime");
|
|
3381
|
-
var VariablesContext = (0,
|
|
3437
|
+
var VariablesContext = (0, import_react37.createContext)(null);
|
|
3382
3438
|
function VariablesProvider({
|
|
3383
3439
|
value,
|
|
3384
3440
|
onChange,
|
|
@@ -3388,9 +3444,9 @@ function VariablesProvider({
|
|
|
3388
3444
|
children,
|
|
3389
3445
|
knownUndefinedValues = {}
|
|
3390
3446
|
}) {
|
|
3391
|
-
const [editing, setEditing] = (0,
|
|
3392
|
-
const [editingContext, setEditingContext] = (0,
|
|
3393
|
-
const events = (0,
|
|
3447
|
+
const [editing, setEditing] = (0, import_react37.useState)();
|
|
3448
|
+
const [editingContext, setEditingContext] = (0, import_react37.useState)();
|
|
3449
|
+
const events = (0, import_react37.useMemo)(
|
|
3394
3450
|
() => (0, import_mitt.default)(),
|
|
3395
3451
|
[]
|
|
3396
3452
|
);
|
|
@@ -3398,7 +3454,7 @@ function VariablesProvider({
|
|
|
3398
3454
|
throw new Error("onChange must be provided when readOnly is false");
|
|
3399
3455
|
}
|
|
3400
3456
|
const Editor = editVariableComponent != null ? editVariableComponent : VariableEditor;
|
|
3401
|
-
const valueBasedContextValue = (0,
|
|
3457
|
+
const valueBasedContextValue = (0, import_react37.useMemo)(
|
|
3402
3458
|
() => ({
|
|
3403
3459
|
flatVariables: flattenVariables(value),
|
|
3404
3460
|
dispatch: (event) => {
|
|
@@ -3436,16 +3492,23 @@ function VariablesProvider({
|
|
|
3436
3492
|
}),
|
|
3437
3493
|
[onChange, readOnly, value]
|
|
3438
3494
|
);
|
|
3439
|
-
const
|
|
3495
|
+
const editVariableTxn = useVariableEditTransaction({
|
|
3496
|
+
events,
|
|
3497
|
+
dispatch: valueBasedContextValue.dispatch,
|
|
3498
|
+
isEditing: typeof editing !== "undefined",
|
|
3499
|
+
variables: value
|
|
3500
|
+
});
|
|
3501
|
+
const contextValue = (0, import_react37.useMemo)(() => {
|
|
3440
3502
|
return {
|
|
3441
3503
|
...valueBasedContextValue,
|
|
3504
|
+
editVariableTxn,
|
|
3442
3505
|
isEditing: typeof editing !== "undefined",
|
|
3443
3506
|
events,
|
|
3444
3507
|
canDispatch: true,
|
|
3445
3508
|
knownUndefinedValues,
|
|
3446
3509
|
isLoading: !!isLoading
|
|
3447
3510
|
};
|
|
3448
|
-
}, [editing, events, knownUndefinedValues,
|
|
3511
|
+
}, [valueBasedContextValue, editVariableTxn, editing, events, knownUndefinedValues, isLoading]);
|
|
3449
3512
|
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(VariablesContext.Provider, { value: contextValue, children: [
|
|
3450
3513
|
children,
|
|
3451
3514
|
typeof editing !== "undefined" ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
@@ -3476,7 +3539,7 @@ function VariablesProvider({
|
|
|
3476
3539
|
] });
|
|
3477
3540
|
}
|
|
3478
3541
|
function useVariables(returnEmptyWithoutProvider = false) {
|
|
3479
|
-
const context = (0,
|
|
3542
|
+
const context = (0, import_react37.useContext)(VariablesContext);
|
|
3480
3543
|
if (!context) {
|
|
3481
3544
|
if (returnEmptyWithoutProvider) {
|
|
3482
3545
|
return {
|
|
@@ -3484,6 +3547,9 @@ function useVariables(returnEmptyWithoutProvider = false) {
|
|
|
3484
3547
|
dispatch: () => {
|
|
3485
3548
|
throw new Error("No VariablesProvider present");
|
|
3486
3549
|
},
|
|
3550
|
+
editVariableTxn: async () => {
|
|
3551
|
+
throw new Error("No VariablesProvider present");
|
|
3552
|
+
},
|
|
3487
3553
|
events: (0, import_mitt.default)(),
|
|
3488
3554
|
isEditing: false,
|
|
3489
3555
|
variables: {},
|
|
@@ -3506,39 +3572,13 @@ function flattenVariables(variables) {
|
|
|
3506
3572
|
|
|
3507
3573
|
// src/components/Variables/useVariableEditor.ts
|
|
3508
3574
|
function useVariableEditor() {
|
|
3509
|
-
const {
|
|
3510
|
-
const [isEditingBinding, setIsEditingBinding] = (0, import_react37.useState)();
|
|
3511
|
-
(0, import_react37.useEffect)(() => {
|
|
3512
|
-
if (!canDispatch || !isEditingBinding) {
|
|
3513
|
-
return;
|
|
3514
|
-
}
|
|
3515
|
-
const fn = (e) => {
|
|
3516
|
-
isEditingBinding.resolve(e);
|
|
3517
|
-
setIsEditingBinding(void 0);
|
|
3518
|
-
};
|
|
3519
|
-
events.on("editCompleted", fn);
|
|
3520
|
-
return () => events.off("editCompleted", fn);
|
|
3521
|
-
}, [canDispatch, events, isEditingBinding, variables]);
|
|
3522
|
-
(0, import_react37.useEffect)(() => {
|
|
3523
|
-
if (!isEditing) {
|
|
3524
|
-
setIsEditingBinding(void 0);
|
|
3525
|
-
}
|
|
3526
|
-
}, [isEditing]);
|
|
3575
|
+
const { editVariableTxn, canDispatch } = useVariables(true);
|
|
3527
3576
|
return {
|
|
3528
3577
|
async editVariable(variable, context) {
|
|
3529
3578
|
if (!canDispatch) {
|
|
3530
3579
|
throw new Error("Cannot edit variable. VariablesProvider is not mounted.");
|
|
3531
3580
|
}
|
|
3532
|
-
|
|
3533
|
-
throw new Error("Cannot edit variable. Another variable is already being edited.");
|
|
3534
|
-
}
|
|
3535
|
-
return new Promise((resolve) => {
|
|
3536
|
-
setIsEditingBinding({
|
|
3537
|
-
resolve,
|
|
3538
|
-
variable
|
|
3539
|
-
});
|
|
3540
|
-
dispatch({ type: "edit", variable, context });
|
|
3541
|
-
});
|
|
3581
|
+
return editVariableTxn(variable, context);
|
|
3542
3582
|
}
|
|
3543
3583
|
};
|
|
3544
3584
|
}
|
|
@@ -3776,6 +3816,15 @@ function VariablesPlugin({
|
|
|
3776
3816
|
editor.dispatchCommand(DISCONNECT_VARIABLE_COMMAND, { sourceKey });
|
|
3777
3817
|
return;
|
|
3778
3818
|
}
|
|
3819
|
+
editor.update(() => {
|
|
3820
|
+
const selection = (0, import_lexical3.$getSelection)();
|
|
3821
|
+
if ((0, import_lexical3.$isNodeSelection)(selection)) {
|
|
3822
|
+
const selectedNodes = selection.getNodes();
|
|
3823
|
+
if (selectedNodes.every((node) => $isVariableNode(node))) {
|
|
3824
|
+
(0, import_lexical3.$setSelection)(null);
|
|
3825
|
+
}
|
|
3826
|
+
}
|
|
3827
|
+
});
|
|
3779
3828
|
return;
|
|
3780
3829
|
}
|
|
3781
3830
|
editor.dispatchCommand(INSERT_VARIABLE_COMMAND, {
|
|
@@ -4183,8 +4232,9 @@ function $isTargetWithinDecorator(target) {
|
|
|
4183
4232
|
}
|
|
4184
4233
|
|
|
4185
4234
|
// src/components/Variables/InputVariables.tsx
|
|
4186
|
-
var
|
|
4187
|
-
var
|
|
4235
|
+
var import_react51 = require("@emotion/react");
|
|
4236
|
+
var import_design_system21 = require("@uniformdev/design-system");
|
|
4237
|
+
var import_react52 = require("react");
|
|
4188
4238
|
var import_uuid2 = require("uuid");
|
|
4189
4239
|
|
|
4190
4240
|
// src/components/Variables/composer/EditorRefPlugin.tsx
|
|
@@ -4244,32 +4294,41 @@ var menuBtn2 = import_react42.css`
|
|
|
4244
4294
|
transform: translateY(-50%);
|
|
4245
4295
|
`;
|
|
4246
4296
|
var input = import_react42.css`
|
|
4297
|
+
--input-padding: 12px var(--spacing-base) 12px var(--spacing-sm);
|
|
4247
4298
|
appearance: none;
|
|
4248
4299
|
background-color: var(--white);
|
|
4249
|
-
border: 1px solid var(--gray-
|
|
4300
|
+
border: 1px solid var(--gray-300);
|
|
4250
4301
|
border-radius: var(--rounded-sm);
|
|
4251
4302
|
color: var(--gray-700);
|
|
4252
|
-
padding
|
|
4253
|
-
|
|
4254
|
-
padding-right: var(--spacing-lg);
|
|
4255
|
-
line-height: 1.75;
|
|
4303
|
+
padding: var(--input-padding);
|
|
4304
|
+
min-height: 50px;
|
|
4256
4305
|
width: 100%;
|
|
4257
4306
|
position: relative;
|
|
4258
4307
|
transition: background var(--duration-fast) var(--timing-ease-out),
|
|
4259
4308
|
border-color var(--duration-fast) var(--timing-ease-out),
|
|
4260
|
-
color var(--duration-fast) var(--timing-ease-out);
|
|
4309
|
+
color var(--duration-fast) var(--timing-ease-out), box-shadow var(--duration-fast) var(--timing-ease-out);
|
|
4310
|
+
|
|
4311
|
+
&::placeholder {
|
|
4312
|
+
color: var(--gray-400);
|
|
4313
|
+
}
|
|
4261
4314
|
|
|
4315
|
+
&:hover {
|
|
4316
|
+
border-color: var(--accent-dark-hover);
|
|
4317
|
+
}
|
|
4318
|
+
|
|
4319
|
+
&[data-focus='true'],
|
|
4262
4320
|
&:focus,
|
|
4263
4321
|
&:focus-within {
|
|
4264
|
-
border-color: var(--
|
|
4265
|
-
box-shadow:
|
|
4322
|
+
border-color: var(--accent-dark-active);
|
|
4323
|
+
box-shadow: var(--elevation-100);
|
|
4266
4324
|
outline: none;
|
|
4267
4325
|
}
|
|
4268
4326
|
|
|
4327
|
+
&[data-disabled='true'],
|
|
4269
4328
|
&:disabled,
|
|
4270
4329
|
&:disabled::placeholder {
|
|
4271
4330
|
cursor: not-allowed;
|
|
4272
|
-
color: var(--gray-
|
|
4331
|
+
color: var(--gray-300);
|
|
4273
4332
|
border-color: var(--gray-300);
|
|
4274
4333
|
}
|
|
4275
4334
|
|
|
@@ -4299,9 +4358,102 @@ var placeholderCompact = import_react42.css`
|
|
|
4299
4358
|
inset: var(--spacing-sm) var(--spacing-lg) var(--spacing-sm) var(--spacing-base);
|
|
4300
4359
|
`;
|
|
4301
4360
|
|
|
4361
|
+
// src/components/Variables/styles/ParameterVariables.styles.ts
|
|
4362
|
+
var import_react43 = require("@emotion/react");
|
|
4363
|
+
var import_design_system19 = require("@uniformdev/design-system");
|
|
4364
|
+
var variableBindButton = import_react43.css`
|
|
4365
|
+
align-items: center;
|
|
4366
|
+
border: none;
|
|
4367
|
+
border-radius: var(--rounded-base);
|
|
4368
|
+
background: none;
|
|
4369
|
+
display: flex;
|
|
4370
|
+
height: 1.2rem;
|
|
4371
|
+
padding: var(--spacing-2xs);
|
|
4372
|
+
transition: background var(--duration-fast) var(--timing-ease-out),
|
|
4373
|
+
color var(--duration-fast) var(--timing-ease-out);
|
|
4374
|
+
width: 1.2rem;
|
|
4375
|
+
|
|
4376
|
+
&:hover,
|
|
4377
|
+
&[aria-pressed='true']:not(:disabled) {
|
|
4378
|
+
background: var(--brand-secondary-3);
|
|
4379
|
+
color: var(--white);
|
|
4380
|
+
}
|
|
4381
|
+
|
|
4382
|
+
&[aria-disabled='true'] {
|
|
4383
|
+
background: none;
|
|
4384
|
+
color: currentColor;
|
|
4385
|
+
}
|
|
4386
|
+
|
|
4387
|
+
// fixes menu resizing issue within iframes
|
|
4388
|
+
// see https://linear.app/uniform/issue/UNI-3068/mesh-integration-resizing-with-menus
|
|
4389
|
+
+ [role='menu'] {
|
|
4390
|
+
max-height: unset;
|
|
4391
|
+
}
|
|
4392
|
+
`;
|
|
4393
|
+
var input2 = import_react43.css`
|
|
4394
|
+
display: block;
|
|
4395
|
+
appearance: none;
|
|
4396
|
+
box-sizing: border-box;
|
|
4397
|
+
background: var(--white);
|
|
4398
|
+
border: 1px solid var(--gray-200);
|
|
4399
|
+
border-radius: var(--rounded-sm);
|
|
4400
|
+
color: var(--gray-700);
|
|
4401
|
+
font-size: var(--fs-sm);
|
|
4402
|
+
line-height: 1.5;
|
|
4403
|
+
min-height: 2rem;
|
|
4404
|
+
padding: var(--spacing-sm);
|
|
4405
|
+
width: 100%;
|
|
4406
|
+
position: relative;
|
|
4407
|
+
white-space: normal;
|
|
4408
|
+
transition-property: background, border-color, color, box-shadow, border-radius;
|
|
4409
|
+
transition-duration: var(--duration-fast);
|
|
4410
|
+
transition-timing-function: var(--timing-ease-out);
|
|
4411
|
+
|
|
4412
|
+
&::placeholder {
|
|
4413
|
+
color: var(--gray-400);
|
|
4414
|
+
}
|
|
4415
|
+
|
|
4416
|
+
&:focus,
|
|
4417
|
+
&:focus-within {
|
|
4418
|
+
border-radius: var(--rounded-sm);
|
|
4419
|
+
box-shadow: var(--elevation-100);
|
|
4420
|
+
border: 1px solid var(--accent-dark-active);
|
|
4421
|
+
outline: none;
|
|
4422
|
+
}
|
|
4423
|
+
&:hover {
|
|
4424
|
+
border: 1px solid var(--accent-dark-hover);
|
|
4425
|
+
}
|
|
4426
|
+
|
|
4427
|
+
&:disabled,
|
|
4428
|
+
&:disabled::placeholder,
|
|
4429
|
+
&:disabled:hover {
|
|
4430
|
+
border-radius: var(--rounded-sm);
|
|
4431
|
+
cursor: not-allowed;
|
|
4432
|
+
color: var(--gray-400);
|
|
4433
|
+
}
|
|
4434
|
+
|
|
4435
|
+
&[readonly],
|
|
4436
|
+
&[contenteditable='false'] {
|
|
4437
|
+
cursor: not-allowed;
|
|
4438
|
+
color: var(--gray-400);
|
|
4439
|
+
}
|
|
4440
|
+
|
|
4441
|
+
> p {
|
|
4442
|
+
margin: 0;
|
|
4443
|
+
}
|
|
4444
|
+
`;
|
|
4445
|
+
var inputMultiLine = (lines) => import_react43.css`
|
|
4446
|
+
${import_design_system19.scrollbarStyles}
|
|
4447
|
+
// 1.5 = line height, spacing-sm = top and bottom padding + spacing-xs to give a slight increase in height
|
|
4448
|
+
// as the text looked to close to the bottom of the input
|
|
4449
|
+
height: calc(${lines * 1.5}em + var(--spacing-sm) + var(--spacing-xs));
|
|
4450
|
+
resize: vertical;
|
|
4451
|
+
overflow: auto;
|
|
4452
|
+
`;
|
|
4453
|
+
|
|
4302
4454
|
// src/components/Variables/toolbox/InputVariablesProvider.tsx
|
|
4303
4455
|
var React10 = __toESM(require("react"));
|
|
4304
|
-
var
|
|
4456
|
+
var import_react44 = require("react");
|
|
4305
4457
|
|
|
4306
4458
|
// src/components/Variables/util/hasReferencedVariables.ts
|
|
4307
4459
|
var import_canvas5 = require("@uniformdev/canvas");
|
|
@@ -4346,7 +4498,7 @@ function useInputVariablesState({
|
|
|
4346
4498
|
const hadVariablesInValueForReals = inputWhenNoVariables ? hadVariablesInValue : hasVariablesInValue;
|
|
4347
4499
|
const disableVariablesForReals = disableVariables || Object.keys(variables).length === 0 && !showAddVariableMenuOption;
|
|
4348
4500
|
const disableResetForReals = !inputWhenNoVariables || !hadVariablesInValueForReals;
|
|
4349
|
-
const sharedMenuProps = (0,
|
|
4501
|
+
const sharedMenuProps = (0, import_react44.useMemo)(
|
|
4350
4502
|
() => ({
|
|
4351
4503
|
menuTooltip,
|
|
4352
4504
|
showAddVariableMenuOption,
|
|
@@ -4377,15 +4529,15 @@ function useInputVariablesState({
|
|
|
4377
4529
|
}
|
|
4378
4530
|
|
|
4379
4531
|
// src/components/Variables/toolbox/VariableField.styles.ts
|
|
4380
|
-
var
|
|
4381
|
-
var labelText =
|
|
4532
|
+
var import_react45 = require("@emotion/react");
|
|
4533
|
+
var labelText = import_react45.css`
|
|
4382
4534
|
align-items: center;
|
|
4383
4535
|
display: flex;
|
|
4384
4536
|
gap: var(--spacing-xs);
|
|
4385
4537
|
font-weight: var(--fw-regular);
|
|
4386
4538
|
margin: 0 0 var(--spacing-xs);
|
|
4387
4539
|
`;
|
|
4388
|
-
var
|
|
4540
|
+
var variableBindButton2 = import_react45.css`
|
|
4389
4541
|
align-items: center;
|
|
4390
4542
|
border: none;
|
|
4391
4543
|
border-radius: var(--rounded-base);
|
|
@@ -4416,8 +4568,8 @@ var import_lexical6 = require("lexical");
|
|
|
4416
4568
|
// src/components/Variables/toolbox/SelectVariableMenu.tsx
|
|
4417
4569
|
var import_BsFillPlusCircleFill = require("@react-icons/all-files/bs/BsFillPlusCircleFill");
|
|
4418
4570
|
var import_CgUsbC = require("@react-icons/all-files/cg/CgUsbC");
|
|
4419
|
-
var
|
|
4420
|
-
var
|
|
4571
|
+
var import_design_system20 = require("@uniformdev/design-system");
|
|
4572
|
+
var import_react46 = require("react");
|
|
4421
4573
|
var import_jsx_runtime35 = require("@emotion/react/jsx-runtime");
|
|
4422
4574
|
function SelectVariableMenu({
|
|
4423
4575
|
onSelectVariable,
|
|
@@ -4428,10 +4580,11 @@ function SelectVariableMenu({
|
|
|
4428
4580
|
tip,
|
|
4429
4581
|
getEditorContext,
|
|
4430
4582
|
menuTooltip = "Insert variable",
|
|
4583
|
+
portal,
|
|
4431
4584
|
filterVariable
|
|
4432
4585
|
}) {
|
|
4433
4586
|
const { variables, canDispatch, readOnly } = useVariables(true);
|
|
4434
|
-
const btnRef = (0,
|
|
4587
|
+
const btnRef = (0, import_react46.useRef)(null);
|
|
4435
4588
|
const { editVariable } = useVariableEditor();
|
|
4436
4589
|
const variablesGroups = variablesToGroupedList(variables, filterVariable, getEditorContext == null ? void 0 : getEditorContext());
|
|
4437
4590
|
const showAddVariableMenuOptionForReals = showAddVariableMenuOption && canDispatch && !readOnly;
|
|
@@ -4440,10 +4593,10 @@ function SelectVariableMenu({
|
|
|
4440
4593
|
return null;
|
|
4441
4594
|
}
|
|
4442
4595
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
4443
|
-
|
|
4596
|
+
import_design_system20.Menu,
|
|
4444
4597
|
{
|
|
4445
|
-
placement: "bottom-start",
|
|
4446
|
-
|
|
4598
|
+
placement: portal ? "bottom-end" : "bottom-start",
|
|
4599
|
+
portal,
|
|
4447
4600
|
menuTrigger: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4448
4601
|
"button",
|
|
4449
4602
|
{
|
|
@@ -4459,7 +4612,7 @@ function SelectVariableMenu({
|
|
|
4459
4612
|
menuLabel: menuTooltip,
|
|
4460
4613
|
children: [
|
|
4461
4614
|
showAddVariableMenuOptionForReals ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4462
|
-
|
|
4615
|
+
import_design_system20.MenuItem,
|
|
4463
4616
|
{
|
|
4464
4617
|
onClick: async () => {
|
|
4465
4618
|
const result = await editVariable("", getEditorContext == null ? void 0 : getEditorContext());
|
|
@@ -4469,19 +4622,19 @@ function SelectVariableMenu({
|
|
|
4469
4622
|
onSelectVariable == null ? void 0 : onSelectVariable(result.selectedVariable);
|
|
4470
4623
|
},
|
|
4471
4624
|
"data-testid": "add-variable-button",
|
|
4472
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
4625
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_design_system20.HorizontalRhythm, { gap: "sm", align: "center", children: [
|
|
4473
4626
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_BsFillPlusCircleFill.BsFillPlusCircleFill, { fill: "var(--gray-500)", size: "1.25em" }),
|
|
4474
4627
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: typeof showAddVariableMenuOption === "string" ? showAddVariableMenuOption : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_jsx_runtime35.Fragment, { children: "Add\u2026" }) })
|
|
4475
4628
|
] })
|
|
4476
4629
|
}
|
|
4477
4630
|
) : null,
|
|
4478
|
-
showAddVariableMenuOptionForReals && menuHasVariableOptions ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4631
|
+
showAddVariableMenuOptionForReals && menuHasVariableOptions ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_design_system20.MenuItemSeparator, {}) : null,
|
|
4479
4632
|
variablesGroups.map((group) => {
|
|
4480
4633
|
var _a;
|
|
4481
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4634
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_design_system20.MenuGroup, { title: (_a = group.name) != null ? _a : "", children: group.variables.map((variable) => {
|
|
4482
4635
|
const { name, displayName, helpText } = variable;
|
|
4483
4636
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
4484
|
-
|
|
4637
|
+
import_design_system20.MenuItem,
|
|
4485
4638
|
{
|
|
4486
4639
|
id: name,
|
|
4487
4640
|
css: menuItemTextGroup,
|
|
@@ -4495,9 +4648,9 @@ function SelectVariableMenu({
|
|
|
4495
4648
|
);
|
|
4496
4649
|
}) }, group.name);
|
|
4497
4650
|
}),
|
|
4498
|
-
menuHasVariableOptions && onResetVariables ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4499
|
-
onResetVariables ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4500
|
-
tip && (menuHasVariableOptions || onResetVariables) ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4651
|
+
menuHasVariableOptions && onResetVariables ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_design_system20.MenuItemSeparator, {}) : null,
|
|
4652
|
+
onResetVariables ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_design_system20.MenuItem, { onClick: onResetVariables, css: { color: "var(--brand-secondary-5)" }, children: "Reset" }) : null,
|
|
4653
|
+
tip && (menuHasVariableOptions || onResetVariables) ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_design_system20.MenuItemSeparator, {}) : null,
|
|
4501
4654
|
tip ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("i", { css: variablesTipText, children: tip }) : null
|
|
4502
4655
|
]
|
|
4503
4656
|
}
|
|
@@ -4547,7 +4700,7 @@ function VariableField({
|
|
|
4547
4700
|
VariablesComposerVariableMenu,
|
|
4548
4701
|
{
|
|
4549
4702
|
...selectVariableMenuOptions,
|
|
4550
|
-
buttonCss: [
|
|
4703
|
+
buttonCss: [variableBindButton2, selectVariableMenuOptions == null ? void 0 : selectVariableMenuOptions.buttonCss],
|
|
4551
4704
|
buttonProps: isActive ? { "aria-pressed": "true" } : void 0
|
|
4552
4705
|
}
|
|
4553
4706
|
) : null;
|
|
@@ -4565,14 +4718,14 @@ var import_LexicalAutoFocusPlugin = require("@lexical/react/LexicalAutoFocusPlug
|
|
|
4565
4718
|
var import_LexicalClearEditorPlugin = require("@lexical/react/LexicalClearEditorPlugin");
|
|
4566
4719
|
var import_LexicalComposer = require("@lexical/react/LexicalComposer");
|
|
4567
4720
|
var import_LexicalOnChangePlugin = require("@lexical/react/LexicalOnChangePlugin");
|
|
4568
|
-
var
|
|
4721
|
+
var import_react49 = require("react");
|
|
4569
4722
|
|
|
4570
4723
|
// src/components/Variables/composer/DisablePlugin.tsx
|
|
4571
4724
|
var import_LexicalComposerContext7 = require("@lexical/react/LexicalComposerContext");
|
|
4572
|
-
var
|
|
4725
|
+
var import_react47 = require("react");
|
|
4573
4726
|
function DisablePlugin({ disabled }) {
|
|
4574
4727
|
const [editor] = (0, import_LexicalComposerContext7.useLexicalComposerContext)();
|
|
4575
|
-
(0,
|
|
4728
|
+
(0, import_react47.useEffect)(() => {
|
|
4576
4729
|
editor.setEditable(!disabled);
|
|
4577
4730
|
}, [editor, disabled]);
|
|
4578
4731
|
return null;
|
|
@@ -4581,10 +4734,10 @@ function DisablePlugin({ disabled }) {
|
|
|
4581
4734
|
// src/components/Variables/composer/SingleLineTextPlugin.tsx
|
|
4582
4735
|
var import_LexicalComposerContext8 = require("@lexical/react/LexicalComposerContext");
|
|
4583
4736
|
var import_lexical7 = require("lexical");
|
|
4584
|
-
var
|
|
4737
|
+
var import_react48 = require("react");
|
|
4585
4738
|
function SingleLineTextPlugin() {
|
|
4586
4739
|
const [editor] = (0, import_LexicalComposerContext8.useLexicalComposerContext)();
|
|
4587
|
-
(0,
|
|
4740
|
+
(0, import_react48.useEffect)(() => {
|
|
4588
4741
|
editor.registerNodeTransform(import_lexical7.LineBreakNode, (node) => {
|
|
4589
4742
|
node.remove();
|
|
4590
4743
|
});
|
|
@@ -4637,8 +4790,8 @@ function VariablesComposer(props) {
|
|
|
4637
4790
|
autoFocus,
|
|
4638
4791
|
...variablesPluginProps
|
|
4639
4792
|
} = props;
|
|
4640
|
-
const [lastEmittedValue, setLastEmittedValue] = (0,
|
|
4641
|
-
const editorConfig = (0,
|
|
4793
|
+
const [lastEmittedValue, setLastEmittedValue] = (0, import_react49.useState)(value);
|
|
4794
|
+
const editorConfig = (0, import_react49.useMemo)(
|
|
4642
4795
|
() => ({
|
|
4643
4796
|
namespace: "uniform",
|
|
4644
4797
|
onError(error) {
|
|
@@ -4650,8 +4803,8 @@ function VariablesComposer(props) {
|
|
|
4650
4803
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4651
4804
|
[]
|
|
4652
4805
|
);
|
|
4653
|
-
const editorState = (0,
|
|
4654
|
-
const updateTimeout = (0,
|
|
4806
|
+
const editorState = (0, import_react49.useRef)();
|
|
4807
|
+
const updateTimeout = (0, import_react49.useRef)();
|
|
4655
4808
|
if (typeof document === "undefined")
|
|
4656
4809
|
return null;
|
|
4657
4810
|
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_LexicalComposer.LexicalComposer, { initialConfig: editorConfig, children: [
|
|
@@ -4694,10 +4847,10 @@ var import_LexicalHistoryPlugin = require("@lexical/react/LexicalHistoryPlugin")
|
|
|
4694
4847
|
var import_LexicalPlainTextPlugin = require("@lexical/react/LexicalPlainTextPlugin");
|
|
4695
4848
|
var import_utils4 = require("@lexical/utils");
|
|
4696
4849
|
var import_lexical9 = require("lexical");
|
|
4697
|
-
var
|
|
4850
|
+
var import_react50 = require("react");
|
|
4698
4851
|
var import_jsx_runtime39 = require("@emotion/react/jsx-runtime");
|
|
4699
4852
|
function VariablesComposerInput({
|
|
4700
|
-
css:
|
|
4853
|
+
css: css38,
|
|
4701
4854
|
placeholder,
|
|
4702
4855
|
...contentEditableProps
|
|
4703
4856
|
}) {
|
|
@@ -4716,7 +4869,7 @@ function VariablesComposerInput({
|
|
|
4716
4869
|
}
|
|
4717
4870
|
function RichishCopyAndPastePlugin() {
|
|
4718
4871
|
const [editor] = (0, import_LexicalComposerContext9.useLexicalComposerContext)();
|
|
4719
|
-
(0,
|
|
4872
|
+
(0, import_react50.useEffect)(() => {
|
|
4720
4873
|
return (0, import_utils4.mergeRegister)(
|
|
4721
4874
|
editor.registerCommand(
|
|
4722
4875
|
import_lexical9.COPY_COMMAND,
|
|
@@ -4800,6 +4953,7 @@ function InputVariables(props) {
|
|
|
4800
4953
|
value,
|
|
4801
4954
|
enableEditingVariables,
|
|
4802
4955
|
disableInlineMenu,
|
|
4956
|
+
showMenuPosition,
|
|
4803
4957
|
onChange,
|
|
4804
4958
|
transformPaste,
|
|
4805
4959
|
showAddVariableMenuOption,
|
|
@@ -4816,9 +4970,10 @@ function InputVariables(props) {
|
|
|
4816
4970
|
disabled,
|
|
4817
4971
|
editorRef,
|
|
4818
4972
|
filterVariable,
|
|
4819
|
-
styleVariant = "default"
|
|
4973
|
+
styleVariant = "default",
|
|
4974
|
+
renderMenuInPortal
|
|
4820
4975
|
} = props;
|
|
4821
|
-
const [finalId] = (0,
|
|
4976
|
+
const [finalId] = (0, import_react52.useState)(id != null ? id : () => (0, import_uuid2.v4)());
|
|
4822
4977
|
const { dispatch, canDispatch, isEditing } = useVariables(true);
|
|
4823
4978
|
const { disableVariablesForReals, hadVariablesInValue, sharedMenuProps } = useInputVariablesState(props);
|
|
4824
4979
|
const useInputWithNoVariables = Boolean(inputWhenNoVariables && !hadVariablesInValue);
|
|
@@ -4832,39 +4987,64 @@ function InputVariables(props) {
|
|
|
4832
4987
|
},
|
|
4833
4988
|
css: disabled ? inputDisabled : "",
|
|
4834
4989
|
children: [
|
|
4835
|
-
|
|
4836
|
-
|
|
4990
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
4991
|
+
import_design_system21.HorizontalRhythm,
|
|
4837
4992
|
{
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
4857
|
-
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
|
|
4861
|
-
|
|
4993
|
+
align: "center",
|
|
4994
|
+
gap: "xs",
|
|
4995
|
+
css: import_react51.css`
|
|
4996
|
+
& > div:first-child {
|
|
4997
|
+
flex-grow: 1;
|
|
4998
|
+
}
|
|
4999
|
+
`,
|
|
5000
|
+
children: [
|
|
5001
|
+
useInputWithNoVariables ? inputWhenNoVariables : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
5002
|
+
InputVariablesOverlayMenu,
|
|
5003
|
+
{
|
|
5004
|
+
...sharedMenuProps,
|
|
5005
|
+
disabled: disableVariablesForReals || showMenuPosition && showMenuPosition !== "label" || disableInlineMenu === true || disableInlineMenu === "by-input",
|
|
5006
|
+
portal: renderMenuInPortal,
|
|
5007
|
+
replaceValueOnVariableInsert: useInputWithNoVariables,
|
|
5008
|
+
useInputWhenNoVariables: useInputWithNoVariables,
|
|
5009
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
5010
|
+
VariablesComposerInput,
|
|
5011
|
+
{
|
|
5012
|
+
id: finalId,
|
|
5013
|
+
"aria-label": ariaLabel,
|
|
5014
|
+
"data-testid": dataTestId ? dataTestId : "input-container",
|
|
5015
|
+
"data-text-value": value,
|
|
5016
|
+
css: [input, styleVariant === "compact" ? inputCompact : null],
|
|
5017
|
+
placeholder: placeholder ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
5018
|
+
import_design_system21.Caption,
|
|
5019
|
+
{
|
|
5020
|
+
css: [
|
|
5021
|
+
placeholderCaption,
|
|
5022
|
+
styleVariant === "compact" ? placeholderCompact : null
|
|
5023
|
+
],
|
|
5024
|
+
children: placeholder
|
|
5025
|
+
}
|
|
5026
|
+
) : void 0
|
|
5027
|
+
}
|
|
5028
|
+
)
|
|
5029
|
+
}
|
|
5030
|
+
),
|
|
5031
|
+
disableVariablesForReals || showMenuPosition !== "inline-right" ? null : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
5032
|
+
VariablesComposerVariableMenu,
|
|
5033
|
+
{
|
|
5034
|
+
...sharedMenuProps,
|
|
5035
|
+
buttonCss: variableBindButton,
|
|
5036
|
+
tip: useInputWithNoVariables ? void 0 : "Tip: access this list by typing $$",
|
|
5037
|
+
buttonProps: hadVariablesInValue ? { "aria-pressed": "true" } : void 0,
|
|
5038
|
+
replaceValueOnVariableInsert: useInputWithNoVariables
|
|
5039
|
+
}
|
|
5040
|
+
)
|
|
5041
|
+
]
|
|
4862
5042
|
}
|
|
4863
5043
|
),
|
|
4864
|
-
caption ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
4865
|
-
errorMessage ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
4866
|
-
warningMessage ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
4867
|
-
infoMessage ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
5044
|
+
caption ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system21.Caption, { children: caption }) : null,
|
|
5045
|
+
errorMessage ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system21.ErrorMessage, { message: errorMessage }) : null,
|
|
5046
|
+
warningMessage ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system21.WarningMessage, { message: warningMessage }) : null,
|
|
5047
|
+
infoMessage ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_design_system21.InfoMessage, { message: infoMessage }) : null
|
|
4868
5048
|
]
|
|
4869
5049
|
}
|
|
4870
5050
|
);
|
|
@@ -4880,7 +5060,7 @@ function InputVariables(props) {
|
|
|
4880
5060
|
},
|
|
4881
5061
|
id: finalId,
|
|
4882
5062
|
isActive: hadVariablesInValue,
|
|
4883
|
-
disableVariables: disableVariablesForReals || disableInlineMenu === "by-label",
|
|
5063
|
+
disableVariables: disableVariablesForReals || showMenuPosition && showMenuPosition !== "label" || disableInlineMenu === true || disableInlineMenu === "by-label",
|
|
4884
5064
|
children: input3
|
|
4885
5065
|
}
|
|
4886
5066
|
);
|
|
@@ -4912,6 +5092,7 @@ function InputVariablesOverlayMenu({
|
|
|
4912
5092
|
children,
|
|
4913
5093
|
disabled,
|
|
4914
5094
|
useInputWhenNoVariables,
|
|
5095
|
+
portal,
|
|
4915
5096
|
...props
|
|
4916
5097
|
}) {
|
|
4917
5098
|
if (disabled) {
|
|
@@ -4923,6 +5104,7 @@ function InputVariablesOverlayMenu({
|
|
|
4923
5104
|
VariablesComposerVariableMenu,
|
|
4924
5105
|
{
|
|
4925
5106
|
...props,
|
|
5107
|
+
portal,
|
|
4926
5108
|
tip: useInputWhenNoVariables ? void 0 : "Tip: access this list by typing $$",
|
|
4927
5109
|
buttonCss: menuBtn2
|
|
4928
5110
|
}
|
|
@@ -4934,102 +5116,7 @@ function InputVariablesOverlayMenu({
|
|
|
4934
5116
|
var import_CgUsbC2 = require("@react-icons/all-files/cg/CgUsbC");
|
|
4935
5117
|
var import_canvas7 = require("@uniformdev/canvas");
|
|
4936
5118
|
var import_design_system22 = require("@uniformdev/design-system");
|
|
4937
|
-
var
|
|
4938
|
-
|
|
4939
|
-
// src/components/Variables/styles/ParameterVariables.styles.ts
|
|
4940
|
-
var import_react51 = require("@emotion/react");
|
|
4941
|
-
var import_design_system21 = require("@uniformdev/design-system");
|
|
4942
|
-
var variableBindButton2 = import_react51.css`
|
|
4943
|
-
align-items: center;
|
|
4944
|
-
border: none;
|
|
4945
|
-
border-radius: var(--rounded-base);
|
|
4946
|
-
background: none;
|
|
4947
|
-
display: flex;
|
|
4948
|
-
height: 1.2rem;
|
|
4949
|
-
padding: var(--spacing-2xs);
|
|
4950
|
-
transition: background var(--duration-fast) var(--timing-ease-out),
|
|
4951
|
-
color var(--duration-fast) var(--timing-ease-out);
|
|
4952
|
-
width: 1.2rem;
|
|
4953
|
-
|
|
4954
|
-
&:hover,
|
|
4955
|
-
&[aria-pressed='true']:not(:disabled) {
|
|
4956
|
-
background: var(--brand-secondary-3);
|
|
4957
|
-
color: var(--white);
|
|
4958
|
-
}
|
|
4959
|
-
|
|
4960
|
-
&[aria-disabled='true'] {
|
|
4961
|
-
background: none;
|
|
4962
|
-
color: currentColor;
|
|
4963
|
-
}
|
|
4964
|
-
|
|
4965
|
-
// fixes menu resizing issue within iframes
|
|
4966
|
-
// see https://linear.app/uniform/issue/UNI-3068/mesh-integration-resizing-with-menus
|
|
4967
|
-
+ [role='menu'] {
|
|
4968
|
-
max-height: unset;
|
|
4969
|
-
}
|
|
4970
|
-
`;
|
|
4971
|
-
var input2 = import_react51.css`
|
|
4972
|
-
display: block;
|
|
4973
|
-
appearance: none;
|
|
4974
|
-
box-sizing: border-box;
|
|
4975
|
-
background: var(--white);
|
|
4976
|
-
border: 1px solid var(--gray-200);
|
|
4977
|
-
border-radius: var(--rounded-sm);
|
|
4978
|
-
color: var(--gray-700);
|
|
4979
|
-
font-size: var(--fs-sm);
|
|
4980
|
-
line-height: 1.5;
|
|
4981
|
-
min-height: 2rem;
|
|
4982
|
-
padding: var(--spacing-sm);
|
|
4983
|
-
width: 100%;
|
|
4984
|
-
position: relative;
|
|
4985
|
-
white-space: normal;
|
|
4986
|
-
transition-property: background, border-color, color, box-shadow, border-radius;
|
|
4987
|
-
transition-duration: var(--duration-fast);
|
|
4988
|
-
transition-timing-function: var(--timing-ease-out);
|
|
4989
|
-
|
|
4990
|
-
&::placeholder {
|
|
4991
|
-
color: var(--gray-400);
|
|
4992
|
-
}
|
|
4993
|
-
|
|
4994
|
-
&:focus,
|
|
4995
|
-
&:focus-within {
|
|
4996
|
-
border-radius: var(--rounded-sm);
|
|
4997
|
-
box-shadow: var(--elevation-100);
|
|
4998
|
-
border: 1px solid var(--accent-dark-active);
|
|
4999
|
-
outline: none;
|
|
5000
|
-
}
|
|
5001
|
-
&:hover {
|
|
5002
|
-
border: 1px solid var(--accent-dark-hover);
|
|
5003
|
-
}
|
|
5004
|
-
|
|
5005
|
-
&:disabled,
|
|
5006
|
-
&:disabled::placeholder,
|
|
5007
|
-
&:disabled:hover {
|
|
5008
|
-
border-radius: var(--rounded-sm);
|
|
5009
|
-
cursor: not-allowed;
|
|
5010
|
-
color: var(--gray-400);
|
|
5011
|
-
}
|
|
5012
|
-
|
|
5013
|
-
&[readonly],
|
|
5014
|
-
&[contenteditable='false'] {
|
|
5015
|
-
cursor: not-allowed;
|
|
5016
|
-
color: var(--gray-400);
|
|
5017
|
-
}
|
|
5018
|
-
|
|
5019
|
-
> p {
|
|
5020
|
-
margin: 0;
|
|
5021
|
-
}
|
|
5022
|
-
`;
|
|
5023
|
-
var inputMultiLine = (lines) => import_react51.css`
|
|
5024
|
-
${import_design_system21.scrollbarStyles}
|
|
5025
|
-
// 1.5 = line height, spacing-sm = top and bottom padding + spacing-xs to give a slight increase in height
|
|
5026
|
-
// as the text looked to close to the bottom of the input
|
|
5027
|
-
height: calc(${lines * 1.5}em + var(--spacing-sm) + var(--spacing-xs));
|
|
5028
|
-
resize: vertical;
|
|
5029
|
-
overflow: auto;
|
|
5030
|
-
`;
|
|
5031
|
-
|
|
5032
|
-
// src/components/Variables/ParameterConnectionIndicator.tsx
|
|
5119
|
+
var import_react53 = require("react");
|
|
5033
5120
|
var import_jsx_runtime41 = require("@emotion/react/jsx-runtime");
|
|
5034
5121
|
function ParameterConnectionIndicator({
|
|
5035
5122
|
children,
|
|
@@ -5038,7 +5125,7 @@ function ParameterConnectionIndicator({
|
|
|
5038
5125
|
disabled,
|
|
5039
5126
|
menuTooltip = "Insert variable"
|
|
5040
5127
|
}) {
|
|
5041
|
-
const hasVariablesInValue = (0,
|
|
5128
|
+
const hasVariablesInValue = (0, import_react53.useMemo)(() => {
|
|
5042
5129
|
let result = false;
|
|
5043
5130
|
(0, import_canvas7.bindVariablesToObject)({
|
|
5044
5131
|
value,
|
|
@@ -5061,7 +5148,7 @@ function ParameterConnectionIndicator({
|
|
|
5061
5148
|
{
|
|
5062
5149
|
title: menuTooltip,
|
|
5063
5150
|
"aria-pressed": hasVariablesInValue,
|
|
5064
|
-
css: [menuBtn,
|
|
5151
|
+
css: [menuBtn, variableBindButton],
|
|
5065
5152
|
type: "button",
|
|
5066
5153
|
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_CgUsbC2.CgUsbC, { size: "1.4rem" })
|
|
5067
5154
|
}
|
|
@@ -5075,21 +5162,21 @@ function ParameterConnectionIndicator({
|
|
|
5075
5162
|
|
|
5076
5163
|
// src/components/Variables/ParameterOrSingleVariable.tsx
|
|
5077
5164
|
var import_design_system23 = require("@uniformdev/design-system");
|
|
5078
|
-
var
|
|
5165
|
+
var import_react55 = require("react");
|
|
5079
5166
|
|
|
5080
5167
|
// src/components/Variables/composer/OnDisconnectPlugin.tsx
|
|
5081
5168
|
var import_LexicalComposerContext10 = require("@lexical/react/LexicalComposerContext");
|
|
5082
5169
|
var import_utils5 = require("@lexical/utils");
|
|
5083
5170
|
var import_lexical10 = require("lexical");
|
|
5084
|
-
var
|
|
5171
|
+
var import_react54 = require("react");
|
|
5085
5172
|
function OnDisconnectPlugin({
|
|
5086
5173
|
onDisconnect
|
|
5087
5174
|
}) {
|
|
5088
5175
|
const [editor] = (0, import_LexicalComposerContext10.useLexicalComposerContext)();
|
|
5089
5176
|
const { variables } = useVariables(true);
|
|
5090
|
-
const variablesRef = (0,
|
|
5177
|
+
const variablesRef = (0, import_react54.useRef)(variables);
|
|
5091
5178
|
variablesRef.current = variables;
|
|
5092
|
-
(0,
|
|
5179
|
+
(0, import_react54.useEffect)(() => {
|
|
5093
5180
|
return (0, import_utils5.mergeRegister)(
|
|
5094
5181
|
editor.registerCommand(
|
|
5095
5182
|
DISCONNECT_VARIABLE_COMMAND,
|
|
@@ -5134,7 +5221,7 @@ function ParameterOrSingleVariable(props) {
|
|
|
5134
5221
|
hasVariablesInValue,
|
|
5135
5222
|
setHadVariablesInValue
|
|
5136
5223
|
} = useInputVariablesState(props);
|
|
5137
|
-
const handleDisconnect = (0,
|
|
5224
|
+
const handleDisconnect = (0, import_react55.useCallback)(
|
|
5138
5225
|
(variable) => {
|
|
5139
5226
|
setHadVariablesInValue(false);
|
|
5140
5227
|
if (onDisconnect) {
|
|
@@ -5173,7 +5260,7 @@ function ParameterOrSingleVariable(props) {
|
|
|
5173
5260
|
VariablesComposerVariableMenu,
|
|
5174
5261
|
{
|
|
5175
5262
|
...sharedMenuProps,
|
|
5176
|
-
buttonCss: [
|
|
5263
|
+
buttonCss: [variableBindButton],
|
|
5177
5264
|
buttonProps: hasVariablesInValue ? { "aria-pressed": "true" } : void 0,
|
|
5178
5265
|
replaceValueOnVariableInsert: true,
|
|
5179
5266
|
filterVariable
|
|
@@ -5187,7 +5274,7 @@ function ParameterOrSingleVariable(props) {
|
|
|
5187
5274
|
}
|
|
5188
5275
|
|
|
5189
5276
|
// src/components/Variables/ParameterVariables.tsx
|
|
5190
|
-
var
|
|
5277
|
+
var import_react56 = require("@emotion/react");
|
|
5191
5278
|
var import_design_system24 = require("@uniformdev/design-system");
|
|
5192
5279
|
var import_jsx_runtime43 = require("@emotion/react/jsx-runtime");
|
|
5193
5280
|
function ParameterVariables(props) {
|
|
@@ -5246,8 +5333,8 @@ function ParameterVariables(props) {
|
|
|
5246
5333
|
"data-text-value": value,
|
|
5247
5334
|
css: [
|
|
5248
5335
|
input2,
|
|
5249
|
-
typeof multiLine === "number" ? inputMultiLine(multiLine) : multiLine === true ? inputMultiLine(2) :
|
|
5250
|
-
inputCss != null ? inputCss :
|
|
5336
|
+
typeof multiLine === "number" ? inputMultiLine(multiLine) : multiLine === true ? inputMultiLine(2) : import_react56.css``,
|
|
5337
|
+
inputCss != null ? inputCss : import_react56.css``
|
|
5251
5338
|
]
|
|
5252
5339
|
}
|
|
5253
5340
|
) }),
|
|
@@ -5255,7 +5342,7 @@ function ParameterVariables(props) {
|
|
|
5255
5342
|
VariablesComposerVariableMenu,
|
|
5256
5343
|
{
|
|
5257
5344
|
...sharedMenuProps,
|
|
5258
|
-
buttonCss: [
|
|
5345
|
+
buttonCss: [variableBindButton],
|
|
5259
5346
|
tip: useInputWhenNoVariables ? void 0 : "Tip: access this list by typing $$",
|
|
5260
5347
|
buttonProps: hasVariablesInValue ? { "aria-pressed": "true" } : void 0,
|
|
5261
5348
|
replaceValueOnVariableInsert: useInputWhenNoVariables
|
|
@@ -5283,13 +5370,13 @@ ${prettifyBindExpression(bindExpression)}`
|
|
|
5283
5370
|
}
|
|
5284
5371
|
|
|
5285
5372
|
// src/components/Variables/VariablesList.tsx
|
|
5286
|
-
var
|
|
5373
|
+
var import_react58 = require("@emotion/react");
|
|
5287
5374
|
var import_design_system25 = require("@uniformdev/design-system");
|
|
5288
5375
|
var import_react_beautiful_dnd3 = require("react-beautiful-dnd");
|
|
5289
5376
|
|
|
5290
5377
|
// src/components/Variables/styles/VariablesList.styles.ts
|
|
5291
|
-
var
|
|
5292
|
-
var tableRow = (isDragging) =>
|
|
5378
|
+
var import_react57 = require("@emotion/react");
|
|
5379
|
+
var tableRow = (isDragging) => import_react57.css`
|
|
5293
5380
|
position: relative;
|
|
5294
5381
|
${isDragging ? `
|
|
5295
5382
|
display: table;
|
|
@@ -5297,7 +5384,7 @@ var tableRow = (isDragging) => import_react56.css`
|
|
|
5297
5384
|
top: auto !important;
|
|
5298
5385
|
` : void 0}
|
|
5299
5386
|
`;
|
|
5300
|
-
var tableCellDragIcon =
|
|
5387
|
+
var tableCellDragIcon = import_react57.css`
|
|
5301
5388
|
&::after {
|
|
5302
5389
|
content: '';
|
|
5303
5390
|
display: block;
|
|
@@ -5315,7 +5402,7 @@ var tableCellDragIcon = import_react56.css`
|
|
|
5315
5402
|
opacity: 1;
|
|
5316
5403
|
}
|
|
5317
5404
|
`;
|
|
5318
|
-
var variableName =
|
|
5405
|
+
var variableName = import_react57.css`
|
|
5319
5406
|
border: none;
|
|
5320
5407
|
font-weight: var(--fw-medium);
|
|
5321
5408
|
padding: 0;
|
|
@@ -5325,7 +5412,7 @@ var variableName = import_react56.css`
|
|
|
5325
5412
|
white-space: nowrap;
|
|
5326
5413
|
max-width: 20ch;
|
|
5327
5414
|
`;
|
|
5328
|
-
var variableValue =
|
|
5415
|
+
var variableValue = import_react57.css`
|
|
5329
5416
|
overflow: hidden;
|
|
5330
5417
|
text-overflow: ellipsis;
|
|
5331
5418
|
white-space: nowrap;
|
|
@@ -5343,13 +5430,13 @@ function VariablesList() {
|
|
|
5343
5430
|
const result = [...sorted || []];
|
|
5344
5431
|
const [removed] = (_b = result == null ? void 0 : result.splice(res.source.index, 1)) != null ? _b : [];
|
|
5345
5432
|
result == null ? void 0 : result.splice(res.destination.index, 0, removed);
|
|
5346
|
-
const resultAsObj = result.reduce(
|
|
5347
|
-
|
|
5433
|
+
const resultAsObj = result.reduce((acc, item, index) => {
|
|
5434
|
+
const { name, ...variableDefinition } = item;
|
|
5435
|
+
return {
|
|
5348
5436
|
...acc,
|
|
5349
|
-
[item.name]: {
|
|
5350
|
-
}
|
|
5351
|
-
|
|
5352
|
-
);
|
|
5437
|
+
[item.name]: { ...variableDefinition, order: index }
|
|
5438
|
+
};
|
|
5439
|
+
}, {});
|
|
5353
5440
|
dispatch({ type: "reorder", result: resultAsObj });
|
|
5354
5441
|
return result;
|
|
5355
5442
|
}
|
|
@@ -5402,7 +5489,7 @@ function VariablesList() {
|
|
|
5402
5489
|
title: `delete ${text}`,
|
|
5403
5490
|
css: [
|
|
5404
5491
|
import_design_system25.button,
|
|
5405
|
-
|
|
5492
|
+
import_react58.css`
|
|
5406
5493
|
background: transparent;
|
|
5407
5494
|
`
|
|
5408
5495
|
],
|
|
@@ -5531,9 +5618,9 @@ function TextVariableRenderer({ definition, value, setValue }) {
|
|
|
5531
5618
|
}
|
|
5532
5619
|
|
|
5533
5620
|
// src/components/Request/RequestBody.tsx
|
|
5534
|
-
var
|
|
5621
|
+
var import_react60 = require("@emotion/react");
|
|
5535
5622
|
var import_design_system27 = require("@uniformdev/design-system");
|
|
5536
|
-
var
|
|
5623
|
+
var import_react61 = require("react");
|
|
5537
5624
|
|
|
5538
5625
|
// src/components/Request/RequestProvider.tsx
|
|
5539
5626
|
var React11 = __toESM(require("react"));
|
|
@@ -5617,11 +5704,11 @@ function useRequest() {
|
|
|
5617
5704
|
}
|
|
5618
5705
|
|
|
5619
5706
|
// src/components/Request/styles/Request.styles.ts
|
|
5620
|
-
var
|
|
5621
|
-
var innerContentStyles =
|
|
5707
|
+
var import_react59 = require("@emotion/react");
|
|
5708
|
+
var innerContentStyles = import_react59.css`
|
|
5622
5709
|
background: var(--white);
|
|
5623
5710
|
`;
|
|
5624
|
-
var requestTypeContainer = (bgColor) =>
|
|
5711
|
+
var requestTypeContainer = (bgColor) => import_react59.css`
|
|
5625
5712
|
align-items: start;
|
|
5626
5713
|
background: ${bgColor};
|
|
5627
5714
|
display: grid;
|
|
@@ -5659,11 +5746,11 @@ var LANGUAGE_TO_CONTENT_TYPE = {
|
|
|
5659
5746
|
};
|
|
5660
5747
|
function RequestBody() {
|
|
5661
5748
|
const { request, dispatch } = useRequest();
|
|
5662
|
-
const [language, setLanguage] = (0,
|
|
5749
|
+
const [language, setLanguage] = (0, import_react61.useState)("json");
|
|
5663
5750
|
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
5664
5751
|
"div",
|
|
5665
5752
|
{
|
|
5666
|
-
css:
|
|
5753
|
+
css: import_react60.css`
|
|
5667
5754
|
background: var(--white);
|
|
5668
5755
|
`,
|
|
5669
5756
|
children: [
|
|
@@ -5671,7 +5758,7 @@ function RequestBody() {
|
|
|
5671
5758
|
RequestTypeContainer,
|
|
5672
5759
|
{
|
|
5673
5760
|
bgColor: "var(--gray-100)",
|
|
5674
|
-
css:
|
|
5761
|
+
css: import_react60.css`
|
|
5675
5762
|
padding: var(--spacing-sm) var(--spacing-base);
|
|
5676
5763
|
`,
|
|
5677
5764
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
@@ -5942,8 +6029,8 @@ function RequestParameters({
|
|
|
5942
6029
|
}
|
|
5943
6030
|
|
|
5944
6031
|
// src/components/Request/RequestUrl.tsx
|
|
5945
|
-
var
|
|
5946
|
-
var
|
|
6032
|
+
var import_react62 = require("@emotion/react");
|
|
6033
|
+
var import_react63 = require("react");
|
|
5947
6034
|
|
|
5948
6035
|
// src/components/Request/urlEncodeRequestParameter.ts
|
|
5949
6036
|
function urlEncodeRequestUrl(url, varValues) {
|
|
@@ -5969,7 +6056,7 @@ function RequestUrl() {
|
|
|
5969
6056
|
var _a, _b;
|
|
5970
6057
|
const { variables } = useVariables();
|
|
5971
6058
|
const { request } = useRequest();
|
|
5972
|
-
const mergedParameters = (0,
|
|
6059
|
+
const mergedParameters = (0, import_react63.useMemo)(() => {
|
|
5973
6060
|
var _a2;
|
|
5974
6061
|
if (!((_a2 = request.baseRequest) == null ? void 0 : _a2.parameters)) {
|
|
5975
6062
|
return request.parameters;
|
|
@@ -5979,7 +6066,7 @@ function RequestUrl() {
|
|
|
5979
6066
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
5980
6067
|
"small",
|
|
5981
6068
|
{
|
|
5982
|
-
css:
|
|
6069
|
+
css: import_react62.css`
|
|
5983
6070
|
display: inline-block;
|
|
5984
6071
|
margin-bottom: var(--spacing-xs);
|
|
5985
6072
|
word-break: break-word;
|
|
@@ -6217,12 +6304,12 @@ var import_design_system31 = require("@uniformdev/design-system");
|
|
|
6217
6304
|
|
|
6218
6305
|
// src/hooks/useInitializeUniformMeshSdk.ts
|
|
6219
6306
|
var import_mesh_sdk = require("@uniformdev/mesh-sdk");
|
|
6220
|
-
var
|
|
6307
|
+
var import_react64 = require("react");
|
|
6221
6308
|
var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
|
|
6222
|
-
const [error, setError] = (0,
|
|
6223
|
-
const [sdk, setSdk] = (0,
|
|
6224
|
-
const initializationInProgress = (0,
|
|
6225
|
-
(0,
|
|
6309
|
+
const [error, setError] = (0, import_react64.useState)();
|
|
6310
|
+
const [sdk, setSdk] = (0, import_react64.useState)();
|
|
6311
|
+
const initializationInProgress = (0, import_react64.useRef)(false);
|
|
6312
|
+
(0, import_react64.useEffect)(
|
|
6226
6313
|
() => {
|
|
6227
6314
|
if (typeof window === "undefined" || sdk) {
|
|
6228
6315
|
return;
|
|
@@ -6280,7 +6367,7 @@ var MeshApp = ({
|
|
|
6280
6367
|
};
|
|
6281
6368
|
|
|
6282
6369
|
// src/components/ObjectSearch/DataRefreshButton.tsx
|
|
6283
|
-
var
|
|
6370
|
+
var import_react65 = require("@emotion/react");
|
|
6284
6371
|
var import_design_system32 = require("@uniformdev/design-system");
|
|
6285
6372
|
var import_jsx_runtime58 = require("@emotion/react/jsx-runtime");
|
|
6286
6373
|
var DataRefreshButton = ({
|
|
@@ -6293,7 +6380,7 @@ var DataRefreshButton = ({
|
|
|
6293
6380
|
!isLoading ? null : /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
6294
6381
|
import_design_system32.LoadingIndicator,
|
|
6295
6382
|
{
|
|
6296
|
-
css:
|
|
6383
|
+
css: import_react65.css`
|
|
6297
6384
|
${isLoading ? "opacity: 0.2;" : void 0}
|
|
6298
6385
|
`
|
|
6299
6386
|
}
|
|
@@ -6303,15 +6390,15 @@ var DataRefreshButton = ({
|
|
|
6303
6390
|
};
|
|
6304
6391
|
|
|
6305
6392
|
// src/components/ObjectSearch/ObjectSearchContainer.tsx
|
|
6306
|
-
var
|
|
6393
|
+
var import_react68 = require("@emotion/react");
|
|
6307
6394
|
var import_canvas9 = require("@uniformdev/canvas");
|
|
6308
6395
|
var import_design_system35 = require("@uniformdev/design-system");
|
|
6309
6396
|
|
|
6310
6397
|
// src/components/ObjectSearch/hooks/ObjectSearchContext.tsx
|
|
6311
6398
|
var import_canvas8 = require("@uniformdev/canvas");
|
|
6312
|
-
var
|
|
6399
|
+
var import_react66 = require("react");
|
|
6313
6400
|
var import_jsx_runtime59 = require("@emotion/react/jsx-runtime");
|
|
6314
|
-
var ObjectSearchContext = (0,
|
|
6401
|
+
var ObjectSearchContext = (0, import_react66.createContext)({
|
|
6315
6402
|
onSetQuery: () => {
|
|
6316
6403
|
},
|
|
6317
6404
|
onSelectItem: () => {
|
|
@@ -6332,16 +6419,16 @@ var ObjectSearchProvider = ({
|
|
|
6332
6419
|
children,
|
|
6333
6420
|
defaultQuery
|
|
6334
6421
|
}) => {
|
|
6335
|
-
const [query, setQuery] = (0,
|
|
6422
|
+
const [query, setQuery] = (0, import_react66.useState)({
|
|
6336
6423
|
contentType: "",
|
|
6337
6424
|
keyword: "",
|
|
6338
6425
|
...defaultQuery
|
|
6339
6426
|
});
|
|
6340
6427
|
const { flatVariables } = useVariables(true);
|
|
6341
|
-
const querySearchDeferred = (0,
|
|
6342
|
-
const [selectedItems, setSelectedItems] = (0,
|
|
6343
|
-
const [list, setList] = (0,
|
|
6344
|
-
const onSetQuery = (0,
|
|
6428
|
+
const querySearchDeferred = (0, import_react66.useDeferredValue)(query);
|
|
6429
|
+
const [selectedItems, setSelectedItems] = (0, import_react66.useState)(currentlySelectedItems != null ? currentlySelectedItems : []);
|
|
6430
|
+
const [list, setList] = (0, import_react66.useState)({});
|
|
6431
|
+
const onSetQuery = (0, import_react66.useCallback)(
|
|
6345
6432
|
(value2) => {
|
|
6346
6433
|
if (Array.isArray(value2.contentType) && value2.contentType.length > 0) {
|
|
6347
6434
|
return setQuery({
|
|
@@ -6353,7 +6440,7 @@ var ObjectSearchProvider = ({
|
|
|
6353
6440
|
},
|
|
6354
6441
|
[setQuery]
|
|
6355
6442
|
);
|
|
6356
|
-
const onSelectItem = (0,
|
|
6443
|
+
const onSelectItem = (0, import_react66.useCallback)(
|
|
6357
6444
|
(selectedResult) => {
|
|
6358
6445
|
if (Array.isArray(selectedResult)) {
|
|
6359
6446
|
setSelectedItems(selectedResult);
|
|
@@ -6367,17 +6454,17 @@ var ObjectSearchProvider = ({
|
|
|
6367
6454
|
},
|
|
6368
6455
|
[setSelectedItems, selectedItems]
|
|
6369
6456
|
);
|
|
6370
|
-
const onRemoveAllSelectedItems = (0,
|
|
6457
|
+
const onRemoveAllSelectedItems = (0, import_react66.useCallback)(() => {
|
|
6371
6458
|
setSelectedItems([]);
|
|
6372
6459
|
}, [setSelectedItems]);
|
|
6373
|
-
const onSetList = (0,
|
|
6460
|
+
const onSetList = (0, import_react66.useCallback)(
|
|
6374
6461
|
(value2) => {
|
|
6375
6462
|
setList(value2);
|
|
6376
6463
|
},
|
|
6377
6464
|
[setList]
|
|
6378
6465
|
);
|
|
6379
|
-
const boundQuery = (0,
|
|
6380
|
-
const value = (0,
|
|
6466
|
+
const boundQuery = (0, import_react66.useMemo)(() => bindQuery(query, flatVariables), [query, flatVariables]);
|
|
6467
|
+
const value = (0, import_react66.useMemo)(
|
|
6381
6468
|
() => ({
|
|
6382
6469
|
boundQuery,
|
|
6383
6470
|
onSetQuery,
|
|
@@ -6404,7 +6491,7 @@ var ObjectSearchProvider = ({
|
|
|
6404
6491
|
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(ObjectSearchContext.Provider, { value, children });
|
|
6405
6492
|
};
|
|
6406
6493
|
function useObjectSearchContext() {
|
|
6407
|
-
return (0,
|
|
6494
|
+
return (0, import_react66.useContext)(ObjectSearchContext);
|
|
6408
6495
|
}
|
|
6409
6496
|
function bindQuery(query, inputs) {
|
|
6410
6497
|
const { result, errors } = (0, import_canvas8.bindVariablesToObject)({
|
|
@@ -6422,9 +6509,9 @@ function bindQuery(query, inputs) {
|
|
|
6422
6509
|
var import_design_system34 = require("@uniformdev/design-system");
|
|
6423
6510
|
|
|
6424
6511
|
// src/components/ObjectSearch/styles/ObjectSearchListItem.styles.ts
|
|
6425
|
-
var
|
|
6512
|
+
var import_react67 = require("@emotion/react");
|
|
6426
6513
|
var import_design_system33 = require("@uniformdev/design-system");
|
|
6427
|
-
var ObjectListItemContainer =
|
|
6514
|
+
var ObjectListItemContainer = import_react67.css`
|
|
6428
6515
|
align-items: center;
|
|
6429
6516
|
border: 1px solid var(--gray-300);
|
|
6430
6517
|
border-radius: var(--rounded-base);
|
|
@@ -6433,11 +6520,11 @@ var ObjectListItemContainer = import_react66.css`
|
|
|
6433
6520
|
grid-template-columns: 1fr auto;
|
|
6434
6521
|
padding: var(--spacing-sm);
|
|
6435
6522
|
`;
|
|
6436
|
-
var ObjectListItemContainerDisabled =
|
|
6523
|
+
var ObjectListItemContainerDisabled = import_react67.css`
|
|
6437
6524
|
opacity: var(--opacity-50);
|
|
6438
6525
|
pointer-events: none;
|
|
6439
6526
|
`;
|
|
6440
|
-
var ObjectListItemLoading =
|
|
6527
|
+
var ObjectListItemLoading = import_react67.css`
|
|
6441
6528
|
animation: ${import_design_system33.skeletonLoading} 1s linear infinite alternate;
|
|
6442
6529
|
border-color: transparent;
|
|
6443
6530
|
min-height: 42px;
|
|
@@ -6461,36 +6548,36 @@ var ObjectListItemLoading = import_react66.css`
|
|
|
6461
6548
|
width: 1rem;
|
|
6462
6549
|
}
|
|
6463
6550
|
`;
|
|
6464
|
-
var ObjectListItemHeadingGroup =
|
|
6551
|
+
var ObjectListItemHeadingGroup = import_react67.css`
|
|
6465
6552
|
align-items: center;
|
|
6466
6553
|
display: grid;
|
|
6467
6554
|
`;
|
|
6468
|
-
var ObjectListItemThumbnail =
|
|
6555
|
+
var ObjectListItemThumbnail = import_react67.css`
|
|
6469
6556
|
width: 30px;
|
|
6470
6557
|
object-fit: contain;
|
|
6471
6558
|
`;
|
|
6472
|
-
var ObjectListItemTitle =
|
|
6559
|
+
var ObjectListItemTitle = import_react67.css`
|
|
6473
6560
|
color: var(--typography-base);
|
|
6474
6561
|
display: block;
|
|
6475
6562
|
font-size: var(--fs-sm);
|
|
6476
6563
|
`;
|
|
6477
|
-
var ObjectListItemSubtitle =
|
|
6564
|
+
var ObjectListItemSubtitle = import_react67.css`
|
|
6478
6565
|
color: var(--gray-500);
|
|
6479
6566
|
display: block;
|
|
6480
6567
|
font-size: var(--fs-xs);
|
|
6481
6568
|
line-height: 1;
|
|
6482
6569
|
`;
|
|
6483
|
-
var ObjectListItemInfoContainer =
|
|
6570
|
+
var ObjectListItemInfoContainer = import_react67.css`
|
|
6484
6571
|
align-items: center;
|
|
6485
6572
|
display: flex;
|
|
6486
6573
|
gap: var(--spacing-sm);
|
|
6487
6574
|
justify-content: center;
|
|
6488
6575
|
`;
|
|
6489
|
-
var ObjectListItemControlledContent =
|
|
6576
|
+
var ObjectListItemControlledContent = import_react67.css`
|
|
6490
6577
|
display: flex;
|
|
6491
6578
|
gap: var(--spacing-sm);
|
|
6492
6579
|
`;
|
|
6493
|
-
var ObjectListItemUnControlledContent =
|
|
6580
|
+
var ObjectListItemUnControlledContent = import_react67.css`
|
|
6494
6581
|
margin-top: var(--spacing-sm);
|
|
6495
6582
|
grid-column: 1 / -1;
|
|
6496
6583
|
`;
|
|
@@ -6507,7 +6594,8 @@ var ObjectSearchListItem = ({
|
|
|
6507
6594
|
onSelect,
|
|
6508
6595
|
isMulti,
|
|
6509
6596
|
disabled,
|
|
6510
|
-
children
|
|
6597
|
+
children,
|
|
6598
|
+
...props
|
|
6511
6599
|
}) => {
|
|
6512
6600
|
const { onSelectItem, selectedListItems, isMulti: globalIsMulti } = useObjectSearchContext();
|
|
6513
6601
|
const formatedContentType = Array.isArray(contentType) ? contentType.join(", ") : contentType;
|
|
@@ -6527,6 +6615,7 @@ var ObjectSearchListItem = ({
|
|
|
6527
6615
|
role: "listitem",
|
|
6528
6616
|
css: [ObjectListItemContainer, disabled ? ObjectListItemContainerDisabled : void 0],
|
|
6529
6617
|
"data-testid": "list-item",
|
|
6618
|
+
...props,
|
|
6530
6619
|
children: [
|
|
6531
6620
|
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
6532
6621
|
"div",
|
|
@@ -6575,7 +6664,7 @@ var ObjectSearchContainer = ({
|
|
|
6575
6664
|
import_design_system35.ScrollableList,
|
|
6576
6665
|
{
|
|
6577
6666
|
role: "list",
|
|
6578
|
-
css:
|
|
6667
|
+
css: import_react68.css`
|
|
6579
6668
|
> div {
|
|
6580
6669
|
transition: max-height var(--duration-slow) var(--timing-ease-out);
|
|
6581
6670
|
max-height: ${selectedListItems.length === 0 ? "50vh" : "184px"};
|
|
@@ -6648,11 +6737,11 @@ var DefaultResultList = () => {
|
|
|
6648
6737
|
|
|
6649
6738
|
// src/components/ObjectSearch/ObjectSearchFilter.tsx
|
|
6650
6739
|
var import_design_system36 = require("@uniformdev/design-system");
|
|
6651
|
-
var
|
|
6740
|
+
var import_react70 = require("react");
|
|
6652
6741
|
|
|
6653
6742
|
// src/components/ObjectSearch/styles/ObjectSearchFilterContainer.styles.ts
|
|
6654
|
-
var
|
|
6655
|
-
var ObjectSearchFilterContainerLabel =
|
|
6743
|
+
var import_react69 = require("@emotion/react");
|
|
6744
|
+
var ObjectSearchFilterContainerLabel = import_react69.css`
|
|
6656
6745
|
align-items: center;
|
|
6657
6746
|
display: flex;
|
|
6658
6747
|
font-size: var(--fs-sm);
|
|
@@ -6660,11 +6749,11 @@ var ObjectSearchFilterContainerLabel = import_react68.css`
|
|
|
6660
6749
|
line-height: 1rem;
|
|
6661
6750
|
margin-bottom: var(--spacing-sm);
|
|
6662
6751
|
`;
|
|
6663
|
-
var ObjectSearchFilterContainer =
|
|
6752
|
+
var ObjectSearchFilterContainer = import_react69.css`
|
|
6664
6753
|
display: grid;
|
|
6665
6754
|
gap: var(--spacing-base);
|
|
6666
6755
|
`;
|
|
6667
|
-
var ObjectSearchFilterGrid = (gridColumns) =>
|
|
6756
|
+
var ObjectSearchFilterGrid = (gridColumns) => import_react69.css`
|
|
6668
6757
|
display: grid;
|
|
6669
6758
|
grid-template-columns: ${gridColumns};
|
|
6670
6759
|
gap: var(--spacing-base);
|
|
@@ -6682,7 +6771,7 @@ var ObjectSearchFilter = ({
|
|
|
6682
6771
|
}) => {
|
|
6683
6772
|
var _a, _b;
|
|
6684
6773
|
const { query, onSetQuery } = useObjectSearchContext();
|
|
6685
|
-
const [searchState, setSearchState] = (0,
|
|
6774
|
+
const [searchState, setSearchState] = (0, import_react70.useState)({
|
|
6686
6775
|
contentType: (_a = query.contentType) != null ? _a : "",
|
|
6687
6776
|
keyword: (_b = query.keyword) != null ? _b : ""
|
|
6688
6777
|
});
|
|
@@ -6692,7 +6781,7 @@ var ObjectSearchFilter = ({
|
|
|
6692
6781
|
});
|
|
6693
6782
|
onSetQuery({ ...query, ...value });
|
|
6694
6783
|
};
|
|
6695
|
-
const memoizedSelectOptions = (0,
|
|
6784
|
+
const memoizedSelectOptions = (0, import_react70.useMemo)(() => {
|
|
6696
6785
|
if (!requireContentType && !(selectOptions == null ? void 0 : selectOptions.length)) {
|
|
6697
6786
|
return [];
|
|
6698
6787
|
}
|
|
@@ -6721,14 +6810,14 @@ var ObjectSearchFilter = ({
|
|
|
6721
6810
|
}
|
|
6722
6811
|
) : null,
|
|
6723
6812
|
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
6724
|
-
import_design_system36.
|
|
6813
|
+
import_design_system36.DebouncedInputKeywordSearch,
|
|
6725
6814
|
{
|
|
6726
6815
|
inputFieldName: searchInputName,
|
|
6727
6816
|
placeholder: searchInputPlaceholderText,
|
|
6728
|
-
onSearchTextChanged: (
|
|
6817
|
+
onSearchTextChanged: (keyword) => handleFilterChange({ keyword }),
|
|
6729
6818
|
disabledFieldSubmission: true,
|
|
6730
|
-
|
|
6731
|
-
|
|
6819
|
+
defaultValue: searchState.keyword,
|
|
6820
|
+
delay: 300
|
|
6732
6821
|
}
|
|
6733
6822
|
)
|
|
6734
6823
|
]
|
|
@@ -6750,9 +6839,9 @@ var import_design_system38 = require("@uniformdev/design-system");
|
|
|
6750
6839
|
var import_timeago3 = require("timeago.js");
|
|
6751
6840
|
|
|
6752
6841
|
// src/components/ObjectSearch/styles/ObjectSearchResultItemButton.styles.ts
|
|
6753
|
-
var
|
|
6842
|
+
var import_react71 = require("@emotion/react");
|
|
6754
6843
|
var import_design_system37 = require("@uniformdev/design-system");
|
|
6755
|
-
var ButtonStyles =
|
|
6844
|
+
var ButtonStyles = import_react71.css`
|
|
6756
6845
|
${import_design_system37.button}
|
|
6757
6846
|
background: transparent;
|
|
6758
6847
|
border: 1px solid var(--typography-base);
|
|
@@ -6779,7 +6868,7 @@ var ButtonStyles = import_react70.css`
|
|
|
6779
6868
|
text-decoration: none;
|
|
6780
6869
|
}
|
|
6781
6870
|
`;
|
|
6782
|
-
var ButtonIcon =
|
|
6871
|
+
var ButtonIcon = import_react71.css`
|
|
6783
6872
|
width: 1rem;
|
|
6784
6873
|
height: 1rem;
|
|
6785
6874
|
`;
|
|
@@ -6808,8 +6897,8 @@ var LinkButton = ({
|
|
|
6808
6897
|
};
|
|
6809
6898
|
|
|
6810
6899
|
// src/components/ObjectSearch/styles/ObjectSearchResultItem.styles.ts
|
|
6811
|
-
var
|
|
6812
|
-
var ObjectSearchResultItemContainer =
|
|
6900
|
+
var import_react72 = require("@emotion/react");
|
|
6901
|
+
var ObjectSearchResultItemContainer = import_react72.css`
|
|
6813
6902
|
align-items: center;
|
|
6814
6903
|
border: 1px solid var(--gray-300);
|
|
6815
6904
|
border-radius: var(--rounded-base);
|
|
@@ -6825,7 +6914,7 @@ var ObjectSearchResultItemContainer = import_react71.css`
|
|
|
6825
6914
|
}
|
|
6826
6915
|
}
|
|
6827
6916
|
`;
|
|
6828
|
-
var ObjectSearchDragHandle =
|
|
6917
|
+
var ObjectSearchDragHandle = import_react72.css`
|
|
6829
6918
|
border-left: 2px dotted var(--gray-300);
|
|
6830
6919
|
border-right: 2px dotted var(--gray-300);
|
|
6831
6920
|
position: absolute;
|
|
@@ -6834,35 +6923,35 @@ var ObjectSearchDragHandle = import_react71.css`
|
|
|
6834
6923
|
transition: opacity var(--duration-fast) var(--timing-ease-out);
|
|
6835
6924
|
opacity: 0;
|
|
6836
6925
|
`;
|
|
6837
|
-
var ObjectSearchResultItemSubtitle =
|
|
6926
|
+
var ObjectSearchResultItemSubtitle = import_react72.css`
|
|
6838
6927
|
color: var(--gray-500);
|
|
6839
6928
|
display: block;
|
|
6840
6929
|
font-size: var(--fs-xs);
|
|
6841
6930
|
line-height: 1;
|
|
6842
6931
|
`;
|
|
6843
|
-
var ObjectSearchResultItemTitle =
|
|
6932
|
+
var ObjectSearchResultItemTitle = import_react72.css`
|
|
6844
6933
|
align-items: center;
|
|
6845
6934
|
color: var(--typography-base);
|
|
6846
6935
|
display: flex;
|
|
6847
6936
|
gap: var(--spacing-xs);
|
|
6848
6937
|
`;
|
|
6849
|
-
var ObjectSearchResultItemTimeStamp =
|
|
6938
|
+
var ObjectSearchResultItemTimeStamp = import_react72.css`
|
|
6850
6939
|
color: var(--gray-500);
|
|
6851
6940
|
font-size: var(--fs-xs);
|
|
6852
6941
|
`;
|
|
6853
|
-
var ObjectSearchAuthorStateGroup =
|
|
6942
|
+
var ObjectSearchAuthorStateGroup = import_react72.css`
|
|
6854
6943
|
align-items: center;
|
|
6855
6944
|
display: flex;
|
|
6856
6945
|
gap: var(--spacing-sm);
|
|
6857
6946
|
`;
|
|
6858
|
-
var ObjectSearchUpdateGroup =
|
|
6947
|
+
var ObjectSearchUpdateGroup = import_react72.css`
|
|
6859
6948
|
display: grid;
|
|
6860
6949
|
`;
|
|
6861
|
-
var ObjectSearchContentContainer =
|
|
6950
|
+
var ObjectSearchContentContainer = import_react72.css`
|
|
6862
6951
|
display: flex;
|
|
6863
6952
|
gap: var(--spacing-base);
|
|
6864
6953
|
`;
|
|
6865
|
-
var ObjectSearchImage =
|
|
6954
|
+
var ObjectSearchImage = import_react72.css`
|
|
6866
6955
|
width: 56px;
|
|
6867
6956
|
object-fit: contain;
|
|
6868
6957
|
`;
|
|
@@ -6930,26 +7019,26 @@ var import_design_system39 = require("@uniformdev/design-system");
|
|
|
6930
7019
|
var import_react_beautiful_dnd4 = require("react-beautiful-dnd");
|
|
6931
7020
|
|
|
6932
7021
|
// src/components/ObjectSearch/styles/ObjectSearchResultList.styles.ts
|
|
6933
|
-
var
|
|
6934
|
-
var ObjectSearchResultListContainer =
|
|
7022
|
+
var import_react73 = require("@emotion/react");
|
|
7023
|
+
var ObjectSearchResultListContainer = import_react73.css`
|
|
6935
7024
|
align-items: center;
|
|
6936
7025
|
display: flex;
|
|
6937
7026
|
gap: var(--spacing-sm);
|
|
6938
7027
|
justify-content: space-between;
|
|
6939
7028
|
`;
|
|
6940
|
-
var ObjectSearchDragContainer =
|
|
7029
|
+
var ObjectSearchDragContainer = import_react73.css`
|
|
6941
7030
|
margin: 0 0 var(--spacing-sm);
|
|
6942
7031
|
`;
|
|
6943
|
-
var ObjectSearchContainerDragging =
|
|
7032
|
+
var ObjectSearchContainerDragging = import_react73.css`
|
|
6944
7033
|
box-shadow: var(--shadow-base);
|
|
6945
7034
|
opacity: var(--opacity-50);
|
|
6946
7035
|
`;
|
|
6947
|
-
var ObjectSearchResultListCounterContainer =
|
|
7036
|
+
var ObjectSearchResultListCounterContainer = import_react73.css`
|
|
6948
7037
|
align-items: center;
|
|
6949
7038
|
display: flex;
|
|
6950
7039
|
gap: var(--spacing-sm);
|
|
6951
7040
|
`;
|
|
6952
|
-
var ObjectSearchResultListTitle =
|
|
7041
|
+
var ObjectSearchResultListTitle = import_react73.css`
|
|
6953
7042
|
font-weight: var(--fw-bold);
|
|
6954
7043
|
line-height: 1;
|
|
6955
7044
|
`;
|
|
@@ -6961,6 +7050,7 @@ function ObjectSearchResultList({
|
|
|
6961
7050
|
removeButtonText = "Remove all",
|
|
6962
7051
|
onRemoveAllSelected,
|
|
6963
7052
|
hideRemoveButton = false,
|
|
7053
|
+
resultLabelOverride,
|
|
6964
7054
|
additionalButtons,
|
|
6965
7055
|
renderResultComponent = (value) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(ObjectSearchResultItem, { ...value }),
|
|
6966
7056
|
multiSelectId,
|
|
@@ -7006,11 +7096,11 @@ function ObjectSearchResultList({
|
|
|
7006
7096
|
};
|
|
7007
7097
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_jsx_runtime66.Fragment, { children: [
|
|
7008
7098
|
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { role: "group", css: ObjectSearchResultListContainer, children: [
|
|
7009
|
-
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { role: "note", css: ObjectSearchResultListCounterContainer, children: [
|
|
7099
|
+
!resultLabelOverride ? /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { role: "note", css: ObjectSearchResultListCounterContainer, children: [
|
|
7010
7100
|
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { css: ObjectSearchResultListTitle, children: resultLabelText }),
|
|
7011
7101
|
" ",
|
|
7012
7102
|
!selectedListItems.length ? null : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_design_system39.Counter, { count: selectedListItems.length })
|
|
7013
|
-
] }),
|
|
7103
|
+
] }) : resultLabelOverride,
|
|
7014
7104
|
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { css: ObjectSearchResultListCounterContainer, children: [
|
|
7015
7105
|
additionalButtons,
|
|
7016
7106
|
hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
@@ -7053,7 +7143,7 @@ function ObjectSearchResultList({
|
|
|
7053
7143
|
|
|
7054
7144
|
// src/components/ObjectSearch/QueryFilter.tsx
|
|
7055
7145
|
var import_design_system40 = require("@uniformdev/design-system");
|
|
7056
|
-
var
|
|
7146
|
+
var import_react74 = require("react");
|
|
7057
7147
|
var import_jsx_runtime67 = require("@emotion/react/jsx-runtime");
|
|
7058
7148
|
var QueryFilter = ({
|
|
7059
7149
|
requireContentType,
|
|
@@ -7071,34 +7161,32 @@ var QueryFilter = ({
|
|
|
7071
7161
|
sortOrderLabel = "Sort Order",
|
|
7072
7162
|
sortOrderOptions = [
|
|
7073
7163
|
{
|
|
7074
|
-
|
|
7075
|
-
id: "asc",
|
|
7164
|
+
value: "asc",
|
|
7076
7165
|
label: "Ascending"
|
|
7077
7166
|
},
|
|
7078
7167
|
{
|
|
7079
|
-
|
|
7080
|
-
id: "desc",
|
|
7168
|
+
value: "desc",
|
|
7081
7169
|
label: "Descending"
|
|
7082
7170
|
}
|
|
7083
7171
|
],
|
|
7084
7172
|
children
|
|
7085
7173
|
}) => {
|
|
7086
|
-
var _a, _b, _c, _d, _e, _f;
|
|
7174
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
7087
7175
|
const { query, onSetQuery } = useObjectSearchContext();
|
|
7088
|
-
const [queryState, setQueryState] = (0,
|
|
7176
|
+
const [queryState, setQueryState] = (0, import_react74.useState)({
|
|
7089
7177
|
contentType: (_a = query.contentType) != null ? _a : "",
|
|
7090
|
-
keyword: (_b = query.
|
|
7091
|
-
count:
|
|
7092
|
-
sortBy: (
|
|
7093
|
-
sortOrder: (
|
|
7178
|
+
keyword: (_b = query.keyword) != null ? _b : "",
|
|
7179
|
+
count: (_c = query.count) != null ? _c : countValue,
|
|
7180
|
+
sortBy: (_d = query.sortBy) != null ? _d : "",
|
|
7181
|
+
sortOrder: (_e = query.sortOrder) != null ? _e : ""
|
|
7094
7182
|
});
|
|
7095
7183
|
const handleFilterChange = (value) => {
|
|
7096
7184
|
setQueryState((prev) => ({ ...prev, ...value }));
|
|
7097
7185
|
onSetQuery({ ...query, ...value });
|
|
7098
7186
|
};
|
|
7099
|
-
(0,
|
|
7187
|
+
(0, import_react74.useEffect)(() => {
|
|
7100
7188
|
onSetQuery(queryState);
|
|
7101
|
-
}, [
|
|
7189
|
+
}, []);
|
|
7102
7190
|
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("fieldset", { children: [
|
|
7103
7191
|
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { css: ObjectSearchFilterContainerLabel, children: queryFilterTitle }),
|
|
7104
7192
|
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { css: ObjectSearchFilterContainer, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_design_system40.VerticalRhythm, { children: [
|
|
@@ -7106,20 +7194,20 @@ var QueryFilter = ({
|
|
|
7106
7194
|
InputVariables,
|
|
7107
7195
|
{
|
|
7108
7196
|
label: searchInputLabel,
|
|
7109
|
-
value: (
|
|
7197
|
+
value: (_f = queryState.keyword) != null ? _f : "",
|
|
7110
7198
|
onChange: (newQuery) => handleFilterChange({ keyword: newQuery }),
|
|
7111
7199
|
disableInlineMenu: true,
|
|
7112
7200
|
id: "qf_searchText",
|
|
7113
7201
|
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
7114
|
-
import_design_system40.
|
|
7202
|
+
import_design_system40.DebouncedInputKeywordSearch,
|
|
7115
7203
|
{
|
|
7116
7204
|
id: "qf_searchText",
|
|
7117
7205
|
inputFieldName: searchInputName,
|
|
7118
7206
|
placeholder: searchInputPlaceholderText,
|
|
7119
|
-
onSearchTextChanged: (
|
|
7207
|
+
onSearchTextChanged: (keyword) => handleFilterChange({ keyword }),
|
|
7120
7208
|
disabledFieldSubmission: true,
|
|
7121
|
-
|
|
7122
|
-
|
|
7209
|
+
delay: 300,
|
|
7210
|
+
defaultValue: queryState.keyword
|
|
7123
7211
|
}
|
|
7124
7212
|
)
|
|
7125
7213
|
}
|
|
@@ -7130,7 +7218,7 @@ var QueryFilter = ({
|
|
|
7130
7218
|
{
|
|
7131
7219
|
label: contentTypeLabel,
|
|
7132
7220
|
id: "qf_contentType",
|
|
7133
|
-
value: (
|
|
7221
|
+
value: (_g = queryState.contentType) != null ? _g : "",
|
|
7134
7222
|
onChange: (newType) => handleFilterChange({ contentType: newType }),
|
|
7135
7223
|
disableInlineMenu: true,
|
|
7136
7224
|
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
@@ -7139,13 +7227,8 @@ var QueryFilter = ({
|
|
|
7139
7227
|
id: "qf_contentType",
|
|
7140
7228
|
label: contentTypeLabel,
|
|
7141
7229
|
showLabel: false,
|
|
7142
|
-
|
|
7143
|
-
|
|
7144
|
-
...contentTypeOptions ? contentTypeOptions.map((option) => {
|
|
7145
|
-
var _a2;
|
|
7146
|
-
return { id: option.id, label: (_a2 = option.label) != null ? _a2 : option.name, name: option.name };
|
|
7147
|
-
}) : []
|
|
7148
|
-
],
|
|
7230
|
+
defaultOption: requireContentType ? void 0 : typeSelectorAllTypesOptionText,
|
|
7231
|
+
options: contentTypeOptions != null ? contentTypeOptions : [],
|
|
7149
7232
|
onChange: (e) => handleFilterChange({ contentType: e.target.value }),
|
|
7150
7233
|
value: queryState.contentType
|
|
7151
7234
|
}
|
|
@@ -7160,6 +7243,7 @@ var QueryFilter = ({
|
|
|
7160
7243
|
value: queryState.count.toString(10),
|
|
7161
7244
|
onChange: (newCount) => handleFilterChange({ count: newCount }),
|
|
7162
7245
|
disableInlineMenu: true,
|
|
7246
|
+
valueToResetTo: "5",
|
|
7163
7247
|
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
7164
7248
|
import_design_system40.Input,
|
|
7165
7249
|
{
|
|
@@ -7190,16 +7274,8 @@ var QueryFilter = ({
|
|
|
7190
7274
|
label: sortLabel,
|
|
7191
7275
|
id: "qf_sortBy",
|
|
7192
7276
|
showLabel: false,
|
|
7193
|
-
|
|
7194
|
-
|
|
7195
|
-
label: "Select a sort",
|
|
7196
|
-
id: ""
|
|
7197
|
-
},
|
|
7198
|
-
...sortOptions ? sortOptions.map((option) => {
|
|
7199
|
-
var _a2;
|
|
7200
|
-
return { id: option.id, name: option.name, label: (_a2 = option.label) != null ? _a2 : option.name };
|
|
7201
|
-
}) : []
|
|
7202
|
-
],
|
|
7277
|
+
defaultOption: "Select a sort",
|
|
7278
|
+
options: sortOptions != null ? sortOptions : [],
|
|
7203
7279
|
onChange: (e) => handleFilterChange({ sortBy: e.target.value }),
|
|
7204
7280
|
value: queryState.sortBy
|
|
7205
7281
|
}
|
|
@@ -7220,12 +7296,7 @@ var QueryFilter = ({
|
|
|
7220
7296
|
label: sortOrderLabel,
|
|
7221
7297
|
id: "qf_sortOrder",
|
|
7222
7298
|
showLabel: false,
|
|
7223
|
-
options: [
|
|
7224
|
-
...sortOrderOptions ? sortOrderOptions.map((option) => {
|
|
7225
|
-
var _a2;
|
|
7226
|
-
return { value: option.id, label: (_a2 = option.label) != null ? _a2 : option.name, name: option.name };
|
|
7227
|
-
}) : []
|
|
7228
|
-
],
|
|
7299
|
+
options: sortOrderOptions != null ? sortOrderOptions : [],
|
|
7229
7300
|
onChange: (e) => handleFilterChange({ sortOrder: e.target.value }),
|
|
7230
7301
|
value: queryState.sortOrder
|
|
7231
7302
|
}
|
|
@@ -7239,7 +7310,7 @@ var QueryFilter = ({
|
|
|
7239
7310
|
};
|
|
7240
7311
|
|
|
7241
7312
|
// src/components/ParamTypeDynamicDataProvider.tsx
|
|
7242
|
-
var
|
|
7313
|
+
var import_react75 = require("react");
|
|
7243
7314
|
var import_jsx_runtime68 = require("@emotion/react/jsx-runtime");
|
|
7244
7315
|
function ParamTypeDynamicDataProvider(props) {
|
|
7245
7316
|
const { children } = props;
|
|
@@ -7248,7 +7319,7 @@ function ParamTypeDynamicDataProvider(props) {
|
|
|
7248
7319
|
} = useMeshLocation("paramType");
|
|
7249
7320
|
const dynamicInputsAsVariables = useDynamicInputsAsVariables(dynamicInputs);
|
|
7250
7321
|
const connectedDataAsVariables = useConnectedDataAsVariables(connectedData);
|
|
7251
|
-
const variables = (0,
|
|
7322
|
+
const variables = (0, import_react75.useMemo)(
|
|
7252
7323
|
() => ({ ...connectedDataAsVariables, ...dynamicInputsAsVariables }),
|
|
7253
7324
|
[dynamicInputsAsVariables, connectedDataAsVariables]
|
|
7254
7325
|
);
|
|
@@ -7261,9 +7332,9 @@ var JsonMeshVariableEditor = ({
|
|
|
7261
7332
|
variable,
|
|
7262
7333
|
context
|
|
7263
7334
|
}) => {
|
|
7264
|
-
const sillyRef = (0,
|
|
7335
|
+
const sillyRef = (0, import_react75.useRef)(false);
|
|
7265
7336
|
const { editConnectedData } = useMeshLocation("paramType");
|
|
7266
|
-
(0,
|
|
7337
|
+
(0, import_react75.useEffect)(() => {
|
|
7267
7338
|
if (sillyRef.current) {
|
|
7268
7339
|
return;
|
|
7269
7340
|
}
|
|
@@ -7291,6 +7362,57 @@ var JsonMeshVariableEditor = ({
|
|
|
7291
7362
|
return null;
|
|
7292
7363
|
};
|
|
7293
7364
|
|
|
7365
|
+
// src/components/SearchAndFilter/filtersMapper.tsx
|
|
7366
|
+
var import_design_system41 = require("@uniformdev/design-system");
|
|
7367
|
+
var import_design_system42 = require("@uniformdev/design-system");
|
|
7368
|
+
var import_jsx_runtime69 = require("@emotion/react/jsx-runtime");
|
|
7369
|
+
function withInputVariables(WrappedComponent) {
|
|
7370
|
+
const WithInputVariables = (props) => {
|
|
7371
|
+
if (Array.isArray(props.value) || !props.bindable || props.disabled || props.readOnly) {
|
|
7372
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(WrappedComponent, { ...props });
|
|
7373
|
+
}
|
|
7374
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
7375
|
+
InputVariables,
|
|
7376
|
+
{
|
|
7377
|
+
disableInlineMenu: true,
|
|
7378
|
+
showMenuPosition: "inline-right",
|
|
7379
|
+
onChange: (newValue) => props.onChange(newValue != null ? newValue : ""),
|
|
7380
|
+
value: props.value,
|
|
7381
|
+
disabled: props.disabled,
|
|
7382
|
+
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(WrappedComponent, { ...props })
|
|
7383
|
+
}
|
|
7384
|
+
);
|
|
7385
|
+
};
|
|
7386
|
+
return WithInputVariables;
|
|
7387
|
+
}
|
|
7388
|
+
function withInputVariablesForMultiValue(WrappedComponent) {
|
|
7389
|
+
const WithInputVariables = (props) => {
|
|
7390
|
+
var _a;
|
|
7391
|
+
if (!props.bindable || props.disabled || props.readOnly) {
|
|
7392
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(WrappedComponent, { ...props });
|
|
7393
|
+
}
|
|
7394
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
7395
|
+
InputVariables,
|
|
7396
|
+
{
|
|
7397
|
+
disableInlineMenu: true,
|
|
7398
|
+
showMenuPosition: "inline-right",
|
|
7399
|
+
onChange: (newValue) => props.onChange(newValue ? [newValue] : []),
|
|
7400
|
+
value: (_a = props.value) == null ? void 0 : _a[0],
|
|
7401
|
+
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(WrappedComponent, { ...props })
|
|
7402
|
+
}
|
|
7403
|
+
);
|
|
7404
|
+
};
|
|
7405
|
+
return WithInputVariables;
|
|
7406
|
+
}
|
|
7407
|
+
var bindableFiltersMapper = {
|
|
7408
|
+
...import_design_system41.filterMapper,
|
|
7409
|
+
multiChoice: withInputVariablesForMultiValue(import_design_system41.FilterMultiChoiceEditor),
|
|
7410
|
+
singleChoice: withInputVariables(import_design_system42.FilterSingleChoiceEditor),
|
|
7411
|
+
date: withInputVariables(import_design_system42.DateEditor),
|
|
7412
|
+
text: withInputVariables(import_design_system42.TextEditor),
|
|
7413
|
+
number: withInputVariables(import_design_system42.NumberEditor)
|
|
7414
|
+
};
|
|
7415
|
+
|
|
7294
7416
|
// src/utils/createLocationValidator.ts
|
|
7295
7417
|
function createLocationValidator(setValue, validate) {
|
|
7296
7418
|
return (dispatch) => setValue((previous) => {
|
|
@@ -7301,19 +7423,19 @@ function createLocationValidator(setValue, validate) {
|
|
|
7301
7423
|
|
|
7302
7424
|
// src/utils/useContentDataResourceLocaleInfo.ts
|
|
7303
7425
|
var import_canvas10 = require("@uniformdev/canvas");
|
|
7304
|
-
var
|
|
7426
|
+
var import_react76 = require("react");
|
|
7305
7427
|
function useContentDataResourceLocaleInfo({
|
|
7306
7428
|
locale,
|
|
7307
7429
|
setLocale,
|
|
7308
7430
|
dynamicInputs
|
|
7309
7431
|
}) {
|
|
7310
7432
|
var _a;
|
|
7311
|
-
const setLocaleRef = (0,
|
|
7433
|
+
const setLocaleRef = (0, import_react76.useRef)(setLocale);
|
|
7312
7434
|
setLocaleRef.current = setLocale;
|
|
7313
7435
|
const { flatVariables } = useVariables();
|
|
7314
7436
|
const effectiveLocale = locale != null ? locale : dynamicInputs[import_canvas10.LOCALE_DYNAMIC_INPUT_NAME] ? (0, import_canvas10.createVariableReference)(import_canvas10.LOCALE_DYNAMIC_INPUT_NAME) : "";
|
|
7315
7437
|
const boundLocale = (_a = (0, import_canvas10.bindVariables)({ variables: flatVariables, value: effectiveLocale }).result) != null ? _a : effectiveLocale;
|
|
7316
|
-
(0,
|
|
7438
|
+
(0, import_react76.useEffect)(() => {
|
|
7317
7439
|
if (locale === void 0 && effectiveLocale && setLocaleRef.current) {
|
|
7318
7440
|
setLocaleRef.current((0, import_canvas10.createVariableReference)(import_canvas10.LOCALE_DYNAMIC_INPUT_NAME));
|
|
7319
7441
|
}
|
|
@@ -7322,7 +7444,7 @@ function useContentDataResourceLocaleInfo({
|
|
|
7322
7444
|
}
|
|
7323
7445
|
|
|
7324
7446
|
// src/index.ts
|
|
7325
|
-
var
|
|
7447
|
+
var import_design_system43 = require("@uniformdev/design-system");
|
|
7326
7448
|
__reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
|
|
7327
7449
|
// Annotate the CommonJS export names for ESM import in node:
|
|
7328
7450
|
0 && (module.exports = {
|
|
@@ -7420,6 +7542,7 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
|
|
|
7420
7542
|
VariablesPlugin,
|
|
7421
7543
|
VariablesProvider,
|
|
7422
7544
|
badgeIcon,
|
|
7545
|
+
bindableFiltersMapper,
|
|
7423
7546
|
convertConnectedDataToVariable,
|
|
7424
7547
|
createLocationValidator,
|
|
7425
7548
|
damSelectItemImage,
|