@uniformdev/mesh-sdk-react 19.79.1-alpha.18 → 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/dist/index.d.mts +67 -4
- package/dist/index.d.ts +67 -4
- package/dist/index.esm.js +391 -261
- package/dist/index.js +462 -343
- package/dist/index.mjs +391 -261
- 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
|
}
|
|
@@ -3311,9 +3356,9 @@ function VariableEditor({
|
|
|
3311
3356
|
},
|
|
3312
3357
|
activeWhenEditing: true
|
|
3313
3358
|
});
|
|
3314
|
-
const nameRef = (0,
|
|
3359
|
+
const nameRef = (0, import_react36.useRef)(null);
|
|
3315
3360
|
const { ref, ...nameRegister } = register("name");
|
|
3316
|
-
(0,
|
|
3361
|
+
(0, import_react36.useLayoutEffect)(() => {
|
|
3317
3362
|
if (nameRef.current && !nameRef.current.value) {
|
|
3318
3363
|
nameRef.current.focus();
|
|
3319
3364
|
}
|
|
@@ -3389,7 +3434,7 @@ function VariableEditor({
|
|
|
3389
3434
|
|
|
3390
3435
|
// src/components/Variables/VariablesProvider.tsx
|
|
3391
3436
|
var import_jsx_runtime32 = require("@emotion/react/jsx-runtime");
|
|
3392
|
-
var VariablesContext = (0,
|
|
3437
|
+
var VariablesContext = (0, import_react37.createContext)(null);
|
|
3393
3438
|
function VariablesProvider({
|
|
3394
3439
|
value,
|
|
3395
3440
|
onChange,
|
|
@@ -3399,9 +3444,9 @@ function VariablesProvider({
|
|
|
3399
3444
|
children,
|
|
3400
3445
|
knownUndefinedValues = {}
|
|
3401
3446
|
}) {
|
|
3402
|
-
const [editing, setEditing] = (0,
|
|
3403
|
-
const [editingContext, setEditingContext] = (0,
|
|
3404
|
-
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)(
|
|
3405
3450
|
() => (0, import_mitt.default)(),
|
|
3406
3451
|
[]
|
|
3407
3452
|
);
|
|
@@ -3409,7 +3454,7 @@ function VariablesProvider({
|
|
|
3409
3454
|
throw new Error("onChange must be provided when readOnly is false");
|
|
3410
3455
|
}
|
|
3411
3456
|
const Editor = editVariableComponent != null ? editVariableComponent : VariableEditor;
|
|
3412
|
-
const valueBasedContextValue = (0,
|
|
3457
|
+
const valueBasedContextValue = (0, import_react37.useMemo)(
|
|
3413
3458
|
() => ({
|
|
3414
3459
|
flatVariables: flattenVariables(value),
|
|
3415
3460
|
dispatch: (event) => {
|
|
@@ -3447,16 +3492,23 @@ function VariablesProvider({
|
|
|
3447
3492
|
}),
|
|
3448
3493
|
[onChange, readOnly, value]
|
|
3449
3494
|
);
|
|
3450
|
-
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)(() => {
|
|
3451
3502
|
return {
|
|
3452
3503
|
...valueBasedContextValue,
|
|
3504
|
+
editVariableTxn,
|
|
3453
3505
|
isEditing: typeof editing !== "undefined",
|
|
3454
3506
|
events,
|
|
3455
3507
|
canDispatch: true,
|
|
3456
3508
|
knownUndefinedValues,
|
|
3457
3509
|
isLoading: !!isLoading
|
|
3458
3510
|
};
|
|
3459
|
-
}, [editing, events, knownUndefinedValues,
|
|
3511
|
+
}, [valueBasedContextValue, editVariableTxn, editing, events, knownUndefinedValues, isLoading]);
|
|
3460
3512
|
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(VariablesContext.Provider, { value: contextValue, children: [
|
|
3461
3513
|
children,
|
|
3462
3514
|
typeof editing !== "undefined" ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
@@ -3487,7 +3539,7 @@ function VariablesProvider({
|
|
|
3487
3539
|
] });
|
|
3488
3540
|
}
|
|
3489
3541
|
function useVariables(returnEmptyWithoutProvider = false) {
|
|
3490
|
-
const context = (0,
|
|
3542
|
+
const context = (0, import_react37.useContext)(VariablesContext);
|
|
3491
3543
|
if (!context) {
|
|
3492
3544
|
if (returnEmptyWithoutProvider) {
|
|
3493
3545
|
return {
|
|
@@ -3495,6 +3547,9 @@ function useVariables(returnEmptyWithoutProvider = false) {
|
|
|
3495
3547
|
dispatch: () => {
|
|
3496
3548
|
throw new Error("No VariablesProvider present");
|
|
3497
3549
|
},
|
|
3550
|
+
editVariableTxn: async () => {
|
|
3551
|
+
throw new Error("No VariablesProvider present");
|
|
3552
|
+
},
|
|
3498
3553
|
events: (0, import_mitt.default)(),
|
|
3499
3554
|
isEditing: false,
|
|
3500
3555
|
variables: {},
|
|
@@ -3517,39 +3572,13 @@ function flattenVariables(variables) {
|
|
|
3517
3572
|
|
|
3518
3573
|
// src/components/Variables/useVariableEditor.ts
|
|
3519
3574
|
function useVariableEditor() {
|
|
3520
|
-
const {
|
|
3521
|
-
const [isEditingBinding, setIsEditingBinding] = (0, import_react37.useState)();
|
|
3522
|
-
(0, import_react37.useEffect)(() => {
|
|
3523
|
-
if (!canDispatch || !isEditingBinding) {
|
|
3524
|
-
return;
|
|
3525
|
-
}
|
|
3526
|
-
const fn = (e) => {
|
|
3527
|
-
isEditingBinding.resolve(e);
|
|
3528
|
-
setIsEditingBinding(void 0);
|
|
3529
|
-
};
|
|
3530
|
-
events.on("editCompleted", fn);
|
|
3531
|
-
return () => events.off("editCompleted", fn);
|
|
3532
|
-
}, [canDispatch, events, isEditingBinding, variables]);
|
|
3533
|
-
(0, import_react37.useEffect)(() => {
|
|
3534
|
-
if (!isEditing) {
|
|
3535
|
-
setIsEditingBinding(void 0);
|
|
3536
|
-
}
|
|
3537
|
-
}, [isEditing]);
|
|
3575
|
+
const { editVariableTxn, canDispatch } = useVariables(true);
|
|
3538
3576
|
return {
|
|
3539
3577
|
async editVariable(variable, context) {
|
|
3540
3578
|
if (!canDispatch) {
|
|
3541
3579
|
throw new Error("Cannot edit variable. VariablesProvider is not mounted.");
|
|
3542
3580
|
}
|
|
3543
|
-
|
|
3544
|
-
throw new Error("Cannot edit variable. Another variable is already being edited.");
|
|
3545
|
-
}
|
|
3546
|
-
return new Promise((resolve) => {
|
|
3547
|
-
setIsEditingBinding({
|
|
3548
|
-
resolve,
|
|
3549
|
-
variable
|
|
3550
|
-
});
|
|
3551
|
-
dispatch({ type: "edit", variable, context });
|
|
3552
|
-
});
|
|
3581
|
+
return editVariableTxn(variable, context);
|
|
3553
3582
|
}
|
|
3554
3583
|
};
|
|
3555
3584
|
}
|
|
@@ -3787,6 +3816,15 @@ function VariablesPlugin({
|
|
|
3787
3816
|
editor.dispatchCommand(DISCONNECT_VARIABLE_COMMAND, { sourceKey });
|
|
3788
3817
|
return;
|
|
3789
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
|
+
});
|
|
3790
3828
|
return;
|
|
3791
3829
|
}
|
|
3792
3830
|
editor.dispatchCommand(INSERT_VARIABLE_COMMAND, {
|
|
@@ -4194,8 +4232,9 @@ function $isTargetWithinDecorator(target) {
|
|
|
4194
4232
|
}
|
|
4195
4233
|
|
|
4196
4234
|
// src/components/Variables/InputVariables.tsx
|
|
4197
|
-
var
|
|
4198
|
-
var
|
|
4235
|
+
var import_react51 = require("@emotion/react");
|
|
4236
|
+
var import_design_system21 = require("@uniformdev/design-system");
|
|
4237
|
+
var import_react52 = require("react");
|
|
4199
4238
|
var import_uuid2 = require("uuid");
|
|
4200
4239
|
|
|
4201
4240
|
// src/components/Variables/composer/EditorRefPlugin.tsx
|
|
@@ -4319,9 +4358,102 @@ var placeholderCompact = import_react42.css`
|
|
|
4319
4358
|
inset: var(--spacing-sm) var(--spacing-lg) var(--spacing-sm) var(--spacing-base);
|
|
4320
4359
|
`;
|
|
4321
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
|
+
|
|
4322
4454
|
// src/components/Variables/toolbox/InputVariablesProvider.tsx
|
|
4323
4455
|
var React10 = __toESM(require("react"));
|
|
4324
|
-
var
|
|
4456
|
+
var import_react44 = require("react");
|
|
4325
4457
|
|
|
4326
4458
|
// src/components/Variables/util/hasReferencedVariables.ts
|
|
4327
4459
|
var import_canvas5 = require("@uniformdev/canvas");
|
|
@@ -4366,7 +4498,7 @@ function useInputVariablesState({
|
|
|
4366
4498
|
const hadVariablesInValueForReals = inputWhenNoVariables ? hadVariablesInValue : hasVariablesInValue;
|
|
4367
4499
|
const disableVariablesForReals = disableVariables || Object.keys(variables).length === 0 && !showAddVariableMenuOption;
|
|
4368
4500
|
const disableResetForReals = !inputWhenNoVariables || !hadVariablesInValueForReals;
|
|
4369
|
-
const sharedMenuProps = (0,
|
|
4501
|
+
const sharedMenuProps = (0, import_react44.useMemo)(
|
|
4370
4502
|
() => ({
|
|
4371
4503
|
menuTooltip,
|
|
4372
4504
|
showAddVariableMenuOption,
|
|
@@ -4397,15 +4529,15 @@ function useInputVariablesState({
|
|
|
4397
4529
|
}
|
|
4398
4530
|
|
|
4399
4531
|
// src/components/Variables/toolbox/VariableField.styles.ts
|
|
4400
|
-
var
|
|
4401
|
-
var labelText =
|
|
4532
|
+
var import_react45 = require("@emotion/react");
|
|
4533
|
+
var labelText = import_react45.css`
|
|
4402
4534
|
align-items: center;
|
|
4403
4535
|
display: flex;
|
|
4404
4536
|
gap: var(--spacing-xs);
|
|
4405
4537
|
font-weight: var(--fw-regular);
|
|
4406
4538
|
margin: 0 0 var(--spacing-xs);
|
|
4407
4539
|
`;
|
|
4408
|
-
var
|
|
4540
|
+
var variableBindButton2 = import_react45.css`
|
|
4409
4541
|
align-items: center;
|
|
4410
4542
|
border: none;
|
|
4411
4543
|
border-radius: var(--rounded-base);
|
|
@@ -4436,8 +4568,8 @@ var import_lexical6 = require("lexical");
|
|
|
4436
4568
|
// src/components/Variables/toolbox/SelectVariableMenu.tsx
|
|
4437
4569
|
var import_BsFillPlusCircleFill = require("@react-icons/all-files/bs/BsFillPlusCircleFill");
|
|
4438
4570
|
var import_CgUsbC = require("@react-icons/all-files/cg/CgUsbC");
|
|
4439
|
-
var
|
|
4440
|
-
var
|
|
4571
|
+
var import_design_system20 = require("@uniformdev/design-system");
|
|
4572
|
+
var import_react46 = require("react");
|
|
4441
4573
|
var import_jsx_runtime35 = require("@emotion/react/jsx-runtime");
|
|
4442
4574
|
function SelectVariableMenu({
|
|
4443
4575
|
onSelectVariable,
|
|
@@ -4448,10 +4580,11 @@ function SelectVariableMenu({
|
|
|
4448
4580
|
tip,
|
|
4449
4581
|
getEditorContext,
|
|
4450
4582
|
menuTooltip = "Insert variable",
|
|
4583
|
+
portal,
|
|
4451
4584
|
filterVariable
|
|
4452
4585
|
}) {
|
|
4453
4586
|
const { variables, canDispatch, readOnly } = useVariables(true);
|
|
4454
|
-
const btnRef = (0,
|
|
4587
|
+
const btnRef = (0, import_react46.useRef)(null);
|
|
4455
4588
|
const { editVariable } = useVariableEditor();
|
|
4456
4589
|
const variablesGroups = variablesToGroupedList(variables, filterVariable, getEditorContext == null ? void 0 : getEditorContext());
|
|
4457
4590
|
const showAddVariableMenuOptionForReals = showAddVariableMenuOption && canDispatch && !readOnly;
|
|
@@ -4460,10 +4593,10 @@ function SelectVariableMenu({
|
|
|
4460
4593
|
return null;
|
|
4461
4594
|
}
|
|
4462
4595
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
4463
|
-
|
|
4596
|
+
import_design_system20.Menu,
|
|
4464
4597
|
{
|
|
4465
|
-
placement: "bottom-start",
|
|
4466
|
-
|
|
4598
|
+
placement: portal ? "bottom-end" : "bottom-start",
|
|
4599
|
+
portal,
|
|
4467
4600
|
menuTrigger: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4468
4601
|
"button",
|
|
4469
4602
|
{
|
|
@@ -4479,7 +4612,7 @@ function SelectVariableMenu({
|
|
|
4479
4612
|
menuLabel: menuTooltip,
|
|
4480
4613
|
children: [
|
|
4481
4614
|
showAddVariableMenuOptionForReals ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4482
|
-
|
|
4615
|
+
import_design_system20.MenuItem,
|
|
4483
4616
|
{
|
|
4484
4617
|
onClick: async () => {
|
|
4485
4618
|
const result = await editVariable("", getEditorContext == null ? void 0 : getEditorContext());
|
|
@@ -4489,19 +4622,19 @@ function SelectVariableMenu({
|
|
|
4489
4622
|
onSelectVariable == null ? void 0 : onSelectVariable(result.selectedVariable);
|
|
4490
4623
|
},
|
|
4491
4624
|
"data-testid": "add-variable-button",
|
|
4492
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
4625
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_design_system20.HorizontalRhythm, { gap: "sm", align: "center", children: [
|
|
4493
4626
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_BsFillPlusCircleFill.BsFillPlusCircleFill, { fill: "var(--gray-500)", size: "1.25em" }),
|
|
4494
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" }) })
|
|
4495
4628
|
] })
|
|
4496
4629
|
}
|
|
4497
4630
|
) : null,
|
|
4498
|
-
showAddVariableMenuOptionForReals && menuHasVariableOptions ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4631
|
+
showAddVariableMenuOptionForReals && menuHasVariableOptions ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_design_system20.MenuItemSeparator, {}) : null,
|
|
4499
4632
|
variablesGroups.map((group) => {
|
|
4500
4633
|
var _a;
|
|
4501
|
-
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) => {
|
|
4502
4635
|
const { name, displayName, helpText } = variable;
|
|
4503
4636
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
4504
|
-
|
|
4637
|
+
import_design_system20.MenuItem,
|
|
4505
4638
|
{
|
|
4506
4639
|
id: name,
|
|
4507
4640
|
css: menuItemTextGroup,
|
|
@@ -4515,9 +4648,9 @@ function SelectVariableMenu({
|
|
|
4515
4648
|
);
|
|
4516
4649
|
}) }, group.name);
|
|
4517
4650
|
}),
|
|
4518
|
-
menuHasVariableOptions && onResetVariables ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4519
|
-
onResetVariables ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4520
|
-
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,
|
|
4521
4654
|
tip ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("i", { css: variablesTipText, children: tip }) : null
|
|
4522
4655
|
]
|
|
4523
4656
|
}
|
|
@@ -4567,7 +4700,7 @@ function VariableField({
|
|
|
4567
4700
|
VariablesComposerVariableMenu,
|
|
4568
4701
|
{
|
|
4569
4702
|
...selectVariableMenuOptions,
|
|
4570
|
-
buttonCss: [
|
|
4703
|
+
buttonCss: [variableBindButton2, selectVariableMenuOptions == null ? void 0 : selectVariableMenuOptions.buttonCss],
|
|
4571
4704
|
buttonProps: isActive ? { "aria-pressed": "true" } : void 0
|
|
4572
4705
|
}
|
|
4573
4706
|
) : null;
|
|
@@ -4585,14 +4718,14 @@ var import_LexicalAutoFocusPlugin = require("@lexical/react/LexicalAutoFocusPlug
|
|
|
4585
4718
|
var import_LexicalClearEditorPlugin = require("@lexical/react/LexicalClearEditorPlugin");
|
|
4586
4719
|
var import_LexicalComposer = require("@lexical/react/LexicalComposer");
|
|
4587
4720
|
var import_LexicalOnChangePlugin = require("@lexical/react/LexicalOnChangePlugin");
|
|
4588
|
-
var
|
|
4721
|
+
var import_react49 = require("react");
|
|
4589
4722
|
|
|
4590
4723
|
// src/components/Variables/composer/DisablePlugin.tsx
|
|
4591
4724
|
var import_LexicalComposerContext7 = require("@lexical/react/LexicalComposerContext");
|
|
4592
|
-
var
|
|
4725
|
+
var import_react47 = require("react");
|
|
4593
4726
|
function DisablePlugin({ disabled }) {
|
|
4594
4727
|
const [editor] = (0, import_LexicalComposerContext7.useLexicalComposerContext)();
|
|
4595
|
-
(0,
|
|
4728
|
+
(0, import_react47.useEffect)(() => {
|
|
4596
4729
|
editor.setEditable(!disabled);
|
|
4597
4730
|
}, [editor, disabled]);
|
|
4598
4731
|
return null;
|
|
@@ -4601,10 +4734,10 @@ function DisablePlugin({ disabled }) {
|
|
|
4601
4734
|
// src/components/Variables/composer/SingleLineTextPlugin.tsx
|
|
4602
4735
|
var import_LexicalComposerContext8 = require("@lexical/react/LexicalComposerContext");
|
|
4603
4736
|
var import_lexical7 = require("lexical");
|
|
4604
|
-
var
|
|
4737
|
+
var import_react48 = require("react");
|
|
4605
4738
|
function SingleLineTextPlugin() {
|
|
4606
4739
|
const [editor] = (0, import_LexicalComposerContext8.useLexicalComposerContext)();
|
|
4607
|
-
(0,
|
|
4740
|
+
(0, import_react48.useEffect)(() => {
|
|
4608
4741
|
editor.registerNodeTransform(import_lexical7.LineBreakNode, (node) => {
|
|
4609
4742
|
node.remove();
|
|
4610
4743
|
});
|
|
@@ -4657,8 +4790,8 @@ function VariablesComposer(props) {
|
|
|
4657
4790
|
autoFocus,
|
|
4658
4791
|
...variablesPluginProps
|
|
4659
4792
|
} = props;
|
|
4660
|
-
const [lastEmittedValue, setLastEmittedValue] = (0,
|
|
4661
|
-
const editorConfig = (0,
|
|
4793
|
+
const [lastEmittedValue, setLastEmittedValue] = (0, import_react49.useState)(value);
|
|
4794
|
+
const editorConfig = (0, import_react49.useMemo)(
|
|
4662
4795
|
() => ({
|
|
4663
4796
|
namespace: "uniform",
|
|
4664
4797
|
onError(error) {
|
|
@@ -4670,8 +4803,8 @@ function VariablesComposer(props) {
|
|
|
4670
4803
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4671
4804
|
[]
|
|
4672
4805
|
);
|
|
4673
|
-
const editorState = (0,
|
|
4674
|
-
const updateTimeout = (0,
|
|
4806
|
+
const editorState = (0, import_react49.useRef)();
|
|
4807
|
+
const updateTimeout = (0, import_react49.useRef)();
|
|
4675
4808
|
if (typeof document === "undefined")
|
|
4676
4809
|
return null;
|
|
4677
4810
|
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_LexicalComposer.LexicalComposer, { initialConfig: editorConfig, children: [
|
|
@@ -4714,10 +4847,10 @@ var import_LexicalHistoryPlugin = require("@lexical/react/LexicalHistoryPlugin")
|
|
|
4714
4847
|
var import_LexicalPlainTextPlugin = require("@lexical/react/LexicalPlainTextPlugin");
|
|
4715
4848
|
var import_utils4 = require("@lexical/utils");
|
|
4716
4849
|
var import_lexical9 = require("lexical");
|
|
4717
|
-
var
|
|
4850
|
+
var import_react50 = require("react");
|
|
4718
4851
|
var import_jsx_runtime39 = require("@emotion/react/jsx-runtime");
|
|
4719
4852
|
function VariablesComposerInput({
|
|
4720
|
-
css:
|
|
4853
|
+
css: css38,
|
|
4721
4854
|
placeholder,
|
|
4722
4855
|
...contentEditableProps
|
|
4723
4856
|
}) {
|
|
@@ -4736,7 +4869,7 @@ function VariablesComposerInput({
|
|
|
4736
4869
|
}
|
|
4737
4870
|
function RichishCopyAndPastePlugin() {
|
|
4738
4871
|
const [editor] = (0, import_LexicalComposerContext9.useLexicalComposerContext)();
|
|
4739
|
-
(0,
|
|
4872
|
+
(0, import_react50.useEffect)(() => {
|
|
4740
4873
|
return (0, import_utils4.mergeRegister)(
|
|
4741
4874
|
editor.registerCommand(
|
|
4742
4875
|
import_lexical9.COPY_COMMAND,
|
|
@@ -4820,6 +4953,7 @@ function InputVariables(props) {
|
|
|
4820
4953
|
value,
|
|
4821
4954
|
enableEditingVariables,
|
|
4822
4955
|
disableInlineMenu,
|
|
4956
|
+
showMenuPosition,
|
|
4823
4957
|
onChange,
|
|
4824
4958
|
transformPaste,
|
|
4825
4959
|
showAddVariableMenuOption,
|
|
@@ -4836,9 +4970,10 @@ function InputVariables(props) {
|
|
|
4836
4970
|
disabled,
|
|
4837
4971
|
editorRef,
|
|
4838
4972
|
filterVariable,
|
|
4839
|
-
styleVariant = "default"
|
|
4973
|
+
styleVariant = "default",
|
|
4974
|
+
renderMenuInPortal
|
|
4840
4975
|
} = props;
|
|
4841
|
-
const [finalId] = (0,
|
|
4976
|
+
const [finalId] = (0, import_react52.useState)(id != null ? id : () => (0, import_uuid2.v4)());
|
|
4842
4977
|
const { dispatch, canDispatch, isEditing } = useVariables(true);
|
|
4843
4978
|
const { disableVariablesForReals, hadVariablesInValue, sharedMenuProps } = useInputVariablesState(props);
|
|
4844
4979
|
const useInputWithNoVariables = Boolean(inputWhenNoVariables && !hadVariablesInValue);
|
|
@@ -4852,39 +4987,64 @@ function InputVariables(props) {
|
|
|
4852
4987
|
},
|
|
4853
4988
|
css: disabled ? inputDisabled : "",
|
|
4854
4989
|
children: [
|
|
4855
|
-
|
|
4856
|
-
|
|
4990
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
4991
|
+
import_design_system21.HorizontalRhythm,
|
|
4857
4992
|
{
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
|
|
4861
|
-
|
|
4862
|
-
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
|
|
4871
|
-
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
|
|
4875
|
-
|
|
4876
|
-
|
|
4877
|
-
|
|
4878
|
-
|
|
4879
|
-
|
|
4880
|
-
|
|
4881
|
-
|
|
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
|
+
]
|
|
4882
5042
|
}
|
|
4883
5043
|
),
|
|
4884
|
-
caption ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
4885
|
-
errorMessage ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
4886
|
-
warningMessage ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
4887
|
-
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
|
|
4888
5048
|
]
|
|
4889
5049
|
}
|
|
4890
5050
|
);
|
|
@@ -4900,7 +5060,7 @@ function InputVariables(props) {
|
|
|
4900
5060
|
},
|
|
4901
5061
|
id: finalId,
|
|
4902
5062
|
isActive: hadVariablesInValue,
|
|
4903
|
-
disableVariables: disableVariablesForReals || disableInlineMenu === "by-label",
|
|
5063
|
+
disableVariables: disableVariablesForReals || showMenuPosition && showMenuPosition !== "label" || disableInlineMenu === true || disableInlineMenu === "by-label",
|
|
4904
5064
|
children: input3
|
|
4905
5065
|
}
|
|
4906
5066
|
);
|
|
@@ -4932,6 +5092,7 @@ function InputVariablesOverlayMenu({
|
|
|
4932
5092
|
children,
|
|
4933
5093
|
disabled,
|
|
4934
5094
|
useInputWhenNoVariables,
|
|
5095
|
+
portal,
|
|
4935
5096
|
...props
|
|
4936
5097
|
}) {
|
|
4937
5098
|
if (disabled) {
|
|
@@ -4943,6 +5104,7 @@ function InputVariablesOverlayMenu({
|
|
|
4943
5104
|
VariablesComposerVariableMenu,
|
|
4944
5105
|
{
|
|
4945
5106
|
...props,
|
|
5107
|
+
portal,
|
|
4946
5108
|
tip: useInputWhenNoVariables ? void 0 : "Tip: access this list by typing $$",
|
|
4947
5109
|
buttonCss: menuBtn2
|
|
4948
5110
|
}
|
|
@@ -4954,102 +5116,7 @@ function InputVariablesOverlayMenu({
|
|
|
4954
5116
|
var import_CgUsbC2 = require("@react-icons/all-files/cg/CgUsbC");
|
|
4955
5117
|
var import_canvas7 = require("@uniformdev/canvas");
|
|
4956
5118
|
var import_design_system22 = require("@uniformdev/design-system");
|
|
4957
|
-
var
|
|
4958
|
-
|
|
4959
|
-
// src/components/Variables/styles/ParameterVariables.styles.ts
|
|
4960
|
-
var import_react51 = require("@emotion/react");
|
|
4961
|
-
var import_design_system21 = require("@uniformdev/design-system");
|
|
4962
|
-
var variableBindButton2 = import_react51.css`
|
|
4963
|
-
align-items: center;
|
|
4964
|
-
border: none;
|
|
4965
|
-
border-radius: var(--rounded-base);
|
|
4966
|
-
background: none;
|
|
4967
|
-
display: flex;
|
|
4968
|
-
height: 1.2rem;
|
|
4969
|
-
padding: var(--spacing-2xs);
|
|
4970
|
-
transition: background var(--duration-fast) var(--timing-ease-out),
|
|
4971
|
-
color var(--duration-fast) var(--timing-ease-out);
|
|
4972
|
-
width: 1.2rem;
|
|
4973
|
-
|
|
4974
|
-
&:hover,
|
|
4975
|
-
&[aria-pressed='true']:not(:disabled) {
|
|
4976
|
-
background: var(--brand-secondary-3);
|
|
4977
|
-
color: var(--white);
|
|
4978
|
-
}
|
|
4979
|
-
|
|
4980
|
-
&[aria-disabled='true'] {
|
|
4981
|
-
background: none;
|
|
4982
|
-
color: currentColor;
|
|
4983
|
-
}
|
|
4984
|
-
|
|
4985
|
-
// fixes menu resizing issue within iframes
|
|
4986
|
-
// see https://linear.app/uniform/issue/UNI-3068/mesh-integration-resizing-with-menus
|
|
4987
|
-
+ [role='menu'] {
|
|
4988
|
-
max-height: unset;
|
|
4989
|
-
}
|
|
4990
|
-
`;
|
|
4991
|
-
var input2 = import_react51.css`
|
|
4992
|
-
display: block;
|
|
4993
|
-
appearance: none;
|
|
4994
|
-
box-sizing: border-box;
|
|
4995
|
-
background: var(--white);
|
|
4996
|
-
border: 1px solid var(--gray-200);
|
|
4997
|
-
border-radius: var(--rounded-sm);
|
|
4998
|
-
color: var(--gray-700);
|
|
4999
|
-
font-size: var(--fs-sm);
|
|
5000
|
-
line-height: 1.5;
|
|
5001
|
-
min-height: 2rem;
|
|
5002
|
-
padding: var(--spacing-sm);
|
|
5003
|
-
width: 100%;
|
|
5004
|
-
position: relative;
|
|
5005
|
-
white-space: normal;
|
|
5006
|
-
transition-property: background, border-color, color, box-shadow, border-radius;
|
|
5007
|
-
transition-duration: var(--duration-fast);
|
|
5008
|
-
transition-timing-function: var(--timing-ease-out);
|
|
5009
|
-
|
|
5010
|
-
&::placeholder {
|
|
5011
|
-
color: var(--gray-400);
|
|
5012
|
-
}
|
|
5013
|
-
|
|
5014
|
-
&:focus,
|
|
5015
|
-
&:focus-within {
|
|
5016
|
-
border-radius: var(--rounded-sm);
|
|
5017
|
-
box-shadow: var(--elevation-100);
|
|
5018
|
-
border: 1px solid var(--accent-dark-active);
|
|
5019
|
-
outline: none;
|
|
5020
|
-
}
|
|
5021
|
-
&:hover {
|
|
5022
|
-
border: 1px solid var(--accent-dark-hover);
|
|
5023
|
-
}
|
|
5024
|
-
|
|
5025
|
-
&:disabled,
|
|
5026
|
-
&:disabled::placeholder,
|
|
5027
|
-
&:disabled:hover {
|
|
5028
|
-
border-radius: var(--rounded-sm);
|
|
5029
|
-
cursor: not-allowed;
|
|
5030
|
-
color: var(--gray-400);
|
|
5031
|
-
}
|
|
5032
|
-
|
|
5033
|
-
&[readonly],
|
|
5034
|
-
&[contenteditable='false'] {
|
|
5035
|
-
cursor: not-allowed;
|
|
5036
|
-
color: var(--gray-400);
|
|
5037
|
-
}
|
|
5038
|
-
|
|
5039
|
-
> p {
|
|
5040
|
-
margin: 0;
|
|
5041
|
-
}
|
|
5042
|
-
`;
|
|
5043
|
-
var inputMultiLine = (lines) => import_react51.css`
|
|
5044
|
-
${import_design_system21.scrollbarStyles}
|
|
5045
|
-
// 1.5 = line height, spacing-sm = top and bottom padding + spacing-xs to give a slight increase in height
|
|
5046
|
-
// as the text looked to close to the bottom of the input
|
|
5047
|
-
height: calc(${lines * 1.5}em + var(--spacing-sm) + var(--spacing-xs));
|
|
5048
|
-
resize: vertical;
|
|
5049
|
-
overflow: auto;
|
|
5050
|
-
`;
|
|
5051
|
-
|
|
5052
|
-
// src/components/Variables/ParameterConnectionIndicator.tsx
|
|
5119
|
+
var import_react53 = require("react");
|
|
5053
5120
|
var import_jsx_runtime41 = require("@emotion/react/jsx-runtime");
|
|
5054
5121
|
function ParameterConnectionIndicator({
|
|
5055
5122
|
children,
|
|
@@ -5058,7 +5125,7 @@ function ParameterConnectionIndicator({
|
|
|
5058
5125
|
disabled,
|
|
5059
5126
|
menuTooltip = "Insert variable"
|
|
5060
5127
|
}) {
|
|
5061
|
-
const hasVariablesInValue = (0,
|
|
5128
|
+
const hasVariablesInValue = (0, import_react53.useMemo)(() => {
|
|
5062
5129
|
let result = false;
|
|
5063
5130
|
(0, import_canvas7.bindVariablesToObject)({
|
|
5064
5131
|
value,
|
|
@@ -5081,7 +5148,7 @@ function ParameterConnectionIndicator({
|
|
|
5081
5148
|
{
|
|
5082
5149
|
title: menuTooltip,
|
|
5083
5150
|
"aria-pressed": hasVariablesInValue,
|
|
5084
|
-
css: [menuBtn,
|
|
5151
|
+
css: [menuBtn, variableBindButton],
|
|
5085
5152
|
type: "button",
|
|
5086
5153
|
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_CgUsbC2.CgUsbC, { size: "1.4rem" })
|
|
5087
5154
|
}
|
|
@@ -5095,21 +5162,21 @@ function ParameterConnectionIndicator({
|
|
|
5095
5162
|
|
|
5096
5163
|
// src/components/Variables/ParameterOrSingleVariable.tsx
|
|
5097
5164
|
var import_design_system23 = require("@uniformdev/design-system");
|
|
5098
|
-
var
|
|
5165
|
+
var import_react55 = require("react");
|
|
5099
5166
|
|
|
5100
5167
|
// src/components/Variables/composer/OnDisconnectPlugin.tsx
|
|
5101
5168
|
var import_LexicalComposerContext10 = require("@lexical/react/LexicalComposerContext");
|
|
5102
5169
|
var import_utils5 = require("@lexical/utils");
|
|
5103
5170
|
var import_lexical10 = require("lexical");
|
|
5104
|
-
var
|
|
5171
|
+
var import_react54 = require("react");
|
|
5105
5172
|
function OnDisconnectPlugin({
|
|
5106
5173
|
onDisconnect
|
|
5107
5174
|
}) {
|
|
5108
5175
|
const [editor] = (0, import_LexicalComposerContext10.useLexicalComposerContext)();
|
|
5109
5176
|
const { variables } = useVariables(true);
|
|
5110
|
-
const variablesRef = (0,
|
|
5177
|
+
const variablesRef = (0, import_react54.useRef)(variables);
|
|
5111
5178
|
variablesRef.current = variables;
|
|
5112
|
-
(0,
|
|
5179
|
+
(0, import_react54.useEffect)(() => {
|
|
5113
5180
|
return (0, import_utils5.mergeRegister)(
|
|
5114
5181
|
editor.registerCommand(
|
|
5115
5182
|
DISCONNECT_VARIABLE_COMMAND,
|
|
@@ -5154,7 +5221,7 @@ function ParameterOrSingleVariable(props) {
|
|
|
5154
5221
|
hasVariablesInValue,
|
|
5155
5222
|
setHadVariablesInValue
|
|
5156
5223
|
} = useInputVariablesState(props);
|
|
5157
|
-
const handleDisconnect = (0,
|
|
5224
|
+
const handleDisconnect = (0, import_react55.useCallback)(
|
|
5158
5225
|
(variable) => {
|
|
5159
5226
|
setHadVariablesInValue(false);
|
|
5160
5227
|
if (onDisconnect) {
|
|
@@ -5193,7 +5260,7 @@ function ParameterOrSingleVariable(props) {
|
|
|
5193
5260
|
VariablesComposerVariableMenu,
|
|
5194
5261
|
{
|
|
5195
5262
|
...sharedMenuProps,
|
|
5196
|
-
buttonCss: [
|
|
5263
|
+
buttonCss: [variableBindButton],
|
|
5197
5264
|
buttonProps: hasVariablesInValue ? { "aria-pressed": "true" } : void 0,
|
|
5198
5265
|
replaceValueOnVariableInsert: true,
|
|
5199
5266
|
filterVariable
|
|
@@ -5207,7 +5274,7 @@ function ParameterOrSingleVariable(props) {
|
|
|
5207
5274
|
}
|
|
5208
5275
|
|
|
5209
5276
|
// src/components/Variables/ParameterVariables.tsx
|
|
5210
|
-
var
|
|
5277
|
+
var import_react56 = require("@emotion/react");
|
|
5211
5278
|
var import_design_system24 = require("@uniformdev/design-system");
|
|
5212
5279
|
var import_jsx_runtime43 = require("@emotion/react/jsx-runtime");
|
|
5213
5280
|
function ParameterVariables(props) {
|
|
@@ -5266,8 +5333,8 @@ function ParameterVariables(props) {
|
|
|
5266
5333
|
"data-text-value": value,
|
|
5267
5334
|
css: [
|
|
5268
5335
|
input2,
|
|
5269
|
-
typeof multiLine === "number" ? inputMultiLine(multiLine) : multiLine === true ? inputMultiLine(2) :
|
|
5270
|
-
inputCss != null ? inputCss :
|
|
5336
|
+
typeof multiLine === "number" ? inputMultiLine(multiLine) : multiLine === true ? inputMultiLine(2) : import_react56.css``,
|
|
5337
|
+
inputCss != null ? inputCss : import_react56.css``
|
|
5271
5338
|
]
|
|
5272
5339
|
}
|
|
5273
5340
|
) }),
|
|
@@ -5275,7 +5342,7 @@ function ParameterVariables(props) {
|
|
|
5275
5342
|
VariablesComposerVariableMenu,
|
|
5276
5343
|
{
|
|
5277
5344
|
...sharedMenuProps,
|
|
5278
|
-
buttonCss: [
|
|
5345
|
+
buttonCss: [variableBindButton],
|
|
5279
5346
|
tip: useInputWhenNoVariables ? void 0 : "Tip: access this list by typing $$",
|
|
5280
5347
|
buttonProps: hasVariablesInValue ? { "aria-pressed": "true" } : void 0,
|
|
5281
5348
|
replaceValueOnVariableInsert: useInputWhenNoVariables
|
|
@@ -5303,13 +5370,13 @@ ${prettifyBindExpression(bindExpression)}`
|
|
|
5303
5370
|
}
|
|
5304
5371
|
|
|
5305
5372
|
// src/components/Variables/VariablesList.tsx
|
|
5306
|
-
var
|
|
5373
|
+
var import_react58 = require("@emotion/react");
|
|
5307
5374
|
var import_design_system25 = require("@uniformdev/design-system");
|
|
5308
5375
|
var import_react_beautiful_dnd3 = require("react-beautiful-dnd");
|
|
5309
5376
|
|
|
5310
5377
|
// src/components/Variables/styles/VariablesList.styles.ts
|
|
5311
|
-
var
|
|
5312
|
-
var tableRow = (isDragging) =>
|
|
5378
|
+
var import_react57 = require("@emotion/react");
|
|
5379
|
+
var tableRow = (isDragging) => import_react57.css`
|
|
5313
5380
|
position: relative;
|
|
5314
5381
|
${isDragging ? `
|
|
5315
5382
|
display: table;
|
|
@@ -5317,7 +5384,7 @@ var tableRow = (isDragging) => import_react56.css`
|
|
|
5317
5384
|
top: auto !important;
|
|
5318
5385
|
` : void 0}
|
|
5319
5386
|
`;
|
|
5320
|
-
var tableCellDragIcon =
|
|
5387
|
+
var tableCellDragIcon = import_react57.css`
|
|
5321
5388
|
&::after {
|
|
5322
5389
|
content: '';
|
|
5323
5390
|
display: block;
|
|
@@ -5335,7 +5402,7 @@ var tableCellDragIcon = import_react56.css`
|
|
|
5335
5402
|
opacity: 1;
|
|
5336
5403
|
}
|
|
5337
5404
|
`;
|
|
5338
|
-
var variableName =
|
|
5405
|
+
var variableName = import_react57.css`
|
|
5339
5406
|
border: none;
|
|
5340
5407
|
font-weight: var(--fw-medium);
|
|
5341
5408
|
padding: 0;
|
|
@@ -5345,7 +5412,7 @@ var variableName = import_react56.css`
|
|
|
5345
5412
|
white-space: nowrap;
|
|
5346
5413
|
max-width: 20ch;
|
|
5347
5414
|
`;
|
|
5348
|
-
var variableValue =
|
|
5415
|
+
var variableValue = import_react57.css`
|
|
5349
5416
|
overflow: hidden;
|
|
5350
5417
|
text-overflow: ellipsis;
|
|
5351
5418
|
white-space: nowrap;
|
|
@@ -5422,7 +5489,7 @@ function VariablesList() {
|
|
|
5422
5489
|
title: `delete ${text}`,
|
|
5423
5490
|
css: [
|
|
5424
5491
|
import_design_system25.button,
|
|
5425
|
-
|
|
5492
|
+
import_react58.css`
|
|
5426
5493
|
background: transparent;
|
|
5427
5494
|
`
|
|
5428
5495
|
],
|
|
@@ -5551,9 +5618,9 @@ function TextVariableRenderer({ definition, value, setValue }) {
|
|
|
5551
5618
|
}
|
|
5552
5619
|
|
|
5553
5620
|
// src/components/Request/RequestBody.tsx
|
|
5554
|
-
var
|
|
5621
|
+
var import_react60 = require("@emotion/react");
|
|
5555
5622
|
var import_design_system27 = require("@uniformdev/design-system");
|
|
5556
|
-
var
|
|
5623
|
+
var import_react61 = require("react");
|
|
5557
5624
|
|
|
5558
5625
|
// src/components/Request/RequestProvider.tsx
|
|
5559
5626
|
var React11 = __toESM(require("react"));
|
|
@@ -5637,11 +5704,11 @@ function useRequest() {
|
|
|
5637
5704
|
}
|
|
5638
5705
|
|
|
5639
5706
|
// src/components/Request/styles/Request.styles.ts
|
|
5640
|
-
var
|
|
5641
|
-
var innerContentStyles =
|
|
5707
|
+
var import_react59 = require("@emotion/react");
|
|
5708
|
+
var innerContentStyles = import_react59.css`
|
|
5642
5709
|
background: var(--white);
|
|
5643
5710
|
`;
|
|
5644
|
-
var requestTypeContainer = (bgColor) =>
|
|
5711
|
+
var requestTypeContainer = (bgColor) => import_react59.css`
|
|
5645
5712
|
align-items: start;
|
|
5646
5713
|
background: ${bgColor};
|
|
5647
5714
|
display: grid;
|
|
@@ -5679,11 +5746,11 @@ var LANGUAGE_TO_CONTENT_TYPE = {
|
|
|
5679
5746
|
};
|
|
5680
5747
|
function RequestBody() {
|
|
5681
5748
|
const { request, dispatch } = useRequest();
|
|
5682
|
-
const [language, setLanguage] = (0,
|
|
5749
|
+
const [language, setLanguage] = (0, import_react61.useState)("json");
|
|
5683
5750
|
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
5684
5751
|
"div",
|
|
5685
5752
|
{
|
|
5686
|
-
css:
|
|
5753
|
+
css: import_react60.css`
|
|
5687
5754
|
background: var(--white);
|
|
5688
5755
|
`,
|
|
5689
5756
|
children: [
|
|
@@ -5691,7 +5758,7 @@ function RequestBody() {
|
|
|
5691
5758
|
RequestTypeContainer,
|
|
5692
5759
|
{
|
|
5693
5760
|
bgColor: "var(--gray-100)",
|
|
5694
|
-
css:
|
|
5761
|
+
css: import_react60.css`
|
|
5695
5762
|
padding: var(--spacing-sm) var(--spacing-base);
|
|
5696
5763
|
`,
|
|
5697
5764
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
@@ -5962,8 +6029,8 @@ function RequestParameters({
|
|
|
5962
6029
|
}
|
|
5963
6030
|
|
|
5964
6031
|
// src/components/Request/RequestUrl.tsx
|
|
5965
|
-
var
|
|
5966
|
-
var
|
|
6032
|
+
var import_react62 = require("@emotion/react");
|
|
6033
|
+
var import_react63 = require("react");
|
|
5967
6034
|
|
|
5968
6035
|
// src/components/Request/urlEncodeRequestParameter.ts
|
|
5969
6036
|
function urlEncodeRequestUrl(url, varValues) {
|
|
@@ -5989,7 +6056,7 @@ function RequestUrl() {
|
|
|
5989
6056
|
var _a, _b;
|
|
5990
6057
|
const { variables } = useVariables();
|
|
5991
6058
|
const { request } = useRequest();
|
|
5992
|
-
const mergedParameters = (0,
|
|
6059
|
+
const mergedParameters = (0, import_react63.useMemo)(() => {
|
|
5993
6060
|
var _a2;
|
|
5994
6061
|
if (!((_a2 = request.baseRequest) == null ? void 0 : _a2.parameters)) {
|
|
5995
6062
|
return request.parameters;
|
|
@@ -5999,7 +6066,7 @@ function RequestUrl() {
|
|
|
5999
6066
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
6000
6067
|
"small",
|
|
6001
6068
|
{
|
|
6002
|
-
css:
|
|
6069
|
+
css: import_react62.css`
|
|
6003
6070
|
display: inline-block;
|
|
6004
6071
|
margin-bottom: var(--spacing-xs);
|
|
6005
6072
|
word-break: break-word;
|
|
@@ -6237,12 +6304,12 @@ var import_design_system31 = require("@uniformdev/design-system");
|
|
|
6237
6304
|
|
|
6238
6305
|
// src/hooks/useInitializeUniformMeshSdk.ts
|
|
6239
6306
|
var import_mesh_sdk = require("@uniformdev/mesh-sdk");
|
|
6240
|
-
var
|
|
6307
|
+
var import_react64 = require("react");
|
|
6241
6308
|
var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
|
|
6242
|
-
const [error, setError] = (0,
|
|
6243
|
-
const [sdk, setSdk] = (0,
|
|
6244
|
-
const initializationInProgress = (0,
|
|
6245
|
-
(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)(
|
|
6246
6313
|
() => {
|
|
6247
6314
|
if (typeof window === "undefined" || sdk) {
|
|
6248
6315
|
return;
|
|
@@ -6300,7 +6367,7 @@ var MeshApp = ({
|
|
|
6300
6367
|
};
|
|
6301
6368
|
|
|
6302
6369
|
// src/components/ObjectSearch/DataRefreshButton.tsx
|
|
6303
|
-
var
|
|
6370
|
+
var import_react65 = require("@emotion/react");
|
|
6304
6371
|
var import_design_system32 = require("@uniformdev/design-system");
|
|
6305
6372
|
var import_jsx_runtime58 = require("@emotion/react/jsx-runtime");
|
|
6306
6373
|
var DataRefreshButton = ({
|
|
@@ -6313,7 +6380,7 @@ var DataRefreshButton = ({
|
|
|
6313
6380
|
!isLoading ? null : /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
6314
6381
|
import_design_system32.LoadingIndicator,
|
|
6315
6382
|
{
|
|
6316
|
-
css:
|
|
6383
|
+
css: import_react65.css`
|
|
6317
6384
|
${isLoading ? "opacity: 0.2;" : void 0}
|
|
6318
6385
|
`
|
|
6319
6386
|
}
|
|
@@ -6323,15 +6390,15 @@ var DataRefreshButton = ({
|
|
|
6323
6390
|
};
|
|
6324
6391
|
|
|
6325
6392
|
// src/components/ObjectSearch/ObjectSearchContainer.tsx
|
|
6326
|
-
var
|
|
6393
|
+
var import_react68 = require("@emotion/react");
|
|
6327
6394
|
var import_canvas9 = require("@uniformdev/canvas");
|
|
6328
6395
|
var import_design_system35 = require("@uniformdev/design-system");
|
|
6329
6396
|
|
|
6330
6397
|
// src/components/ObjectSearch/hooks/ObjectSearchContext.tsx
|
|
6331
6398
|
var import_canvas8 = require("@uniformdev/canvas");
|
|
6332
|
-
var
|
|
6399
|
+
var import_react66 = require("react");
|
|
6333
6400
|
var import_jsx_runtime59 = require("@emotion/react/jsx-runtime");
|
|
6334
|
-
var ObjectSearchContext = (0,
|
|
6401
|
+
var ObjectSearchContext = (0, import_react66.createContext)({
|
|
6335
6402
|
onSetQuery: () => {
|
|
6336
6403
|
},
|
|
6337
6404
|
onSelectItem: () => {
|
|
@@ -6352,16 +6419,16 @@ var ObjectSearchProvider = ({
|
|
|
6352
6419
|
children,
|
|
6353
6420
|
defaultQuery
|
|
6354
6421
|
}) => {
|
|
6355
|
-
const [query, setQuery] = (0,
|
|
6422
|
+
const [query, setQuery] = (0, import_react66.useState)({
|
|
6356
6423
|
contentType: "",
|
|
6357
6424
|
keyword: "",
|
|
6358
6425
|
...defaultQuery
|
|
6359
6426
|
});
|
|
6360
6427
|
const { flatVariables } = useVariables(true);
|
|
6361
|
-
const querySearchDeferred = (0,
|
|
6362
|
-
const [selectedItems, setSelectedItems] = (0,
|
|
6363
|
-
const [list, setList] = (0,
|
|
6364
|
-
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)(
|
|
6365
6432
|
(value2) => {
|
|
6366
6433
|
if (Array.isArray(value2.contentType) && value2.contentType.length > 0) {
|
|
6367
6434
|
return setQuery({
|
|
@@ -6373,7 +6440,7 @@ var ObjectSearchProvider = ({
|
|
|
6373
6440
|
},
|
|
6374
6441
|
[setQuery]
|
|
6375
6442
|
);
|
|
6376
|
-
const onSelectItem = (0,
|
|
6443
|
+
const onSelectItem = (0, import_react66.useCallback)(
|
|
6377
6444
|
(selectedResult) => {
|
|
6378
6445
|
if (Array.isArray(selectedResult)) {
|
|
6379
6446
|
setSelectedItems(selectedResult);
|
|
@@ -6387,17 +6454,17 @@ var ObjectSearchProvider = ({
|
|
|
6387
6454
|
},
|
|
6388
6455
|
[setSelectedItems, selectedItems]
|
|
6389
6456
|
);
|
|
6390
|
-
const onRemoveAllSelectedItems = (0,
|
|
6457
|
+
const onRemoveAllSelectedItems = (0, import_react66.useCallback)(() => {
|
|
6391
6458
|
setSelectedItems([]);
|
|
6392
6459
|
}, [setSelectedItems]);
|
|
6393
|
-
const onSetList = (0,
|
|
6460
|
+
const onSetList = (0, import_react66.useCallback)(
|
|
6394
6461
|
(value2) => {
|
|
6395
6462
|
setList(value2);
|
|
6396
6463
|
},
|
|
6397
6464
|
[setList]
|
|
6398
6465
|
);
|
|
6399
|
-
const boundQuery = (0,
|
|
6400
|
-
const value = (0,
|
|
6466
|
+
const boundQuery = (0, import_react66.useMemo)(() => bindQuery(query, flatVariables), [query, flatVariables]);
|
|
6467
|
+
const value = (0, import_react66.useMemo)(
|
|
6401
6468
|
() => ({
|
|
6402
6469
|
boundQuery,
|
|
6403
6470
|
onSetQuery,
|
|
@@ -6424,7 +6491,7 @@ var ObjectSearchProvider = ({
|
|
|
6424
6491
|
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(ObjectSearchContext.Provider, { value, children });
|
|
6425
6492
|
};
|
|
6426
6493
|
function useObjectSearchContext() {
|
|
6427
|
-
return (0,
|
|
6494
|
+
return (0, import_react66.useContext)(ObjectSearchContext);
|
|
6428
6495
|
}
|
|
6429
6496
|
function bindQuery(query, inputs) {
|
|
6430
6497
|
const { result, errors } = (0, import_canvas8.bindVariablesToObject)({
|
|
@@ -6442,9 +6509,9 @@ function bindQuery(query, inputs) {
|
|
|
6442
6509
|
var import_design_system34 = require("@uniformdev/design-system");
|
|
6443
6510
|
|
|
6444
6511
|
// src/components/ObjectSearch/styles/ObjectSearchListItem.styles.ts
|
|
6445
|
-
var
|
|
6512
|
+
var import_react67 = require("@emotion/react");
|
|
6446
6513
|
var import_design_system33 = require("@uniformdev/design-system");
|
|
6447
|
-
var ObjectListItemContainer =
|
|
6514
|
+
var ObjectListItemContainer = import_react67.css`
|
|
6448
6515
|
align-items: center;
|
|
6449
6516
|
border: 1px solid var(--gray-300);
|
|
6450
6517
|
border-radius: var(--rounded-base);
|
|
@@ -6453,11 +6520,11 @@ var ObjectListItemContainer = import_react66.css`
|
|
|
6453
6520
|
grid-template-columns: 1fr auto;
|
|
6454
6521
|
padding: var(--spacing-sm);
|
|
6455
6522
|
`;
|
|
6456
|
-
var ObjectListItemContainerDisabled =
|
|
6523
|
+
var ObjectListItemContainerDisabled = import_react67.css`
|
|
6457
6524
|
opacity: var(--opacity-50);
|
|
6458
6525
|
pointer-events: none;
|
|
6459
6526
|
`;
|
|
6460
|
-
var ObjectListItemLoading =
|
|
6527
|
+
var ObjectListItemLoading = import_react67.css`
|
|
6461
6528
|
animation: ${import_design_system33.skeletonLoading} 1s linear infinite alternate;
|
|
6462
6529
|
border-color: transparent;
|
|
6463
6530
|
min-height: 42px;
|
|
@@ -6481,36 +6548,36 @@ var ObjectListItemLoading = import_react66.css`
|
|
|
6481
6548
|
width: 1rem;
|
|
6482
6549
|
}
|
|
6483
6550
|
`;
|
|
6484
|
-
var ObjectListItemHeadingGroup =
|
|
6551
|
+
var ObjectListItemHeadingGroup = import_react67.css`
|
|
6485
6552
|
align-items: center;
|
|
6486
6553
|
display: grid;
|
|
6487
6554
|
`;
|
|
6488
|
-
var ObjectListItemThumbnail =
|
|
6555
|
+
var ObjectListItemThumbnail = import_react67.css`
|
|
6489
6556
|
width: 30px;
|
|
6490
6557
|
object-fit: contain;
|
|
6491
6558
|
`;
|
|
6492
|
-
var ObjectListItemTitle =
|
|
6559
|
+
var ObjectListItemTitle = import_react67.css`
|
|
6493
6560
|
color: var(--typography-base);
|
|
6494
6561
|
display: block;
|
|
6495
6562
|
font-size: var(--fs-sm);
|
|
6496
6563
|
`;
|
|
6497
|
-
var ObjectListItemSubtitle =
|
|
6564
|
+
var ObjectListItemSubtitle = import_react67.css`
|
|
6498
6565
|
color: var(--gray-500);
|
|
6499
6566
|
display: block;
|
|
6500
6567
|
font-size: var(--fs-xs);
|
|
6501
6568
|
line-height: 1;
|
|
6502
6569
|
`;
|
|
6503
|
-
var ObjectListItemInfoContainer =
|
|
6570
|
+
var ObjectListItemInfoContainer = import_react67.css`
|
|
6504
6571
|
align-items: center;
|
|
6505
6572
|
display: flex;
|
|
6506
6573
|
gap: var(--spacing-sm);
|
|
6507
6574
|
justify-content: center;
|
|
6508
6575
|
`;
|
|
6509
|
-
var ObjectListItemControlledContent =
|
|
6576
|
+
var ObjectListItemControlledContent = import_react67.css`
|
|
6510
6577
|
display: flex;
|
|
6511
6578
|
gap: var(--spacing-sm);
|
|
6512
6579
|
`;
|
|
6513
|
-
var ObjectListItemUnControlledContent =
|
|
6580
|
+
var ObjectListItemUnControlledContent = import_react67.css`
|
|
6514
6581
|
margin-top: var(--spacing-sm);
|
|
6515
6582
|
grid-column: 1 / -1;
|
|
6516
6583
|
`;
|
|
@@ -6597,7 +6664,7 @@ var ObjectSearchContainer = ({
|
|
|
6597
6664
|
import_design_system35.ScrollableList,
|
|
6598
6665
|
{
|
|
6599
6666
|
role: "list",
|
|
6600
|
-
css:
|
|
6667
|
+
css: import_react68.css`
|
|
6601
6668
|
> div {
|
|
6602
6669
|
transition: max-height var(--duration-slow) var(--timing-ease-out);
|
|
6603
6670
|
max-height: ${selectedListItems.length === 0 ? "50vh" : "184px"};
|
|
@@ -6670,11 +6737,11 @@ var DefaultResultList = () => {
|
|
|
6670
6737
|
|
|
6671
6738
|
// src/components/ObjectSearch/ObjectSearchFilter.tsx
|
|
6672
6739
|
var import_design_system36 = require("@uniformdev/design-system");
|
|
6673
|
-
var
|
|
6740
|
+
var import_react70 = require("react");
|
|
6674
6741
|
|
|
6675
6742
|
// src/components/ObjectSearch/styles/ObjectSearchFilterContainer.styles.ts
|
|
6676
|
-
var
|
|
6677
|
-
var ObjectSearchFilterContainerLabel =
|
|
6743
|
+
var import_react69 = require("@emotion/react");
|
|
6744
|
+
var ObjectSearchFilterContainerLabel = import_react69.css`
|
|
6678
6745
|
align-items: center;
|
|
6679
6746
|
display: flex;
|
|
6680
6747
|
font-size: var(--fs-sm);
|
|
@@ -6682,11 +6749,11 @@ var ObjectSearchFilterContainerLabel = import_react68.css`
|
|
|
6682
6749
|
line-height: 1rem;
|
|
6683
6750
|
margin-bottom: var(--spacing-sm);
|
|
6684
6751
|
`;
|
|
6685
|
-
var ObjectSearchFilterContainer =
|
|
6752
|
+
var ObjectSearchFilterContainer = import_react69.css`
|
|
6686
6753
|
display: grid;
|
|
6687
6754
|
gap: var(--spacing-base);
|
|
6688
6755
|
`;
|
|
6689
|
-
var ObjectSearchFilterGrid = (gridColumns) =>
|
|
6756
|
+
var ObjectSearchFilterGrid = (gridColumns) => import_react69.css`
|
|
6690
6757
|
display: grid;
|
|
6691
6758
|
grid-template-columns: ${gridColumns};
|
|
6692
6759
|
gap: var(--spacing-base);
|
|
@@ -6704,7 +6771,7 @@ var ObjectSearchFilter = ({
|
|
|
6704
6771
|
}) => {
|
|
6705
6772
|
var _a, _b;
|
|
6706
6773
|
const { query, onSetQuery } = useObjectSearchContext();
|
|
6707
|
-
const [searchState, setSearchState] = (0,
|
|
6774
|
+
const [searchState, setSearchState] = (0, import_react70.useState)({
|
|
6708
6775
|
contentType: (_a = query.contentType) != null ? _a : "",
|
|
6709
6776
|
keyword: (_b = query.keyword) != null ? _b : ""
|
|
6710
6777
|
});
|
|
@@ -6714,7 +6781,7 @@ var ObjectSearchFilter = ({
|
|
|
6714
6781
|
});
|
|
6715
6782
|
onSetQuery({ ...query, ...value });
|
|
6716
6783
|
};
|
|
6717
|
-
const memoizedSelectOptions = (0,
|
|
6784
|
+
const memoizedSelectOptions = (0, import_react70.useMemo)(() => {
|
|
6718
6785
|
if (!requireContentType && !(selectOptions == null ? void 0 : selectOptions.length)) {
|
|
6719
6786
|
return [];
|
|
6720
6787
|
}
|
|
@@ -6772,9 +6839,9 @@ var import_design_system38 = require("@uniformdev/design-system");
|
|
|
6772
6839
|
var import_timeago3 = require("timeago.js");
|
|
6773
6840
|
|
|
6774
6841
|
// src/components/ObjectSearch/styles/ObjectSearchResultItemButton.styles.ts
|
|
6775
|
-
var
|
|
6842
|
+
var import_react71 = require("@emotion/react");
|
|
6776
6843
|
var import_design_system37 = require("@uniformdev/design-system");
|
|
6777
|
-
var ButtonStyles =
|
|
6844
|
+
var ButtonStyles = import_react71.css`
|
|
6778
6845
|
${import_design_system37.button}
|
|
6779
6846
|
background: transparent;
|
|
6780
6847
|
border: 1px solid var(--typography-base);
|
|
@@ -6801,7 +6868,7 @@ var ButtonStyles = import_react70.css`
|
|
|
6801
6868
|
text-decoration: none;
|
|
6802
6869
|
}
|
|
6803
6870
|
`;
|
|
6804
|
-
var ButtonIcon =
|
|
6871
|
+
var ButtonIcon = import_react71.css`
|
|
6805
6872
|
width: 1rem;
|
|
6806
6873
|
height: 1rem;
|
|
6807
6874
|
`;
|
|
@@ -6830,8 +6897,8 @@ var LinkButton = ({
|
|
|
6830
6897
|
};
|
|
6831
6898
|
|
|
6832
6899
|
// src/components/ObjectSearch/styles/ObjectSearchResultItem.styles.ts
|
|
6833
|
-
var
|
|
6834
|
-
var ObjectSearchResultItemContainer =
|
|
6900
|
+
var import_react72 = require("@emotion/react");
|
|
6901
|
+
var ObjectSearchResultItemContainer = import_react72.css`
|
|
6835
6902
|
align-items: center;
|
|
6836
6903
|
border: 1px solid var(--gray-300);
|
|
6837
6904
|
border-radius: var(--rounded-base);
|
|
@@ -6847,7 +6914,7 @@ var ObjectSearchResultItemContainer = import_react71.css`
|
|
|
6847
6914
|
}
|
|
6848
6915
|
}
|
|
6849
6916
|
`;
|
|
6850
|
-
var ObjectSearchDragHandle =
|
|
6917
|
+
var ObjectSearchDragHandle = import_react72.css`
|
|
6851
6918
|
border-left: 2px dotted var(--gray-300);
|
|
6852
6919
|
border-right: 2px dotted var(--gray-300);
|
|
6853
6920
|
position: absolute;
|
|
@@ -6856,35 +6923,35 @@ var ObjectSearchDragHandle = import_react71.css`
|
|
|
6856
6923
|
transition: opacity var(--duration-fast) var(--timing-ease-out);
|
|
6857
6924
|
opacity: 0;
|
|
6858
6925
|
`;
|
|
6859
|
-
var ObjectSearchResultItemSubtitle =
|
|
6926
|
+
var ObjectSearchResultItemSubtitle = import_react72.css`
|
|
6860
6927
|
color: var(--gray-500);
|
|
6861
6928
|
display: block;
|
|
6862
6929
|
font-size: var(--fs-xs);
|
|
6863
6930
|
line-height: 1;
|
|
6864
6931
|
`;
|
|
6865
|
-
var ObjectSearchResultItemTitle =
|
|
6932
|
+
var ObjectSearchResultItemTitle = import_react72.css`
|
|
6866
6933
|
align-items: center;
|
|
6867
6934
|
color: var(--typography-base);
|
|
6868
6935
|
display: flex;
|
|
6869
6936
|
gap: var(--spacing-xs);
|
|
6870
6937
|
`;
|
|
6871
|
-
var ObjectSearchResultItemTimeStamp =
|
|
6938
|
+
var ObjectSearchResultItemTimeStamp = import_react72.css`
|
|
6872
6939
|
color: var(--gray-500);
|
|
6873
6940
|
font-size: var(--fs-xs);
|
|
6874
6941
|
`;
|
|
6875
|
-
var ObjectSearchAuthorStateGroup =
|
|
6942
|
+
var ObjectSearchAuthorStateGroup = import_react72.css`
|
|
6876
6943
|
align-items: center;
|
|
6877
6944
|
display: flex;
|
|
6878
6945
|
gap: var(--spacing-sm);
|
|
6879
6946
|
`;
|
|
6880
|
-
var ObjectSearchUpdateGroup =
|
|
6947
|
+
var ObjectSearchUpdateGroup = import_react72.css`
|
|
6881
6948
|
display: grid;
|
|
6882
6949
|
`;
|
|
6883
|
-
var ObjectSearchContentContainer =
|
|
6950
|
+
var ObjectSearchContentContainer = import_react72.css`
|
|
6884
6951
|
display: flex;
|
|
6885
6952
|
gap: var(--spacing-base);
|
|
6886
6953
|
`;
|
|
6887
|
-
var ObjectSearchImage =
|
|
6954
|
+
var ObjectSearchImage = import_react72.css`
|
|
6888
6955
|
width: 56px;
|
|
6889
6956
|
object-fit: contain;
|
|
6890
6957
|
`;
|
|
@@ -6952,26 +7019,26 @@ var import_design_system39 = require("@uniformdev/design-system");
|
|
|
6952
7019
|
var import_react_beautiful_dnd4 = require("react-beautiful-dnd");
|
|
6953
7020
|
|
|
6954
7021
|
// src/components/ObjectSearch/styles/ObjectSearchResultList.styles.ts
|
|
6955
|
-
var
|
|
6956
|
-
var ObjectSearchResultListContainer =
|
|
7022
|
+
var import_react73 = require("@emotion/react");
|
|
7023
|
+
var ObjectSearchResultListContainer = import_react73.css`
|
|
6957
7024
|
align-items: center;
|
|
6958
7025
|
display: flex;
|
|
6959
7026
|
gap: var(--spacing-sm);
|
|
6960
7027
|
justify-content: space-between;
|
|
6961
7028
|
`;
|
|
6962
|
-
var ObjectSearchDragContainer =
|
|
7029
|
+
var ObjectSearchDragContainer = import_react73.css`
|
|
6963
7030
|
margin: 0 0 var(--spacing-sm);
|
|
6964
7031
|
`;
|
|
6965
|
-
var ObjectSearchContainerDragging =
|
|
7032
|
+
var ObjectSearchContainerDragging = import_react73.css`
|
|
6966
7033
|
box-shadow: var(--shadow-base);
|
|
6967
7034
|
opacity: var(--opacity-50);
|
|
6968
7035
|
`;
|
|
6969
|
-
var ObjectSearchResultListCounterContainer =
|
|
7036
|
+
var ObjectSearchResultListCounterContainer = import_react73.css`
|
|
6970
7037
|
align-items: center;
|
|
6971
7038
|
display: flex;
|
|
6972
7039
|
gap: var(--spacing-sm);
|
|
6973
7040
|
`;
|
|
6974
|
-
var ObjectSearchResultListTitle =
|
|
7041
|
+
var ObjectSearchResultListTitle = import_react73.css`
|
|
6975
7042
|
font-weight: var(--fw-bold);
|
|
6976
7043
|
line-height: 1;
|
|
6977
7044
|
`;
|
|
@@ -7076,7 +7143,7 @@ function ObjectSearchResultList({
|
|
|
7076
7143
|
|
|
7077
7144
|
// src/components/ObjectSearch/QueryFilter.tsx
|
|
7078
7145
|
var import_design_system40 = require("@uniformdev/design-system");
|
|
7079
|
-
var
|
|
7146
|
+
var import_react74 = require("react");
|
|
7080
7147
|
var import_jsx_runtime67 = require("@emotion/react/jsx-runtime");
|
|
7081
7148
|
var QueryFilter = ({
|
|
7082
7149
|
requireContentType,
|
|
@@ -7106,7 +7173,7 @@ var QueryFilter = ({
|
|
|
7106
7173
|
}) => {
|
|
7107
7174
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
7108
7175
|
const { query, onSetQuery } = useObjectSearchContext();
|
|
7109
|
-
const [queryState, setQueryState] = (0,
|
|
7176
|
+
const [queryState, setQueryState] = (0, import_react74.useState)({
|
|
7110
7177
|
contentType: (_a = query.contentType) != null ? _a : "",
|
|
7111
7178
|
keyword: (_b = query.keyword) != null ? _b : "",
|
|
7112
7179
|
count: (_c = query.count) != null ? _c : countValue,
|
|
@@ -7117,7 +7184,7 @@ var QueryFilter = ({
|
|
|
7117
7184
|
setQueryState((prev) => ({ ...prev, ...value }));
|
|
7118
7185
|
onSetQuery({ ...query, ...value });
|
|
7119
7186
|
};
|
|
7120
|
-
(0,
|
|
7187
|
+
(0, import_react74.useEffect)(() => {
|
|
7121
7188
|
onSetQuery(queryState);
|
|
7122
7189
|
}, []);
|
|
7123
7190
|
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("fieldset", { children: [
|
|
@@ -7243,7 +7310,7 @@ var QueryFilter = ({
|
|
|
7243
7310
|
};
|
|
7244
7311
|
|
|
7245
7312
|
// src/components/ParamTypeDynamicDataProvider.tsx
|
|
7246
|
-
var
|
|
7313
|
+
var import_react75 = require("react");
|
|
7247
7314
|
var import_jsx_runtime68 = require("@emotion/react/jsx-runtime");
|
|
7248
7315
|
function ParamTypeDynamicDataProvider(props) {
|
|
7249
7316
|
const { children } = props;
|
|
@@ -7252,7 +7319,7 @@ function ParamTypeDynamicDataProvider(props) {
|
|
|
7252
7319
|
} = useMeshLocation("paramType");
|
|
7253
7320
|
const dynamicInputsAsVariables = useDynamicInputsAsVariables(dynamicInputs);
|
|
7254
7321
|
const connectedDataAsVariables = useConnectedDataAsVariables(connectedData);
|
|
7255
|
-
const variables = (0,
|
|
7322
|
+
const variables = (0, import_react75.useMemo)(
|
|
7256
7323
|
() => ({ ...connectedDataAsVariables, ...dynamicInputsAsVariables }),
|
|
7257
7324
|
[dynamicInputsAsVariables, connectedDataAsVariables]
|
|
7258
7325
|
);
|
|
@@ -7265,9 +7332,9 @@ var JsonMeshVariableEditor = ({
|
|
|
7265
7332
|
variable,
|
|
7266
7333
|
context
|
|
7267
7334
|
}) => {
|
|
7268
|
-
const sillyRef = (0,
|
|
7335
|
+
const sillyRef = (0, import_react75.useRef)(false);
|
|
7269
7336
|
const { editConnectedData } = useMeshLocation("paramType");
|
|
7270
|
-
(0,
|
|
7337
|
+
(0, import_react75.useEffect)(() => {
|
|
7271
7338
|
if (sillyRef.current) {
|
|
7272
7339
|
return;
|
|
7273
7340
|
}
|
|
@@ -7295,6 +7362,57 @@ var JsonMeshVariableEditor = ({
|
|
|
7295
7362
|
return null;
|
|
7296
7363
|
};
|
|
7297
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
|
+
|
|
7298
7416
|
// src/utils/createLocationValidator.ts
|
|
7299
7417
|
function createLocationValidator(setValue, validate) {
|
|
7300
7418
|
return (dispatch) => setValue((previous) => {
|
|
@@ -7305,19 +7423,19 @@ function createLocationValidator(setValue, validate) {
|
|
|
7305
7423
|
|
|
7306
7424
|
// src/utils/useContentDataResourceLocaleInfo.ts
|
|
7307
7425
|
var import_canvas10 = require("@uniformdev/canvas");
|
|
7308
|
-
var
|
|
7426
|
+
var import_react76 = require("react");
|
|
7309
7427
|
function useContentDataResourceLocaleInfo({
|
|
7310
7428
|
locale,
|
|
7311
7429
|
setLocale,
|
|
7312
7430
|
dynamicInputs
|
|
7313
7431
|
}) {
|
|
7314
7432
|
var _a;
|
|
7315
|
-
const setLocaleRef = (0,
|
|
7433
|
+
const setLocaleRef = (0, import_react76.useRef)(setLocale);
|
|
7316
7434
|
setLocaleRef.current = setLocale;
|
|
7317
7435
|
const { flatVariables } = useVariables();
|
|
7318
7436
|
const effectiveLocale = locale != null ? locale : dynamicInputs[import_canvas10.LOCALE_DYNAMIC_INPUT_NAME] ? (0, import_canvas10.createVariableReference)(import_canvas10.LOCALE_DYNAMIC_INPUT_NAME) : "";
|
|
7319
7437
|
const boundLocale = (_a = (0, import_canvas10.bindVariables)({ variables: flatVariables, value: effectiveLocale }).result) != null ? _a : effectiveLocale;
|
|
7320
|
-
(0,
|
|
7438
|
+
(0, import_react76.useEffect)(() => {
|
|
7321
7439
|
if (locale === void 0 && effectiveLocale && setLocaleRef.current) {
|
|
7322
7440
|
setLocaleRef.current((0, import_canvas10.createVariableReference)(import_canvas10.LOCALE_DYNAMIC_INPUT_NAME));
|
|
7323
7441
|
}
|
|
@@ -7326,7 +7444,7 @@ function useContentDataResourceLocaleInfo({
|
|
|
7326
7444
|
}
|
|
7327
7445
|
|
|
7328
7446
|
// src/index.ts
|
|
7329
|
-
var
|
|
7447
|
+
var import_design_system43 = require("@uniformdev/design-system");
|
|
7330
7448
|
__reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
|
|
7331
7449
|
// Annotate the CommonJS export names for ESM import in node:
|
|
7332
7450
|
0 && (module.exports = {
|
|
@@ -7424,6 +7542,7 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
|
|
|
7424
7542
|
VariablesPlugin,
|
|
7425
7543
|
VariablesProvider,
|
|
7426
7544
|
badgeIcon,
|
|
7545
|
+
bindableFiltersMapper,
|
|
7427
7546
|
convertConnectedDataToVariable,
|
|
7428
7547
|
createLocationValidator,
|
|
7429
7548
|
damSelectItemImage,
|