@uniformdev/mesh-sdk-react 19.136.0 → 19.138.0
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 +54 -2
- package/dist/index.d.ts +54 -2
- package/dist/index.esm.js +279 -194
- package/dist/index.js +373 -296
- package/dist/index.mjs +279 -194
- 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,
|
|
@@ -4231,8 +4232,9 @@ function $isTargetWithinDecorator(target) {
|
|
|
4231
4232
|
}
|
|
4232
4233
|
|
|
4233
4234
|
// src/components/Variables/InputVariables.tsx
|
|
4234
|
-
var
|
|
4235
|
-
var
|
|
4235
|
+
var import_react51 = require("@emotion/react");
|
|
4236
|
+
var import_design_system21 = require("@uniformdev/design-system");
|
|
4237
|
+
var import_react52 = require("react");
|
|
4236
4238
|
var import_uuid2 = require("uuid");
|
|
4237
4239
|
|
|
4238
4240
|
// src/components/Variables/composer/EditorRefPlugin.tsx
|
|
@@ -4356,9 +4358,102 @@ var placeholderCompact = import_react42.css`
|
|
|
4356
4358
|
inset: var(--spacing-sm) var(--spacing-lg) var(--spacing-sm) var(--spacing-base);
|
|
4357
4359
|
`;
|
|
4358
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
|
+
|
|
4359
4454
|
// src/components/Variables/toolbox/InputVariablesProvider.tsx
|
|
4360
4455
|
var React10 = __toESM(require("react"));
|
|
4361
|
-
var
|
|
4456
|
+
var import_react44 = require("react");
|
|
4362
4457
|
|
|
4363
4458
|
// src/components/Variables/util/hasReferencedVariables.ts
|
|
4364
4459
|
var import_canvas5 = require("@uniformdev/canvas");
|
|
@@ -4403,7 +4498,7 @@ function useInputVariablesState({
|
|
|
4403
4498
|
const hadVariablesInValueForReals = inputWhenNoVariables ? hadVariablesInValue : hasVariablesInValue;
|
|
4404
4499
|
const disableVariablesForReals = disableVariables || Object.keys(variables).length === 0 && !showAddVariableMenuOption;
|
|
4405
4500
|
const disableResetForReals = !inputWhenNoVariables || !hadVariablesInValueForReals;
|
|
4406
|
-
const sharedMenuProps = (0,
|
|
4501
|
+
const sharedMenuProps = (0, import_react44.useMemo)(
|
|
4407
4502
|
() => ({
|
|
4408
4503
|
menuTooltip,
|
|
4409
4504
|
showAddVariableMenuOption,
|
|
@@ -4434,15 +4529,15 @@ function useInputVariablesState({
|
|
|
4434
4529
|
}
|
|
4435
4530
|
|
|
4436
4531
|
// src/components/Variables/toolbox/VariableField.styles.ts
|
|
4437
|
-
var
|
|
4438
|
-
var labelText =
|
|
4532
|
+
var import_react45 = require("@emotion/react");
|
|
4533
|
+
var labelText = import_react45.css`
|
|
4439
4534
|
align-items: center;
|
|
4440
4535
|
display: flex;
|
|
4441
4536
|
gap: var(--spacing-xs);
|
|
4442
4537
|
font-weight: var(--fw-regular);
|
|
4443
4538
|
margin: 0 0 var(--spacing-xs);
|
|
4444
4539
|
`;
|
|
4445
|
-
var
|
|
4540
|
+
var variableBindButton2 = import_react45.css`
|
|
4446
4541
|
align-items: center;
|
|
4447
4542
|
border: none;
|
|
4448
4543
|
border-radius: var(--rounded-base);
|
|
@@ -4473,8 +4568,8 @@ var import_lexical6 = require("lexical");
|
|
|
4473
4568
|
// src/components/Variables/toolbox/SelectVariableMenu.tsx
|
|
4474
4569
|
var import_BsFillPlusCircleFill = require("@react-icons/all-files/bs/BsFillPlusCircleFill");
|
|
4475
4570
|
var import_CgUsbC = require("@react-icons/all-files/cg/CgUsbC");
|
|
4476
|
-
var
|
|
4477
|
-
var
|
|
4571
|
+
var import_design_system20 = require("@uniformdev/design-system");
|
|
4572
|
+
var import_react46 = require("react");
|
|
4478
4573
|
var import_jsx_runtime35 = require("@emotion/react/jsx-runtime");
|
|
4479
4574
|
function SelectVariableMenu({
|
|
4480
4575
|
onSelectVariable,
|
|
@@ -4489,7 +4584,7 @@ function SelectVariableMenu({
|
|
|
4489
4584
|
filterVariable
|
|
4490
4585
|
}) {
|
|
4491
4586
|
const { variables, canDispatch, readOnly } = useVariables(true);
|
|
4492
|
-
const btnRef = (0,
|
|
4587
|
+
const btnRef = (0, import_react46.useRef)(null);
|
|
4493
4588
|
const { editVariable } = useVariableEditor();
|
|
4494
4589
|
const variablesGroups = variablesToGroupedList(variables, filterVariable, getEditorContext == null ? void 0 : getEditorContext());
|
|
4495
4590
|
const showAddVariableMenuOptionForReals = showAddVariableMenuOption && canDispatch && !readOnly;
|
|
@@ -4498,7 +4593,7 @@ function SelectVariableMenu({
|
|
|
4498
4593
|
return null;
|
|
4499
4594
|
}
|
|
4500
4595
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
4501
|
-
|
|
4596
|
+
import_design_system20.Menu,
|
|
4502
4597
|
{
|
|
4503
4598
|
placement: portal ? "bottom-end" : "bottom-start",
|
|
4504
4599
|
portal,
|
|
@@ -4517,7 +4612,7 @@ function SelectVariableMenu({
|
|
|
4517
4612
|
menuLabel: menuTooltip,
|
|
4518
4613
|
children: [
|
|
4519
4614
|
showAddVariableMenuOptionForReals ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4520
|
-
|
|
4615
|
+
import_design_system20.MenuItem,
|
|
4521
4616
|
{
|
|
4522
4617
|
onClick: async () => {
|
|
4523
4618
|
const result = await editVariable("", getEditorContext == null ? void 0 : getEditorContext());
|
|
@@ -4527,19 +4622,19 @@ function SelectVariableMenu({
|
|
|
4527
4622
|
onSelectVariable == null ? void 0 : onSelectVariable(result.selectedVariable);
|
|
4528
4623
|
},
|
|
4529
4624
|
"data-testid": "add-variable-button",
|
|
4530
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
4625
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_design_system20.HorizontalRhythm, { gap: "sm", align: "center", children: [
|
|
4531
4626
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_BsFillPlusCircleFill.BsFillPlusCircleFill, { fill: "var(--gray-500)", size: "1.25em" }),
|
|
4532
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" }) })
|
|
4533
4628
|
] })
|
|
4534
4629
|
}
|
|
4535
4630
|
) : null,
|
|
4536
|
-
showAddVariableMenuOptionForReals && menuHasVariableOptions ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4631
|
+
showAddVariableMenuOptionForReals && menuHasVariableOptions ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_design_system20.MenuItemSeparator, {}) : null,
|
|
4537
4632
|
variablesGroups.map((group) => {
|
|
4538
4633
|
var _a;
|
|
4539
|
-
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) => {
|
|
4540
4635
|
const { name, displayName, helpText } = variable;
|
|
4541
4636
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
4542
|
-
|
|
4637
|
+
import_design_system20.MenuItem,
|
|
4543
4638
|
{
|
|
4544
4639
|
id: name,
|
|
4545
4640
|
css: menuItemTextGroup,
|
|
@@ -4553,9 +4648,9 @@ function SelectVariableMenu({
|
|
|
4553
4648
|
);
|
|
4554
4649
|
}) }, group.name);
|
|
4555
4650
|
}),
|
|
4556
|
-
menuHasVariableOptions && onResetVariables ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4557
|
-
onResetVariables ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4558
|
-
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,
|
|
4559
4654
|
tip ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("i", { css: variablesTipText, children: tip }) : null
|
|
4560
4655
|
]
|
|
4561
4656
|
}
|
|
@@ -4605,7 +4700,7 @@ function VariableField({
|
|
|
4605
4700
|
VariablesComposerVariableMenu,
|
|
4606
4701
|
{
|
|
4607
4702
|
...selectVariableMenuOptions,
|
|
4608
|
-
buttonCss: [
|
|
4703
|
+
buttonCss: [variableBindButton2, selectVariableMenuOptions == null ? void 0 : selectVariableMenuOptions.buttonCss],
|
|
4609
4704
|
buttonProps: isActive ? { "aria-pressed": "true" } : void 0
|
|
4610
4705
|
}
|
|
4611
4706
|
) : null;
|
|
@@ -4623,14 +4718,14 @@ var import_LexicalAutoFocusPlugin = require("@lexical/react/LexicalAutoFocusPlug
|
|
|
4623
4718
|
var import_LexicalClearEditorPlugin = require("@lexical/react/LexicalClearEditorPlugin");
|
|
4624
4719
|
var import_LexicalComposer = require("@lexical/react/LexicalComposer");
|
|
4625
4720
|
var import_LexicalOnChangePlugin = require("@lexical/react/LexicalOnChangePlugin");
|
|
4626
|
-
var
|
|
4721
|
+
var import_react49 = require("react");
|
|
4627
4722
|
|
|
4628
4723
|
// src/components/Variables/composer/DisablePlugin.tsx
|
|
4629
4724
|
var import_LexicalComposerContext7 = require("@lexical/react/LexicalComposerContext");
|
|
4630
|
-
var
|
|
4725
|
+
var import_react47 = require("react");
|
|
4631
4726
|
function DisablePlugin({ disabled }) {
|
|
4632
4727
|
const [editor] = (0, import_LexicalComposerContext7.useLexicalComposerContext)();
|
|
4633
|
-
(0,
|
|
4728
|
+
(0, import_react47.useEffect)(() => {
|
|
4634
4729
|
editor.setEditable(!disabled);
|
|
4635
4730
|
}, [editor, disabled]);
|
|
4636
4731
|
return null;
|
|
@@ -4639,10 +4734,10 @@ function DisablePlugin({ disabled }) {
|
|
|
4639
4734
|
// src/components/Variables/composer/SingleLineTextPlugin.tsx
|
|
4640
4735
|
var import_LexicalComposerContext8 = require("@lexical/react/LexicalComposerContext");
|
|
4641
4736
|
var import_lexical7 = require("lexical");
|
|
4642
|
-
var
|
|
4737
|
+
var import_react48 = require("react");
|
|
4643
4738
|
function SingleLineTextPlugin() {
|
|
4644
4739
|
const [editor] = (0, import_LexicalComposerContext8.useLexicalComposerContext)();
|
|
4645
|
-
(0,
|
|
4740
|
+
(0, import_react48.useEffect)(() => {
|
|
4646
4741
|
editor.registerNodeTransform(import_lexical7.LineBreakNode, (node) => {
|
|
4647
4742
|
node.remove();
|
|
4648
4743
|
});
|
|
@@ -4695,8 +4790,8 @@ function VariablesComposer(props) {
|
|
|
4695
4790
|
autoFocus,
|
|
4696
4791
|
...variablesPluginProps
|
|
4697
4792
|
} = props;
|
|
4698
|
-
const [lastEmittedValue, setLastEmittedValue] = (0,
|
|
4699
|
-
const editorConfig = (0,
|
|
4793
|
+
const [lastEmittedValue, setLastEmittedValue] = (0, import_react49.useState)(value);
|
|
4794
|
+
const editorConfig = (0, import_react49.useMemo)(
|
|
4700
4795
|
() => ({
|
|
4701
4796
|
namespace: "uniform",
|
|
4702
4797
|
onError(error) {
|
|
@@ -4708,8 +4803,8 @@ function VariablesComposer(props) {
|
|
|
4708
4803
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4709
4804
|
[]
|
|
4710
4805
|
);
|
|
4711
|
-
const editorState = (0,
|
|
4712
|
-
const updateTimeout = (0,
|
|
4806
|
+
const editorState = (0, import_react49.useRef)();
|
|
4807
|
+
const updateTimeout = (0, import_react49.useRef)();
|
|
4713
4808
|
if (typeof document === "undefined")
|
|
4714
4809
|
return null;
|
|
4715
4810
|
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_LexicalComposer.LexicalComposer, { initialConfig: editorConfig, children: [
|
|
@@ -4752,10 +4847,10 @@ var import_LexicalHistoryPlugin = require("@lexical/react/LexicalHistoryPlugin")
|
|
|
4752
4847
|
var import_LexicalPlainTextPlugin = require("@lexical/react/LexicalPlainTextPlugin");
|
|
4753
4848
|
var import_utils4 = require("@lexical/utils");
|
|
4754
4849
|
var import_lexical9 = require("lexical");
|
|
4755
|
-
var
|
|
4850
|
+
var import_react50 = require("react");
|
|
4756
4851
|
var import_jsx_runtime39 = require("@emotion/react/jsx-runtime");
|
|
4757
4852
|
function VariablesComposerInput({
|
|
4758
|
-
css:
|
|
4853
|
+
css: css38,
|
|
4759
4854
|
placeholder,
|
|
4760
4855
|
...contentEditableProps
|
|
4761
4856
|
}) {
|
|
@@ -4774,7 +4869,7 @@ function VariablesComposerInput({
|
|
|
4774
4869
|
}
|
|
4775
4870
|
function RichishCopyAndPastePlugin() {
|
|
4776
4871
|
const [editor] = (0, import_LexicalComposerContext9.useLexicalComposerContext)();
|
|
4777
|
-
(0,
|
|
4872
|
+
(0, import_react50.useEffect)(() => {
|
|
4778
4873
|
return (0, import_utils4.mergeRegister)(
|
|
4779
4874
|
editor.registerCommand(
|
|
4780
4875
|
import_lexical9.COPY_COMMAND,
|
|
@@ -4858,6 +4953,7 @@ function InputVariables(props) {
|
|
|
4858
4953
|
value,
|
|
4859
4954
|
enableEditingVariables,
|
|
4860
4955
|
disableInlineMenu,
|
|
4956
|
+
showMenuPosition,
|
|
4861
4957
|
onChange,
|
|
4862
4958
|
transformPaste,
|
|
4863
4959
|
showAddVariableMenuOption,
|
|
@@ -4877,7 +4973,7 @@ function InputVariables(props) {
|
|
|
4877
4973
|
styleVariant = "default",
|
|
4878
4974
|
renderMenuInPortal
|
|
4879
4975
|
} = props;
|
|
4880
|
-
const [finalId] = (0,
|
|
4976
|
+
const [finalId] = (0, import_react52.useState)(id != null ? id : () => (0, import_uuid2.v4)());
|
|
4881
4977
|
const { dispatch, canDispatch, isEditing } = useVariables(true);
|
|
4882
4978
|
const { disableVariablesForReals, hadVariablesInValue, sharedMenuProps } = useInputVariablesState(props);
|
|
4883
4979
|
const useInputWithNoVariables = Boolean(inputWhenNoVariables && !hadVariablesInValue);
|
|
@@ -4891,40 +4987,64 @@ function InputVariables(props) {
|
|
|
4891
4987
|
},
|
|
4892
4988
|
css: disabled ? inputDisabled : "",
|
|
4893
4989
|
children: [
|
|
4894
|
-
|
|
4895
|
-
|
|
4990
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
4991
|
+
import_design_system21.HorizontalRhythm,
|
|
4896
4992
|
{
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
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
|
+
]
|
|
4922
5042
|
}
|
|
4923
5043
|
),
|
|
4924
|
-
caption ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
4925
|
-
errorMessage ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
4926
|
-
warningMessage ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
4927
|
-
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
|
|
4928
5048
|
]
|
|
4929
5049
|
}
|
|
4930
5050
|
);
|
|
@@ -4940,7 +5060,7 @@ function InputVariables(props) {
|
|
|
4940
5060
|
},
|
|
4941
5061
|
id: finalId,
|
|
4942
5062
|
isActive: hadVariablesInValue,
|
|
4943
|
-
disableVariables: disableVariablesForReals || disableInlineMenu === "by-label",
|
|
5063
|
+
disableVariables: disableVariablesForReals || showMenuPosition && showMenuPosition !== "label" || disableInlineMenu === "by-label",
|
|
4944
5064
|
children: input3
|
|
4945
5065
|
}
|
|
4946
5066
|
);
|
|
@@ -4996,102 +5116,7 @@ function InputVariablesOverlayMenu({
|
|
|
4996
5116
|
var import_CgUsbC2 = require("@react-icons/all-files/cg/CgUsbC");
|
|
4997
5117
|
var import_canvas7 = require("@uniformdev/canvas");
|
|
4998
5118
|
var import_design_system22 = require("@uniformdev/design-system");
|
|
4999
|
-
var
|
|
5000
|
-
|
|
5001
|
-
// src/components/Variables/styles/ParameterVariables.styles.ts
|
|
5002
|
-
var import_react51 = require("@emotion/react");
|
|
5003
|
-
var import_design_system21 = require("@uniformdev/design-system");
|
|
5004
|
-
var variableBindButton2 = import_react51.css`
|
|
5005
|
-
align-items: center;
|
|
5006
|
-
border: none;
|
|
5007
|
-
border-radius: var(--rounded-base);
|
|
5008
|
-
background: none;
|
|
5009
|
-
display: flex;
|
|
5010
|
-
height: 1.2rem;
|
|
5011
|
-
padding: var(--spacing-2xs);
|
|
5012
|
-
transition: background var(--duration-fast) var(--timing-ease-out),
|
|
5013
|
-
color var(--duration-fast) var(--timing-ease-out);
|
|
5014
|
-
width: 1.2rem;
|
|
5015
|
-
|
|
5016
|
-
&:hover,
|
|
5017
|
-
&[aria-pressed='true']:not(:disabled) {
|
|
5018
|
-
background: var(--brand-secondary-3);
|
|
5019
|
-
color: var(--white);
|
|
5020
|
-
}
|
|
5021
|
-
|
|
5022
|
-
&[aria-disabled='true'] {
|
|
5023
|
-
background: none;
|
|
5024
|
-
color: currentColor;
|
|
5025
|
-
}
|
|
5026
|
-
|
|
5027
|
-
// fixes menu resizing issue within iframes
|
|
5028
|
-
// see https://linear.app/uniform/issue/UNI-3068/mesh-integration-resizing-with-menus
|
|
5029
|
-
+ [role='menu'] {
|
|
5030
|
-
max-height: unset;
|
|
5031
|
-
}
|
|
5032
|
-
`;
|
|
5033
|
-
var input2 = import_react51.css`
|
|
5034
|
-
display: block;
|
|
5035
|
-
appearance: none;
|
|
5036
|
-
box-sizing: border-box;
|
|
5037
|
-
background: var(--white);
|
|
5038
|
-
border: 1px solid var(--gray-200);
|
|
5039
|
-
border-radius: var(--rounded-sm);
|
|
5040
|
-
color: var(--gray-700);
|
|
5041
|
-
font-size: var(--fs-sm);
|
|
5042
|
-
line-height: 1.5;
|
|
5043
|
-
min-height: 2rem;
|
|
5044
|
-
padding: var(--spacing-sm);
|
|
5045
|
-
width: 100%;
|
|
5046
|
-
position: relative;
|
|
5047
|
-
white-space: normal;
|
|
5048
|
-
transition-property: background, border-color, color, box-shadow, border-radius;
|
|
5049
|
-
transition-duration: var(--duration-fast);
|
|
5050
|
-
transition-timing-function: var(--timing-ease-out);
|
|
5051
|
-
|
|
5052
|
-
&::placeholder {
|
|
5053
|
-
color: var(--gray-400);
|
|
5054
|
-
}
|
|
5055
|
-
|
|
5056
|
-
&:focus,
|
|
5057
|
-
&:focus-within {
|
|
5058
|
-
border-radius: var(--rounded-sm);
|
|
5059
|
-
box-shadow: var(--elevation-100);
|
|
5060
|
-
border: 1px solid var(--accent-dark-active);
|
|
5061
|
-
outline: none;
|
|
5062
|
-
}
|
|
5063
|
-
&:hover {
|
|
5064
|
-
border: 1px solid var(--accent-dark-hover);
|
|
5065
|
-
}
|
|
5066
|
-
|
|
5067
|
-
&:disabled,
|
|
5068
|
-
&:disabled::placeholder,
|
|
5069
|
-
&:disabled:hover {
|
|
5070
|
-
border-radius: var(--rounded-sm);
|
|
5071
|
-
cursor: not-allowed;
|
|
5072
|
-
color: var(--gray-400);
|
|
5073
|
-
}
|
|
5074
|
-
|
|
5075
|
-
&[readonly],
|
|
5076
|
-
&[contenteditable='false'] {
|
|
5077
|
-
cursor: not-allowed;
|
|
5078
|
-
color: var(--gray-400);
|
|
5079
|
-
}
|
|
5080
|
-
|
|
5081
|
-
> p {
|
|
5082
|
-
margin: 0;
|
|
5083
|
-
}
|
|
5084
|
-
`;
|
|
5085
|
-
var inputMultiLine = (lines) => import_react51.css`
|
|
5086
|
-
${import_design_system21.scrollbarStyles}
|
|
5087
|
-
// 1.5 = line height, spacing-sm = top and bottom padding + spacing-xs to give a slight increase in height
|
|
5088
|
-
// as the text looked to close to the bottom of the input
|
|
5089
|
-
height: calc(${lines * 1.5}em + var(--spacing-sm) + var(--spacing-xs));
|
|
5090
|
-
resize: vertical;
|
|
5091
|
-
overflow: auto;
|
|
5092
|
-
`;
|
|
5093
|
-
|
|
5094
|
-
// src/components/Variables/ParameterConnectionIndicator.tsx
|
|
5119
|
+
var import_react53 = require("react");
|
|
5095
5120
|
var import_jsx_runtime41 = require("@emotion/react/jsx-runtime");
|
|
5096
5121
|
function ParameterConnectionIndicator({
|
|
5097
5122
|
children,
|
|
@@ -5100,7 +5125,7 @@ function ParameterConnectionIndicator({
|
|
|
5100
5125
|
disabled,
|
|
5101
5126
|
menuTooltip = "Insert variable"
|
|
5102
5127
|
}) {
|
|
5103
|
-
const hasVariablesInValue = (0,
|
|
5128
|
+
const hasVariablesInValue = (0, import_react53.useMemo)(() => {
|
|
5104
5129
|
let result = false;
|
|
5105
5130
|
(0, import_canvas7.bindVariablesToObject)({
|
|
5106
5131
|
value,
|
|
@@ -5123,7 +5148,7 @@ function ParameterConnectionIndicator({
|
|
|
5123
5148
|
{
|
|
5124
5149
|
title: menuTooltip,
|
|
5125
5150
|
"aria-pressed": hasVariablesInValue,
|
|
5126
|
-
css: [menuBtn,
|
|
5151
|
+
css: [menuBtn, variableBindButton],
|
|
5127
5152
|
type: "button",
|
|
5128
5153
|
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_CgUsbC2.CgUsbC, { size: "1.4rem" })
|
|
5129
5154
|
}
|
|
@@ -5137,21 +5162,21 @@ function ParameterConnectionIndicator({
|
|
|
5137
5162
|
|
|
5138
5163
|
// src/components/Variables/ParameterOrSingleVariable.tsx
|
|
5139
5164
|
var import_design_system23 = require("@uniformdev/design-system");
|
|
5140
|
-
var
|
|
5165
|
+
var import_react55 = require("react");
|
|
5141
5166
|
|
|
5142
5167
|
// src/components/Variables/composer/OnDisconnectPlugin.tsx
|
|
5143
5168
|
var import_LexicalComposerContext10 = require("@lexical/react/LexicalComposerContext");
|
|
5144
5169
|
var import_utils5 = require("@lexical/utils");
|
|
5145
5170
|
var import_lexical10 = require("lexical");
|
|
5146
|
-
var
|
|
5171
|
+
var import_react54 = require("react");
|
|
5147
5172
|
function OnDisconnectPlugin({
|
|
5148
5173
|
onDisconnect
|
|
5149
5174
|
}) {
|
|
5150
5175
|
const [editor] = (0, import_LexicalComposerContext10.useLexicalComposerContext)();
|
|
5151
5176
|
const { variables } = useVariables(true);
|
|
5152
|
-
const variablesRef = (0,
|
|
5177
|
+
const variablesRef = (0, import_react54.useRef)(variables);
|
|
5153
5178
|
variablesRef.current = variables;
|
|
5154
|
-
(0,
|
|
5179
|
+
(0, import_react54.useEffect)(() => {
|
|
5155
5180
|
return (0, import_utils5.mergeRegister)(
|
|
5156
5181
|
editor.registerCommand(
|
|
5157
5182
|
DISCONNECT_VARIABLE_COMMAND,
|
|
@@ -5196,7 +5221,7 @@ function ParameterOrSingleVariable(props) {
|
|
|
5196
5221
|
hasVariablesInValue,
|
|
5197
5222
|
setHadVariablesInValue
|
|
5198
5223
|
} = useInputVariablesState(props);
|
|
5199
|
-
const handleDisconnect = (0,
|
|
5224
|
+
const handleDisconnect = (0, import_react55.useCallback)(
|
|
5200
5225
|
(variable) => {
|
|
5201
5226
|
setHadVariablesInValue(false);
|
|
5202
5227
|
if (onDisconnect) {
|
|
@@ -5235,7 +5260,7 @@ function ParameterOrSingleVariable(props) {
|
|
|
5235
5260
|
VariablesComposerVariableMenu,
|
|
5236
5261
|
{
|
|
5237
5262
|
...sharedMenuProps,
|
|
5238
|
-
buttonCss: [
|
|
5263
|
+
buttonCss: [variableBindButton],
|
|
5239
5264
|
buttonProps: hasVariablesInValue ? { "aria-pressed": "true" } : void 0,
|
|
5240
5265
|
replaceValueOnVariableInsert: true,
|
|
5241
5266
|
filterVariable
|
|
@@ -5249,7 +5274,7 @@ function ParameterOrSingleVariable(props) {
|
|
|
5249
5274
|
}
|
|
5250
5275
|
|
|
5251
5276
|
// src/components/Variables/ParameterVariables.tsx
|
|
5252
|
-
var
|
|
5277
|
+
var import_react56 = require("@emotion/react");
|
|
5253
5278
|
var import_design_system24 = require("@uniformdev/design-system");
|
|
5254
5279
|
var import_jsx_runtime43 = require("@emotion/react/jsx-runtime");
|
|
5255
5280
|
function ParameterVariables(props) {
|
|
@@ -5308,8 +5333,8 @@ function ParameterVariables(props) {
|
|
|
5308
5333
|
"data-text-value": value,
|
|
5309
5334
|
css: [
|
|
5310
5335
|
input2,
|
|
5311
|
-
typeof multiLine === "number" ? inputMultiLine(multiLine) : multiLine === true ? inputMultiLine(2) :
|
|
5312
|
-
inputCss != null ? inputCss :
|
|
5336
|
+
typeof multiLine === "number" ? inputMultiLine(multiLine) : multiLine === true ? inputMultiLine(2) : import_react56.css``,
|
|
5337
|
+
inputCss != null ? inputCss : import_react56.css``
|
|
5313
5338
|
]
|
|
5314
5339
|
}
|
|
5315
5340
|
) }),
|
|
@@ -5317,7 +5342,7 @@ function ParameterVariables(props) {
|
|
|
5317
5342
|
VariablesComposerVariableMenu,
|
|
5318
5343
|
{
|
|
5319
5344
|
...sharedMenuProps,
|
|
5320
|
-
buttonCss: [
|
|
5345
|
+
buttonCss: [variableBindButton],
|
|
5321
5346
|
tip: useInputWhenNoVariables ? void 0 : "Tip: access this list by typing $$",
|
|
5322
5347
|
buttonProps: hasVariablesInValue ? { "aria-pressed": "true" } : void 0,
|
|
5323
5348
|
replaceValueOnVariableInsert: useInputWhenNoVariables
|
|
@@ -5345,13 +5370,13 @@ ${prettifyBindExpression(bindExpression)}`
|
|
|
5345
5370
|
}
|
|
5346
5371
|
|
|
5347
5372
|
// src/components/Variables/VariablesList.tsx
|
|
5348
|
-
var
|
|
5373
|
+
var import_react58 = require("@emotion/react");
|
|
5349
5374
|
var import_design_system25 = require("@uniformdev/design-system");
|
|
5350
5375
|
var import_react_beautiful_dnd3 = require("react-beautiful-dnd");
|
|
5351
5376
|
|
|
5352
5377
|
// src/components/Variables/styles/VariablesList.styles.ts
|
|
5353
|
-
var
|
|
5354
|
-
var tableRow = (isDragging) =>
|
|
5378
|
+
var import_react57 = require("@emotion/react");
|
|
5379
|
+
var tableRow = (isDragging) => import_react57.css`
|
|
5355
5380
|
position: relative;
|
|
5356
5381
|
${isDragging ? `
|
|
5357
5382
|
display: table;
|
|
@@ -5359,7 +5384,7 @@ var tableRow = (isDragging) => import_react56.css`
|
|
|
5359
5384
|
top: auto !important;
|
|
5360
5385
|
` : void 0}
|
|
5361
5386
|
`;
|
|
5362
|
-
var tableCellDragIcon =
|
|
5387
|
+
var tableCellDragIcon = import_react57.css`
|
|
5363
5388
|
&::after {
|
|
5364
5389
|
content: '';
|
|
5365
5390
|
display: block;
|
|
@@ -5377,7 +5402,7 @@ var tableCellDragIcon = import_react56.css`
|
|
|
5377
5402
|
opacity: 1;
|
|
5378
5403
|
}
|
|
5379
5404
|
`;
|
|
5380
|
-
var variableName =
|
|
5405
|
+
var variableName = import_react57.css`
|
|
5381
5406
|
border: none;
|
|
5382
5407
|
font-weight: var(--fw-medium);
|
|
5383
5408
|
padding: 0;
|
|
@@ -5387,7 +5412,7 @@ var variableName = import_react56.css`
|
|
|
5387
5412
|
white-space: nowrap;
|
|
5388
5413
|
max-width: 20ch;
|
|
5389
5414
|
`;
|
|
5390
|
-
var variableValue =
|
|
5415
|
+
var variableValue = import_react57.css`
|
|
5391
5416
|
overflow: hidden;
|
|
5392
5417
|
text-overflow: ellipsis;
|
|
5393
5418
|
white-space: nowrap;
|
|
@@ -5464,7 +5489,7 @@ function VariablesList() {
|
|
|
5464
5489
|
title: `delete ${text}`,
|
|
5465
5490
|
css: [
|
|
5466
5491
|
import_design_system25.button,
|
|
5467
|
-
|
|
5492
|
+
import_react58.css`
|
|
5468
5493
|
background: transparent;
|
|
5469
5494
|
`
|
|
5470
5495
|
],
|
|
@@ -5593,9 +5618,9 @@ function TextVariableRenderer({ definition, value, setValue }) {
|
|
|
5593
5618
|
}
|
|
5594
5619
|
|
|
5595
5620
|
// src/components/Request/RequestBody.tsx
|
|
5596
|
-
var
|
|
5621
|
+
var import_react60 = require("@emotion/react");
|
|
5597
5622
|
var import_design_system27 = require("@uniformdev/design-system");
|
|
5598
|
-
var
|
|
5623
|
+
var import_react61 = require("react");
|
|
5599
5624
|
|
|
5600
5625
|
// src/components/Request/RequestProvider.tsx
|
|
5601
5626
|
var React11 = __toESM(require("react"));
|
|
@@ -5679,11 +5704,11 @@ function useRequest() {
|
|
|
5679
5704
|
}
|
|
5680
5705
|
|
|
5681
5706
|
// src/components/Request/styles/Request.styles.ts
|
|
5682
|
-
var
|
|
5683
|
-
var innerContentStyles =
|
|
5707
|
+
var import_react59 = require("@emotion/react");
|
|
5708
|
+
var innerContentStyles = import_react59.css`
|
|
5684
5709
|
background: var(--white);
|
|
5685
5710
|
`;
|
|
5686
|
-
var requestTypeContainer = (bgColor) =>
|
|
5711
|
+
var requestTypeContainer = (bgColor) => import_react59.css`
|
|
5687
5712
|
align-items: start;
|
|
5688
5713
|
background: ${bgColor};
|
|
5689
5714
|
display: grid;
|
|
@@ -5721,11 +5746,11 @@ var LANGUAGE_TO_CONTENT_TYPE = {
|
|
|
5721
5746
|
};
|
|
5722
5747
|
function RequestBody() {
|
|
5723
5748
|
const { request, dispatch } = useRequest();
|
|
5724
|
-
const [language, setLanguage] = (0,
|
|
5749
|
+
const [language, setLanguage] = (0, import_react61.useState)("json");
|
|
5725
5750
|
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
5726
5751
|
"div",
|
|
5727
5752
|
{
|
|
5728
|
-
css:
|
|
5753
|
+
css: import_react60.css`
|
|
5729
5754
|
background: var(--white);
|
|
5730
5755
|
`,
|
|
5731
5756
|
children: [
|
|
@@ -5733,7 +5758,7 @@ function RequestBody() {
|
|
|
5733
5758
|
RequestTypeContainer,
|
|
5734
5759
|
{
|
|
5735
5760
|
bgColor: "var(--gray-100)",
|
|
5736
|
-
css:
|
|
5761
|
+
css: import_react60.css`
|
|
5737
5762
|
padding: var(--spacing-sm) var(--spacing-base);
|
|
5738
5763
|
`,
|
|
5739
5764
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
@@ -6004,8 +6029,8 @@ function RequestParameters({
|
|
|
6004
6029
|
}
|
|
6005
6030
|
|
|
6006
6031
|
// src/components/Request/RequestUrl.tsx
|
|
6007
|
-
var
|
|
6008
|
-
var
|
|
6032
|
+
var import_react62 = require("@emotion/react");
|
|
6033
|
+
var import_react63 = require("react");
|
|
6009
6034
|
|
|
6010
6035
|
// src/components/Request/urlEncodeRequestParameter.ts
|
|
6011
6036
|
function urlEncodeRequestUrl(url, varValues) {
|
|
@@ -6031,7 +6056,7 @@ function RequestUrl() {
|
|
|
6031
6056
|
var _a, _b;
|
|
6032
6057
|
const { variables } = useVariables();
|
|
6033
6058
|
const { request } = useRequest();
|
|
6034
|
-
const mergedParameters = (0,
|
|
6059
|
+
const mergedParameters = (0, import_react63.useMemo)(() => {
|
|
6035
6060
|
var _a2;
|
|
6036
6061
|
if (!((_a2 = request.baseRequest) == null ? void 0 : _a2.parameters)) {
|
|
6037
6062
|
return request.parameters;
|
|
@@ -6041,7 +6066,7 @@ function RequestUrl() {
|
|
|
6041
6066
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
6042
6067
|
"small",
|
|
6043
6068
|
{
|
|
6044
|
-
css:
|
|
6069
|
+
css: import_react62.css`
|
|
6045
6070
|
display: inline-block;
|
|
6046
6071
|
margin-bottom: var(--spacing-xs);
|
|
6047
6072
|
word-break: break-word;
|
|
@@ -6279,12 +6304,12 @@ var import_design_system31 = require("@uniformdev/design-system");
|
|
|
6279
6304
|
|
|
6280
6305
|
// src/hooks/useInitializeUniformMeshSdk.ts
|
|
6281
6306
|
var import_mesh_sdk = require("@uniformdev/mesh-sdk");
|
|
6282
|
-
var
|
|
6307
|
+
var import_react64 = require("react");
|
|
6283
6308
|
var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
|
|
6284
|
-
const [error, setError] = (0,
|
|
6285
|
-
const [sdk, setSdk] = (0,
|
|
6286
|
-
const initializationInProgress = (0,
|
|
6287
|
-
(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)(
|
|
6288
6313
|
() => {
|
|
6289
6314
|
if (typeof window === "undefined" || sdk) {
|
|
6290
6315
|
return;
|
|
@@ -6342,7 +6367,7 @@ var MeshApp = ({
|
|
|
6342
6367
|
};
|
|
6343
6368
|
|
|
6344
6369
|
// src/components/ObjectSearch/DataRefreshButton.tsx
|
|
6345
|
-
var
|
|
6370
|
+
var import_react65 = require("@emotion/react");
|
|
6346
6371
|
var import_design_system32 = require("@uniformdev/design-system");
|
|
6347
6372
|
var import_jsx_runtime58 = require("@emotion/react/jsx-runtime");
|
|
6348
6373
|
var DataRefreshButton = ({
|
|
@@ -6355,7 +6380,7 @@ var DataRefreshButton = ({
|
|
|
6355
6380
|
!isLoading ? null : /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
6356
6381
|
import_design_system32.LoadingIndicator,
|
|
6357
6382
|
{
|
|
6358
|
-
css:
|
|
6383
|
+
css: import_react65.css`
|
|
6359
6384
|
${isLoading ? "opacity: 0.2;" : void 0}
|
|
6360
6385
|
`
|
|
6361
6386
|
}
|
|
@@ -6365,15 +6390,15 @@ var DataRefreshButton = ({
|
|
|
6365
6390
|
};
|
|
6366
6391
|
|
|
6367
6392
|
// src/components/ObjectSearch/ObjectSearchContainer.tsx
|
|
6368
|
-
var
|
|
6393
|
+
var import_react68 = require("@emotion/react");
|
|
6369
6394
|
var import_canvas9 = require("@uniformdev/canvas");
|
|
6370
6395
|
var import_design_system35 = require("@uniformdev/design-system");
|
|
6371
6396
|
|
|
6372
6397
|
// src/components/ObjectSearch/hooks/ObjectSearchContext.tsx
|
|
6373
6398
|
var import_canvas8 = require("@uniformdev/canvas");
|
|
6374
|
-
var
|
|
6399
|
+
var import_react66 = require("react");
|
|
6375
6400
|
var import_jsx_runtime59 = require("@emotion/react/jsx-runtime");
|
|
6376
|
-
var ObjectSearchContext = (0,
|
|
6401
|
+
var ObjectSearchContext = (0, import_react66.createContext)({
|
|
6377
6402
|
onSetQuery: () => {
|
|
6378
6403
|
},
|
|
6379
6404
|
onSelectItem: () => {
|
|
@@ -6394,16 +6419,16 @@ var ObjectSearchProvider = ({
|
|
|
6394
6419
|
children,
|
|
6395
6420
|
defaultQuery
|
|
6396
6421
|
}) => {
|
|
6397
|
-
const [query, setQuery] = (0,
|
|
6422
|
+
const [query, setQuery] = (0, import_react66.useState)({
|
|
6398
6423
|
contentType: "",
|
|
6399
6424
|
keyword: "",
|
|
6400
6425
|
...defaultQuery
|
|
6401
6426
|
});
|
|
6402
6427
|
const { flatVariables } = useVariables(true);
|
|
6403
|
-
const querySearchDeferred = (0,
|
|
6404
|
-
const [selectedItems, setSelectedItems] = (0,
|
|
6405
|
-
const [list, setList] = (0,
|
|
6406
|
-
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)(
|
|
6407
6432
|
(value2) => {
|
|
6408
6433
|
if (Array.isArray(value2.contentType) && value2.contentType.length > 0) {
|
|
6409
6434
|
return setQuery({
|
|
@@ -6415,7 +6440,7 @@ var ObjectSearchProvider = ({
|
|
|
6415
6440
|
},
|
|
6416
6441
|
[setQuery]
|
|
6417
6442
|
);
|
|
6418
|
-
const onSelectItem = (0,
|
|
6443
|
+
const onSelectItem = (0, import_react66.useCallback)(
|
|
6419
6444
|
(selectedResult) => {
|
|
6420
6445
|
if (Array.isArray(selectedResult)) {
|
|
6421
6446
|
setSelectedItems(selectedResult);
|
|
@@ -6429,17 +6454,17 @@ var ObjectSearchProvider = ({
|
|
|
6429
6454
|
},
|
|
6430
6455
|
[setSelectedItems, selectedItems]
|
|
6431
6456
|
);
|
|
6432
|
-
const onRemoveAllSelectedItems = (0,
|
|
6457
|
+
const onRemoveAllSelectedItems = (0, import_react66.useCallback)(() => {
|
|
6433
6458
|
setSelectedItems([]);
|
|
6434
6459
|
}, [setSelectedItems]);
|
|
6435
|
-
const onSetList = (0,
|
|
6460
|
+
const onSetList = (0, import_react66.useCallback)(
|
|
6436
6461
|
(value2) => {
|
|
6437
6462
|
setList(value2);
|
|
6438
6463
|
},
|
|
6439
6464
|
[setList]
|
|
6440
6465
|
);
|
|
6441
|
-
const boundQuery = (0,
|
|
6442
|
-
const value = (0,
|
|
6466
|
+
const boundQuery = (0, import_react66.useMemo)(() => bindQuery(query, flatVariables), [query, flatVariables]);
|
|
6467
|
+
const value = (0, import_react66.useMemo)(
|
|
6443
6468
|
() => ({
|
|
6444
6469
|
boundQuery,
|
|
6445
6470
|
onSetQuery,
|
|
@@ -6466,7 +6491,7 @@ var ObjectSearchProvider = ({
|
|
|
6466
6491
|
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(ObjectSearchContext.Provider, { value, children });
|
|
6467
6492
|
};
|
|
6468
6493
|
function useObjectSearchContext() {
|
|
6469
|
-
return (0,
|
|
6494
|
+
return (0, import_react66.useContext)(ObjectSearchContext);
|
|
6470
6495
|
}
|
|
6471
6496
|
function bindQuery(query, inputs) {
|
|
6472
6497
|
const { result, errors } = (0, import_canvas8.bindVariablesToObject)({
|
|
@@ -6484,9 +6509,9 @@ function bindQuery(query, inputs) {
|
|
|
6484
6509
|
var import_design_system34 = require("@uniformdev/design-system");
|
|
6485
6510
|
|
|
6486
6511
|
// src/components/ObjectSearch/styles/ObjectSearchListItem.styles.ts
|
|
6487
|
-
var
|
|
6512
|
+
var import_react67 = require("@emotion/react");
|
|
6488
6513
|
var import_design_system33 = require("@uniformdev/design-system");
|
|
6489
|
-
var ObjectListItemContainer =
|
|
6514
|
+
var ObjectListItemContainer = import_react67.css`
|
|
6490
6515
|
align-items: center;
|
|
6491
6516
|
border: 1px solid var(--gray-300);
|
|
6492
6517
|
border-radius: var(--rounded-base);
|
|
@@ -6495,11 +6520,11 @@ var ObjectListItemContainer = import_react66.css`
|
|
|
6495
6520
|
grid-template-columns: 1fr auto;
|
|
6496
6521
|
padding: var(--spacing-sm);
|
|
6497
6522
|
`;
|
|
6498
|
-
var ObjectListItemContainerDisabled =
|
|
6523
|
+
var ObjectListItemContainerDisabled = import_react67.css`
|
|
6499
6524
|
opacity: var(--opacity-50);
|
|
6500
6525
|
pointer-events: none;
|
|
6501
6526
|
`;
|
|
6502
|
-
var ObjectListItemLoading =
|
|
6527
|
+
var ObjectListItemLoading = import_react67.css`
|
|
6503
6528
|
animation: ${import_design_system33.skeletonLoading} 1s linear infinite alternate;
|
|
6504
6529
|
border-color: transparent;
|
|
6505
6530
|
min-height: 42px;
|
|
@@ -6523,36 +6548,36 @@ var ObjectListItemLoading = import_react66.css`
|
|
|
6523
6548
|
width: 1rem;
|
|
6524
6549
|
}
|
|
6525
6550
|
`;
|
|
6526
|
-
var ObjectListItemHeadingGroup =
|
|
6551
|
+
var ObjectListItemHeadingGroup = import_react67.css`
|
|
6527
6552
|
align-items: center;
|
|
6528
6553
|
display: grid;
|
|
6529
6554
|
`;
|
|
6530
|
-
var ObjectListItemThumbnail =
|
|
6555
|
+
var ObjectListItemThumbnail = import_react67.css`
|
|
6531
6556
|
width: 30px;
|
|
6532
6557
|
object-fit: contain;
|
|
6533
6558
|
`;
|
|
6534
|
-
var ObjectListItemTitle =
|
|
6559
|
+
var ObjectListItemTitle = import_react67.css`
|
|
6535
6560
|
color: var(--typography-base);
|
|
6536
6561
|
display: block;
|
|
6537
6562
|
font-size: var(--fs-sm);
|
|
6538
6563
|
`;
|
|
6539
|
-
var ObjectListItemSubtitle =
|
|
6564
|
+
var ObjectListItemSubtitle = import_react67.css`
|
|
6540
6565
|
color: var(--gray-500);
|
|
6541
6566
|
display: block;
|
|
6542
6567
|
font-size: var(--fs-xs);
|
|
6543
6568
|
line-height: 1;
|
|
6544
6569
|
`;
|
|
6545
|
-
var ObjectListItemInfoContainer =
|
|
6570
|
+
var ObjectListItemInfoContainer = import_react67.css`
|
|
6546
6571
|
align-items: center;
|
|
6547
6572
|
display: flex;
|
|
6548
6573
|
gap: var(--spacing-sm);
|
|
6549
6574
|
justify-content: center;
|
|
6550
6575
|
`;
|
|
6551
|
-
var ObjectListItemControlledContent =
|
|
6576
|
+
var ObjectListItemControlledContent = import_react67.css`
|
|
6552
6577
|
display: flex;
|
|
6553
6578
|
gap: var(--spacing-sm);
|
|
6554
6579
|
`;
|
|
6555
|
-
var ObjectListItemUnControlledContent =
|
|
6580
|
+
var ObjectListItemUnControlledContent = import_react67.css`
|
|
6556
6581
|
margin-top: var(--spacing-sm);
|
|
6557
6582
|
grid-column: 1 / -1;
|
|
6558
6583
|
`;
|
|
@@ -6639,7 +6664,7 @@ var ObjectSearchContainer = ({
|
|
|
6639
6664
|
import_design_system35.ScrollableList,
|
|
6640
6665
|
{
|
|
6641
6666
|
role: "list",
|
|
6642
|
-
css:
|
|
6667
|
+
css: import_react68.css`
|
|
6643
6668
|
> div {
|
|
6644
6669
|
transition: max-height var(--duration-slow) var(--timing-ease-out);
|
|
6645
6670
|
max-height: ${selectedListItems.length === 0 ? "50vh" : "184px"};
|
|
@@ -6712,11 +6737,11 @@ var DefaultResultList = () => {
|
|
|
6712
6737
|
|
|
6713
6738
|
// src/components/ObjectSearch/ObjectSearchFilter.tsx
|
|
6714
6739
|
var import_design_system36 = require("@uniformdev/design-system");
|
|
6715
|
-
var
|
|
6740
|
+
var import_react70 = require("react");
|
|
6716
6741
|
|
|
6717
6742
|
// src/components/ObjectSearch/styles/ObjectSearchFilterContainer.styles.ts
|
|
6718
|
-
var
|
|
6719
|
-
var ObjectSearchFilterContainerLabel =
|
|
6743
|
+
var import_react69 = require("@emotion/react");
|
|
6744
|
+
var ObjectSearchFilterContainerLabel = import_react69.css`
|
|
6720
6745
|
align-items: center;
|
|
6721
6746
|
display: flex;
|
|
6722
6747
|
font-size: var(--fs-sm);
|
|
@@ -6724,11 +6749,11 @@ var ObjectSearchFilterContainerLabel = import_react68.css`
|
|
|
6724
6749
|
line-height: 1rem;
|
|
6725
6750
|
margin-bottom: var(--spacing-sm);
|
|
6726
6751
|
`;
|
|
6727
|
-
var ObjectSearchFilterContainer =
|
|
6752
|
+
var ObjectSearchFilterContainer = import_react69.css`
|
|
6728
6753
|
display: grid;
|
|
6729
6754
|
gap: var(--spacing-base);
|
|
6730
6755
|
`;
|
|
6731
|
-
var ObjectSearchFilterGrid = (gridColumns) =>
|
|
6756
|
+
var ObjectSearchFilterGrid = (gridColumns) => import_react69.css`
|
|
6732
6757
|
display: grid;
|
|
6733
6758
|
grid-template-columns: ${gridColumns};
|
|
6734
6759
|
gap: var(--spacing-base);
|
|
@@ -6746,7 +6771,7 @@ var ObjectSearchFilter = ({
|
|
|
6746
6771
|
}) => {
|
|
6747
6772
|
var _a, _b;
|
|
6748
6773
|
const { query, onSetQuery } = useObjectSearchContext();
|
|
6749
|
-
const [searchState, setSearchState] = (0,
|
|
6774
|
+
const [searchState, setSearchState] = (0, import_react70.useState)({
|
|
6750
6775
|
contentType: (_a = query.contentType) != null ? _a : "",
|
|
6751
6776
|
keyword: (_b = query.keyword) != null ? _b : ""
|
|
6752
6777
|
});
|
|
@@ -6756,7 +6781,7 @@ var ObjectSearchFilter = ({
|
|
|
6756
6781
|
});
|
|
6757
6782
|
onSetQuery({ ...query, ...value });
|
|
6758
6783
|
};
|
|
6759
|
-
const memoizedSelectOptions = (0,
|
|
6784
|
+
const memoizedSelectOptions = (0, import_react70.useMemo)(() => {
|
|
6760
6785
|
if (!requireContentType && !(selectOptions == null ? void 0 : selectOptions.length)) {
|
|
6761
6786
|
return [];
|
|
6762
6787
|
}
|
|
@@ -6814,9 +6839,9 @@ var import_design_system38 = require("@uniformdev/design-system");
|
|
|
6814
6839
|
var import_timeago3 = require("timeago.js");
|
|
6815
6840
|
|
|
6816
6841
|
// src/components/ObjectSearch/styles/ObjectSearchResultItemButton.styles.ts
|
|
6817
|
-
var
|
|
6842
|
+
var import_react71 = require("@emotion/react");
|
|
6818
6843
|
var import_design_system37 = require("@uniformdev/design-system");
|
|
6819
|
-
var ButtonStyles =
|
|
6844
|
+
var ButtonStyles = import_react71.css`
|
|
6820
6845
|
${import_design_system37.button}
|
|
6821
6846
|
background: transparent;
|
|
6822
6847
|
border: 1px solid var(--typography-base);
|
|
@@ -6843,7 +6868,7 @@ var ButtonStyles = import_react70.css`
|
|
|
6843
6868
|
text-decoration: none;
|
|
6844
6869
|
}
|
|
6845
6870
|
`;
|
|
6846
|
-
var ButtonIcon =
|
|
6871
|
+
var ButtonIcon = import_react71.css`
|
|
6847
6872
|
width: 1rem;
|
|
6848
6873
|
height: 1rem;
|
|
6849
6874
|
`;
|
|
@@ -6872,8 +6897,8 @@ var LinkButton = ({
|
|
|
6872
6897
|
};
|
|
6873
6898
|
|
|
6874
6899
|
// src/components/ObjectSearch/styles/ObjectSearchResultItem.styles.ts
|
|
6875
|
-
var
|
|
6876
|
-
var ObjectSearchResultItemContainer =
|
|
6900
|
+
var import_react72 = require("@emotion/react");
|
|
6901
|
+
var ObjectSearchResultItemContainer = import_react72.css`
|
|
6877
6902
|
align-items: center;
|
|
6878
6903
|
border: 1px solid var(--gray-300);
|
|
6879
6904
|
border-radius: var(--rounded-base);
|
|
@@ -6889,7 +6914,7 @@ var ObjectSearchResultItemContainer = import_react71.css`
|
|
|
6889
6914
|
}
|
|
6890
6915
|
}
|
|
6891
6916
|
`;
|
|
6892
|
-
var ObjectSearchDragHandle =
|
|
6917
|
+
var ObjectSearchDragHandle = import_react72.css`
|
|
6893
6918
|
border-left: 2px dotted var(--gray-300);
|
|
6894
6919
|
border-right: 2px dotted var(--gray-300);
|
|
6895
6920
|
position: absolute;
|
|
@@ -6898,35 +6923,35 @@ var ObjectSearchDragHandle = import_react71.css`
|
|
|
6898
6923
|
transition: opacity var(--duration-fast) var(--timing-ease-out);
|
|
6899
6924
|
opacity: 0;
|
|
6900
6925
|
`;
|
|
6901
|
-
var ObjectSearchResultItemSubtitle =
|
|
6926
|
+
var ObjectSearchResultItemSubtitle = import_react72.css`
|
|
6902
6927
|
color: var(--gray-500);
|
|
6903
6928
|
display: block;
|
|
6904
6929
|
font-size: var(--fs-xs);
|
|
6905
6930
|
line-height: 1;
|
|
6906
6931
|
`;
|
|
6907
|
-
var ObjectSearchResultItemTitle =
|
|
6932
|
+
var ObjectSearchResultItemTitle = import_react72.css`
|
|
6908
6933
|
align-items: center;
|
|
6909
6934
|
color: var(--typography-base);
|
|
6910
6935
|
display: flex;
|
|
6911
6936
|
gap: var(--spacing-xs);
|
|
6912
6937
|
`;
|
|
6913
|
-
var ObjectSearchResultItemTimeStamp =
|
|
6938
|
+
var ObjectSearchResultItemTimeStamp = import_react72.css`
|
|
6914
6939
|
color: var(--gray-500);
|
|
6915
6940
|
font-size: var(--fs-xs);
|
|
6916
6941
|
`;
|
|
6917
|
-
var ObjectSearchAuthorStateGroup =
|
|
6942
|
+
var ObjectSearchAuthorStateGroup = import_react72.css`
|
|
6918
6943
|
align-items: center;
|
|
6919
6944
|
display: flex;
|
|
6920
6945
|
gap: var(--spacing-sm);
|
|
6921
6946
|
`;
|
|
6922
|
-
var ObjectSearchUpdateGroup =
|
|
6947
|
+
var ObjectSearchUpdateGroup = import_react72.css`
|
|
6923
6948
|
display: grid;
|
|
6924
6949
|
`;
|
|
6925
|
-
var ObjectSearchContentContainer =
|
|
6950
|
+
var ObjectSearchContentContainer = import_react72.css`
|
|
6926
6951
|
display: flex;
|
|
6927
6952
|
gap: var(--spacing-base);
|
|
6928
6953
|
`;
|
|
6929
|
-
var ObjectSearchImage =
|
|
6954
|
+
var ObjectSearchImage = import_react72.css`
|
|
6930
6955
|
width: 56px;
|
|
6931
6956
|
object-fit: contain;
|
|
6932
6957
|
`;
|
|
@@ -6994,26 +7019,26 @@ var import_design_system39 = require("@uniformdev/design-system");
|
|
|
6994
7019
|
var import_react_beautiful_dnd4 = require("react-beautiful-dnd");
|
|
6995
7020
|
|
|
6996
7021
|
// src/components/ObjectSearch/styles/ObjectSearchResultList.styles.ts
|
|
6997
|
-
var
|
|
6998
|
-
var ObjectSearchResultListContainer =
|
|
7022
|
+
var import_react73 = require("@emotion/react");
|
|
7023
|
+
var ObjectSearchResultListContainer = import_react73.css`
|
|
6999
7024
|
align-items: center;
|
|
7000
7025
|
display: flex;
|
|
7001
7026
|
gap: var(--spacing-sm);
|
|
7002
7027
|
justify-content: space-between;
|
|
7003
7028
|
`;
|
|
7004
|
-
var ObjectSearchDragContainer =
|
|
7029
|
+
var ObjectSearchDragContainer = import_react73.css`
|
|
7005
7030
|
margin: 0 0 var(--spacing-sm);
|
|
7006
7031
|
`;
|
|
7007
|
-
var ObjectSearchContainerDragging =
|
|
7032
|
+
var ObjectSearchContainerDragging = import_react73.css`
|
|
7008
7033
|
box-shadow: var(--shadow-base);
|
|
7009
7034
|
opacity: var(--opacity-50);
|
|
7010
7035
|
`;
|
|
7011
|
-
var ObjectSearchResultListCounterContainer =
|
|
7036
|
+
var ObjectSearchResultListCounterContainer = import_react73.css`
|
|
7012
7037
|
align-items: center;
|
|
7013
7038
|
display: flex;
|
|
7014
7039
|
gap: var(--spacing-sm);
|
|
7015
7040
|
`;
|
|
7016
|
-
var ObjectSearchResultListTitle =
|
|
7041
|
+
var ObjectSearchResultListTitle = import_react73.css`
|
|
7017
7042
|
font-weight: var(--fw-bold);
|
|
7018
7043
|
line-height: 1;
|
|
7019
7044
|
`;
|
|
@@ -7118,7 +7143,7 @@ function ObjectSearchResultList({
|
|
|
7118
7143
|
|
|
7119
7144
|
// src/components/ObjectSearch/QueryFilter.tsx
|
|
7120
7145
|
var import_design_system40 = require("@uniformdev/design-system");
|
|
7121
|
-
var
|
|
7146
|
+
var import_react74 = require("react");
|
|
7122
7147
|
var import_jsx_runtime67 = require("@emotion/react/jsx-runtime");
|
|
7123
7148
|
var QueryFilter = ({
|
|
7124
7149
|
requireContentType,
|
|
@@ -7148,7 +7173,7 @@ var QueryFilter = ({
|
|
|
7148
7173
|
}) => {
|
|
7149
7174
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
7150
7175
|
const { query, onSetQuery } = useObjectSearchContext();
|
|
7151
|
-
const [queryState, setQueryState] = (0,
|
|
7176
|
+
const [queryState, setQueryState] = (0, import_react74.useState)({
|
|
7152
7177
|
contentType: (_a = query.contentType) != null ? _a : "",
|
|
7153
7178
|
keyword: (_b = query.keyword) != null ? _b : "",
|
|
7154
7179
|
count: (_c = query.count) != null ? _c : countValue,
|
|
@@ -7159,7 +7184,7 @@ var QueryFilter = ({
|
|
|
7159
7184
|
setQueryState((prev) => ({ ...prev, ...value }));
|
|
7160
7185
|
onSetQuery({ ...query, ...value });
|
|
7161
7186
|
};
|
|
7162
|
-
(0,
|
|
7187
|
+
(0, import_react74.useEffect)(() => {
|
|
7163
7188
|
onSetQuery(queryState);
|
|
7164
7189
|
}, []);
|
|
7165
7190
|
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("fieldset", { children: [
|
|
@@ -7285,7 +7310,7 @@ var QueryFilter = ({
|
|
|
7285
7310
|
};
|
|
7286
7311
|
|
|
7287
7312
|
// src/components/ParamTypeDynamicDataProvider.tsx
|
|
7288
|
-
var
|
|
7313
|
+
var import_react75 = require("react");
|
|
7289
7314
|
var import_jsx_runtime68 = require("@emotion/react/jsx-runtime");
|
|
7290
7315
|
function ParamTypeDynamicDataProvider(props) {
|
|
7291
7316
|
const { children } = props;
|
|
@@ -7294,7 +7319,7 @@ function ParamTypeDynamicDataProvider(props) {
|
|
|
7294
7319
|
} = useMeshLocation("paramType");
|
|
7295
7320
|
const dynamicInputsAsVariables = useDynamicInputsAsVariables(dynamicInputs);
|
|
7296
7321
|
const connectedDataAsVariables = useConnectedDataAsVariables(connectedData);
|
|
7297
|
-
const variables = (0,
|
|
7322
|
+
const variables = (0, import_react75.useMemo)(
|
|
7298
7323
|
() => ({ ...connectedDataAsVariables, ...dynamicInputsAsVariables }),
|
|
7299
7324
|
[dynamicInputsAsVariables, connectedDataAsVariables]
|
|
7300
7325
|
);
|
|
@@ -7307,9 +7332,9 @@ var JsonMeshVariableEditor = ({
|
|
|
7307
7332
|
variable,
|
|
7308
7333
|
context
|
|
7309
7334
|
}) => {
|
|
7310
|
-
const sillyRef = (0,
|
|
7335
|
+
const sillyRef = (0, import_react75.useRef)(false);
|
|
7311
7336
|
const { editConnectedData } = useMeshLocation("paramType");
|
|
7312
|
-
(0,
|
|
7337
|
+
(0, import_react75.useEffect)(() => {
|
|
7313
7338
|
if (sillyRef.current) {
|
|
7314
7339
|
return;
|
|
7315
7340
|
}
|
|
@@ -7337,6 +7362,57 @@ var JsonMeshVariableEditor = ({
|
|
|
7337
7362
|
return null;
|
|
7338
7363
|
};
|
|
7339
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
|
+
|
|
7340
7416
|
// src/utils/createLocationValidator.ts
|
|
7341
7417
|
function createLocationValidator(setValue, validate) {
|
|
7342
7418
|
return (dispatch) => setValue((previous) => {
|
|
@@ -7347,19 +7423,19 @@ function createLocationValidator(setValue, validate) {
|
|
|
7347
7423
|
|
|
7348
7424
|
// src/utils/useContentDataResourceLocaleInfo.ts
|
|
7349
7425
|
var import_canvas10 = require("@uniformdev/canvas");
|
|
7350
|
-
var
|
|
7426
|
+
var import_react76 = require("react");
|
|
7351
7427
|
function useContentDataResourceLocaleInfo({
|
|
7352
7428
|
locale,
|
|
7353
7429
|
setLocale,
|
|
7354
7430
|
dynamicInputs
|
|
7355
7431
|
}) {
|
|
7356
7432
|
var _a;
|
|
7357
|
-
const setLocaleRef = (0,
|
|
7433
|
+
const setLocaleRef = (0, import_react76.useRef)(setLocale);
|
|
7358
7434
|
setLocaleRef.current = setLocale;
|
|
7359
7435
|
const { flatVariables } = useVariables();
|
|
7360
7436
|
const effectiveLocale = locale != null ? locale : dynamicInputs[import_canvas10.LOCALE_DYNAMIC_INPUT_NAME] ? (0, import_canvas10.createVariableReference)(import_canvas10.LOCALE_DYNAMIC_INPUT_NAME) : "";
|
|
7361
7437
|
const boundLocale = (_a = (0, import_canvas10.bindVariables)({ variables: flatVariables, value: effectiveLocale }).result) != null ? _a : effectiveLocale;
|
|
7362
|
-
(0,
|
|
7438
|
+
(0, import_react76.useEffect)(() => {
|
|
7363
7439
|
if (locale === void 0 && effectiveLocale && setLocaleRef.current) {
|
|
7364
7440
|
setLocaleRef.current((0, import_canvas10.createVariableReference)(import_canvas10.LOCALE_DYNAMIC_INPUT_NAME));
|
|
7365
7441
|
}
|
|
@@ -7368,7 +7444,7 @@ function useContentDataResourceLocaleInfo({
|
|
|
7368
7444
|
}
|
|
7369
7445
|
|
|
7370
7446
|
// src/index.ts
|
|
7371
|
-
var
|
|
7447
|
+
var import_design_system43 = require("@uniformdev/design-system");
|
|
7372
7448
|
__reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
|
|
7373
7449
|
// Annotate the CommonJS export names for ESM import in node:
|
|
7374
7450
|
0 && (module.exports = {
|
|
@@ -7466,6 +7542,7 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
|
|
|
7466
7542
|
VariablesPlugin,
|
|
7467
7543
|
VariablesProvider,
|
|
7468
7544
|
badgeIcon,
|
|
7545
|
+
bindableFiltersMapper,
|
|
7469
7546
|
convertConnectedDataToVariable,
|
|
7470
7547
|
createLocationValidator,
|
|
7471
7548
|
damSelectItemImage,
|