@uniformdev/mesh-sdk-react 19.136.0 → 19.136.1-alpha.4
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 +160 -52
- package/dist/index.d.ts +160 -52
- package/dist/index.esm.js +705 -462
- package/dist/index.js +790 -549
- package/dist/index.mjs +705 -462
- package/package.json +5 -5
package/dist/index.esm.js
CHANGED
|
@@ -2652,6 +2652,9 @@ function DefaultDamItemRenderer({ item }) {
|
|
|
2652
2652
|
] }) : null;
|
|
2653
2653
|
}
|
|
2654
2654
|
|
|
2655
|
+
// src/components/DataResourceDynamicInputProvider.tsx
|
|
2656
|
+
import { createContext as createContext4, useContext as useContext6 } from "react";
|
|
2657
|
+
|
|
2655
2658
|
// src/hooks/useConnectedDataAsVariables.tsx
|
|
2656
2659
|
import { useMemo as useMemo3 } from "react";
|
|
2657
2660
|
function useConnectedDataAsVariables(connectedData) {
|
|
@@ -4055,7 +4058,14 @@ function $isTargetWithinDecorator(target) {
|
|
|
4055
4058
|
}
|
|
4056
4059
|
|
|
4057
4060
|
// src/components/Variables/InputVariables.tsx
|
|
4058
|
-
import {
|
|
4061
|
+
import { css as css24 } from "@emotion/react";
|
|
4062
|
+
import {
|
|
4063
|
+
Caption,
|
|
4064
|
+
ErrorMessage,
|
|
4065
|
+
HorizontalRhythm as HorizontalRhythm4,
|
|
4066
|
+
InfoMessage,
|
|
4067
|
+
WarningMessage
|
|
4068
|
+
} from "@uniformdev/design-system";
|
|
4059
4069
|
import { useState as useState13 } from "react";
|
|
4060
4070
|
import { v4 as v42 } from "uuid";
|
|
4061
4071
|
|
|
@@ -4180,6 +4190,99 @@ var placeholderCompact = css21`
|
|
|
4180
4190
|
inset: var(--spacing-sm) var(--spacing-lg) var(--spacing-sm) var(--spacing-base);
|
|
4181
4191
|
`;
|
|
4182
4192
|
|
|
4193
|
+
// src/components/Variables/styles/ParameterVariables.styles.ts
|
|
4194
|
+
import { css as css22 } from "@emotion/react";
|
|
4195
|
+
import { scrollbarStyles as scrollbarStyles3 } from "@uniformdev/design-system";
|
|
4196
|
+
var variableBindButton = css22`
|
|
4197
|
+
align-items: center;
|
|
4198
|
+
border: none;
|
|
4199
|
+
border-radius: var(--rounded-base);
|
|
4200
|
+
background: none;
|
|
4201
|
+
display: flex;
|
|
4202
|
+
height: 1.2rem;
|
|
4203
|
+
padding: var(--spacing-2xs);
|
|
4204
|
+
transition: background var(--duration-fast) var(--timing-ease-out),
|
|
4205
|
+
color var(--duration-fast) var(--timing-ease-out);
|
|
4206
|
+
width: 1.2rem;
|
|
4207
|
+
|
|
4208
|
+
&:hover,
|
|
4209
|
+
&[aria-pressed='true']:not(:disabled) {
|
|
4210
|
+
background: var(--brand-secondary-3);
|
|
4211
|
+
color: var(--white);
|
|
4212
|
+
}
|
|
4213
|
+
|
|
4214
|
+
&[aria-disabled='true'] {
|
|
4215
|
+
background: none;
|
|
4216
|
+
color: currentColor;
|
|
4217
|
+
}
|
|
4218
|
+
|
|
4219
|
+
// fixes menu resizing issue within iframes
|
|
4220
|
+
// see https://linear.app/uniform/issue/UNI-3068/mesh-integration-resizing-with-menus
|
|
4221
|
+
+ [role='menu'] {
|
|
4222
|
+
max-height: unset;
|
|
4223
|
+
}
|
|
4224
|
+
`;
|
|
4225
|
+
var input2 = css22`
|
|
4226
|
+
display: block;
|
|
4227
|
+
appearance: none;
|
|
4228
|
+
box-sizing: border-box;
|
|
4229
|
+
background: var(--white);
|
|
4230
|
+
border: 1px solid var(--gray-200);
|
|
4231
|
+
border-radius: var(--rounded-sm);
|
|
4232
|
+
color: var(--gray-700);
|
|
4233
|
+
font-size: var(--fs-sm);
|
|
4234
|
+
line-height: 1.5;
|
|
4235
|
+
min-height: 2rem;
|
|
4236
|
+
padding: var(--spacing-sm);
|
|
4237
|
+
width: 100%;
|
|
4238
|
+
position: relative;
|
|
4239
|
+
white-space: normal;
|
|
4240
|
+
transition-property: background, border-color, color, box-shadow, border-radius;
|
|
4241
|
+
transition-duration: var(--duration-fast);
|
|
4242
|
+
transition-timing-function: var(--timing-ease-out);
|
|
4243
|
+
|
|
4244
|
+
&::placeholder {
|
|
4245
|
+
color: var(--gray-400);
|
|
4246
|
+
}
|
|
4247
|
+
|
|
4248
|
+
&:focus,
|
|
4249
|
+
&:focus-within {
|
|
4250
|
+
border-radius: var(--rounded-sm);
|
|
4251
|
+
box-shadow: var(--elevation-100);
|
|
4252
|
+
border: 1px solid var(--accent-dark-active);
|
|
4253
|
+
outline: none;
|
|
4254
|
+
}
|
|
4255
|
+
&:hover {
|
|
4256
|
+
border: 1px solid var(--accent-dark-hover);
|
|
4257
|
+
}
|
|
4258
|
+
|
|
4259
|
+
&:disabled,
|
|
4260
|
+
&:disabled::placeholder,
|
|
4261
|
+
&:disabled:hover {
|
|
4262
|
+
border-radius: var(--rounded-sm);
|
|
4263
|
+
cursor: not-allowed;
|
|
4264
|
+
color: var(--gray-400);
|
|
4265
|
+
}
|
|
4266
|
+
|
|
4267
|
+
&[readonly],
|
|
4268
|
+
&[contenteditable='false'] {
|
|
4269
|
+
cursor: not-allowed;
|
|
4270
|
+
color: var(--gray-400);
|
|
4271
|
+
}
|
|
4272
|
+
|
|
4273
|
+
> p {
|
|
4274
|
+
margin: 0;
|
|
4275
|
+
}
|
|
4276
|
+
`;
|
|
4277
|
+
var inputMultiLine = (lines) => css22`
|
|
4278
|
+
${scrollbarStyles3}
|
|
4279
|
+
// 1.5 = line height, spacing-sm = top and bottom padding + spacing-xs to give a slight increase in height
|
|
4280
|
+
// as the text looked to close to the bottom of the input
|
|
4281
|
+
height: calc(${lines * 1.5}em + var(--spacing-sm) + var(--spacing-xs));
|
|
4282
|
+
resize: vertical;
|
|
4283
|
+
overflow: auto;
|
|
4284
|
+
`;
|
|
4285
|
+
|
|
4183
4286
|
// src/components/Variables/toolbox/InputVariablesProvider.tsx
|
|
4184
4287
|
import * as React10 from "react";
|
|
4185
4288
|
import { useMemo as useMemo9 } from "react";
|
|
@@ -4258,15 +4361,15 @@ function useInputVariablesState({
|
|
|
4258
4361
|
}
|
|
4259
4362
|
|
|
4260
4363
|
// src/components/Variables/toolbox/VariableField.styles.ts
|
|
4261
|
-
import { css as
|
|
4262
|
-
var labelText =
|
|
4364
|
+
import { css as css23 } from "@emotion/react";
|
|
4365
|
+
var labelText = css23`
|
|
4263
4366
|
align-items: center;
|
|
4264
4367
|
display: flex;
|
|
4265
4368
|
gap: var(--spacing-xs);
|
|
4266
4369
|
font-weight: var(--fw-regular);
|
|
4267
4370
|
margin: 0 0 var(--spacing-xs);
|
|
4268
4371
|
`;
|
|
4269
|
-
var
|
|
4372
|
+
var variableBindButton2 = css23`
|
|
4270
4373
|
align-items: center;
|
|
4271
4374
|
border: none;
|
|
4272
4375
|
border-radius: var(--rounded-base);
|
|
@@ -4429,7 +4532,7 @@ function VariableField({
|
|
|
4429
4532
|
VariablesComposerVariableMenu,
|
|
4430
4533
|
{
|
|
4431
4534
|
...selectVariableMenuOptions,
|
|
4432
|
-
buttonCss: [
|
|
4535
|
+
buttonCss: [variableBindButton2, selectVariableMenuOptions == null ? void 0 : selectVariableMenuOptions.buttonCss],
|
|
4433
4536
|
buttonProps: isActive ? { "aria-pressed": "true" } : void 0
|
|
4434
4537
|
}
|
|
4435
4538
|
) : null;
|
|
@@ -4591,7 +4694,7 @@ import {
|
|
|
4591
4694
|
import { useEffect as useEffect13 } from "react";
|
|
4592
4695
|
import { Fragment as Fragment9, jsx as jsx39, jsxs as jsxs22 } from "@emotion/react/jsx-runtime";
|
|
4593
4696
|
function VariablesComposerInput({
|
|
4594
|
-
css:
|
|
4697
|
+
css: css38,
|
|
4595
4698
|
placeholder,
|
|
4596
4699
|
...contentEditableProps
|
|
4597
4700
|
}) {
|
|
@@ -4694,6 +4797,7 @@ function InputVariables(props) {
|
|
|
4694
4797
|
value,
|
|
4695
4798
|
enableEditingVariables,
|
|
4696
4799
|
disableInlineMenu,
|
|
4800
|
+
showMenuPosition,
|
|
4697
4801
|
onChange,
|
|
4698
4802
|
transformPaste,
|
|
4699
4803
|
showAddVariableMenuOption,
|
|
@@ -4727,34 +4831,58 @@ function InputVariables(props) {
|
|
|
4727
4831
|
},
|
|
4728
4832
|
css: disabled ? inputDisabled : "",
|
|
4729
4833
|
children: [
|
|
4730
|
-
|
|
4731
|
-
|
|
4834
|
+
/* @__PURE__ */ jsxs23(
|
|
4835
|
+
HorizontalRhythm4,
|
|
4732
4836
|
{
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
|
-
|
|
4757
|
-
|
|
4837
|
+
align: "center",
|
|
4838
|
+
gap: "xs",
|
|
4839
|
+
css: css24`
|
|
4840
|
+
& > div:first-child {
|
|
4841
|
+
flex-grow: 1;
|
|
4842
|
+
}
|
|
4843
|
+
`,
|
|
4844
|
+
children: [
|
|
4845
|
+
useInputWithNoVariables ? inputWhenNoVariables : /* @__PURE__ */ jsx40(
|
|
4846
|
+
InputVariablesOverlayMenu,
|
|
4847
|
+
{
|
|
4848
|
+
...sharedMenuProps,
|
|
4849
|
+
disabled: disableVariablesForReals || showMenuPosition && showMenuPosition !== "label" || disableInlineMenu === true || disableInlineMenu === "by-input",
|
|
4850
|
+
portal: renderMenuInPortal,
|
|
4851
|
+
replaceValueOnVariableInsert: useInputWithNoVariables,
|
|
4852
|
+
useInputWhenNoVariables: useInputWithNoVariables,
|
|
4853
|
+
children: /* @__PURE__ */ jsx40(
|
|
4854
|
+
VariablesComposerInput,
|
|
4855
|
+
{
|
|
4856
|
+
id: finalId,
|
|
4857
|
+
"aria-label": ariaLabel,
|
|
4858
|
+
"data-testid": dataTestId ? dataTestId : "input-container",
|
|
4859
|
+
"data-text-value": value,
|
|
4860
|
+
css: [input, styleVariant === "compact" ? inputCompact : null],
|
|
4861
|
+
placeholder: placeholder ? /* @__PURE__ */ jsx40(
|
|
4862
|
+
Caption,
|
|
4863
|
+
{
|
|
4864
|
+
css: [
|
|
4865
|
+
placeholderCaption,
|
|
4866
|
+
styleVariant === "compact" ? placeholderCompact : null
|
|
4867
|
+
],
|
|
4868
|
+
children: placeholder
|
|
4869
|
+
}
|
|
4870
|
+
) : void 0
|
|
4871
|
+
}
|
|
4872
|
+
)
|
|
4873
|
+
}
|
|
4874
|
+
),
|
|
4875
|
+
disableVariablesForReals || showMenuPosition !== "inline-right" ? null : /* @__PURE__ */ jsx40(
|
|
4876
|
+
VariablesComposerVariableMenu,
|
|
4877
|
+
{
|
|
4878
|
+
...sharedMenuProps,
|
|
4879
|
+
buttonCss: variableBindButton,
|
|
4880
|
+
tip: useInputWithNoVariables ? void 0 : "Tip: access this list by typing $$",
|
|
4881
|
+
buttonProps: hadVariablesInValue ? { "aria-pressed": "true" } : void 0,
|
|
4882
|
+
replaceValueOnVariableInsert: useInputWithNoVariables
|
|
4883
|
+
}
|
|
4884
|
+
)
|
|
4885
|
+
]
|
|
4758
4886
|
}
|
|
4759
4887
|
),
|
|
4760
4888
|
caption ? /* @__PURE__ */ jsx40(Caption, { children: caption }) : null,
|
|
@@ -4776,7 +4904,7 @@ function InputVariables(props) {
|
|
|
4776
4904
|
},
|
|
4777
4905
|
id: finalId,
|
|
4778
4906
|
isActive: hadVariablesInValue,
|
|
4779
|
-
disableVariables: disableVariablesForReals || disableInlineMenu === "by-label",
|
|
4907
|
+
disableVariables: disableVariablesForReals || showMenuPosition && showMenuPosition !== "label" || disableInlineMenu === true || disableInlineMenu === "by-label",
|
|
4780
4908
|
children: input3
|
|
4781
4909
|
}
|
|
4782
4910
|
);
|
|
@@ -4831,103 +4959,8 @@ function InputVariablesOverlayMenu({
|
|
|
4831
4959
|
// src/components/Variables/ParameterConnectionIndicator.tsx
|
|
4832
4960
|
import { CgUsbC as CgUsbC2 } from "@react-icons/all-files/cg/CgUsbC";
|
|
4833
4961
|
import { bindVariablesToObject } from "@uniformdev/canvas";
|
|
4834
|
-
import { HorizontalRhythm as
|
|
4962
|
+
import { HorizontalRhythm as HorizontalRhythm5, Menu as Menu3 } from "@uniformdev/design-system";
|
|
4835
4963
|
import { useMemo as useMemo11 } from "react";
|
|
4836
|
-
|
|
4837
|
-
// src/components/Variables/styles/ParameterVariables.styles.ts
|
|
4838
|
-
import { css as css23 } from "@emotion/react";
|
|
4839
|
-
import { scrollbarStyles as scrollbarStyles3 } from "@uniformdev/design-system";
|
|
4840
|
-
var variableBindButton2 = css23`
|
|
4841
|
-
align-items: center;
|
|
4842
|
-
border: none;
|
|
4843
|
-
border-radius: var(--rounded-base);
|
|
4844
|
-
background: none;
|
|
4845
|
-
display: flex;
|
|
4846
|
-
height: 1.2rem;
|
|
4847
|
-
padding: var(--spacing-2xs);
|
|
4848
|
-
transition: background var(--duration-fast) var(--timing-ease-out),
|
|
4849
|
-
color var(--duration-fast) var(--timing-ease-out);
|
|
4850
|
-
width: 1.2rem;
|
|
4851
|
-
|
|
4852
|
-
&:hover,
|
|
4853
|
-
&[aria-pressed='true']:not(:disabled) {
|
|
4854
|
-
background: var(--brand-secondary-3);
|
|
4855
|
-
color: var(--white);
|
|
4856
|
-
}
|
|
4857
|
-
|
|
4858
|
-
&[aria-disabled='true'] {
|
|
4859
|
-
background: none;
|
|
4860
|
-
color: currentColor;
|
|
4861
|
-
}
|
|
4862
|
-
|
|
4863
|
-
// fixes menu resizing issue within iframes
|
|
4864
|
-
// see https://linear.app/uniform/issue/UNI-3068/mesh-integration-resizing-with-menus
|
|
4865
|
-
+ [role='menu'] {
|
|
4866
|
-
max-height: unset;
|
|
4867
|
-
}
|
|
4868
|
-
`;
|
|
4869
|
-
var input2 = css23`
|
|
4870
|
-
display: block;
|
|
4871
|
-
appearance: none;
|
|
4872
|
-
box-sizing: border-box;
|
|
4873
|
-
background: var(--white);
|
|
4874
|
-
border: 1px solid var(--gray-200);
|
|
4875
|
-
border-radius: var(--rounded-sm);
|
|
4876
|
-
color: var(--gray-700);
|
|
4877
|
-
font-size: var(--fs-sm);
|
|
4878
|
-
line-height: 1.5;
|
|
4879
|
-
min-height: 2rem;
|
|
4880
|
-
padding: var(--spacing-sm);
|
|
4881
|
-
width: 100%;
|
|
4882
|
-
position: relative;
|
|
4883
|
-
white-space: normal;
|
|
4884
|
-
transition-property: background, border-color, color, box-shadow, border-radius;
|
|
4885
|
-
transition-duration: var(--duration-fast);
|
|
4886
|
-
transition-timing-function: var(--timing-ease-out);
|
|
4887
|
-
|
|
4888
|
-
&::placeholder {
|
|
4889
|
-
color: var(--gray-400);
|
|
4890
|
-
}
|
|
4891
|
-
|
|
4892
|
-
&:focus,
|
|
4893
|
-
&:focus-within {
|
|
4894
|
-
border-radius: var(--rounded-sm);
|
|
4895
|
-
box-shadow: var(--elevation-100);
|
|
4896
|
-
border: 1px solid var(--accent-dark-active);
|
|
4897
|
-
outline: none;
|
|
4898
|
-
}
|
|
4899
|
-
&:hover {
|
|
4900
|
-
border: 1px solid var(--accent-dark-hover);
|
|
4901
|
-
}
|
|
4902
|
-
|
|
4903
|
-
&:disabled,
|
|
4904
|
-
&:disabled::placeholder,
|
|
4905
|
-
&:disabled:hover {
|
|
4906
|
-
border-radius: var(--rounded-sm);
|
|
4907
|
-
cursor: not-allowed;
|
|
4908
|
-
color: var(--gray-400);
|
|
4909
|
-
}
|
|
4910
|
-
|
|
4911
|
-
&[readonly],
|
|
4912
|
-
&[contenteditable='false'] {
|
|
4913
|
-
cursor: not-allowed;
|
|
4914
|
-
color: var(--gray-400);
|
|
4915
|
-
}
|
|
4916
|
-
|
|
4917
|
-
> p {
|
|
4918
|
-
margin: 0;
|
|
4919
|
-
}
|
|
4920
|
-
`;
|
|
4921
|
-
var inputMultiLine = (lines) => css23`
|
|
4922
|
-
${scrollbarStyles3}
|
|
4923
|
-
// 1.5 = line height, spacing-sm = top and bottom padding + spacing-xs to give a slight increase in height
|
|
4924
|
-
// as the text looked to close to the bottom of the input
|
|
4925
|
-
height: calc(${lines * 1.5}em + var(--spacing-sm) + var(--spacing-xs));
|
|
4926
|
-
resize: vertical;
|
|
4927
|
-
overflow: auto;
|
|
4928
|
-
`;
|
|
4929
|
-
|
|
4930
|
-
// src/components/Variables/ParameterConnectionIndicator.tsx
|
|
4931
4964
|
import { jsx as jsx41, jsxs as jsxs24 } from "@emotion/react/jsx-runtime";
|
|
4932
4965
|
function ParameterConnectionIndicator({
|
|
4933
4966
|
children,
|
|
@@ -4947,7 +4980,7 @@ function ParameterConnectionIndicator({
|
|
|
4947
4980
|
});
|
|
4948
4981
|
return result;
|
|
4949
4982
|
}, [value]);
|
|
4950
|
-
return /* @__PURE__ */ jsxs24(
|
|
4983
|
+
return /* @__PURE__ */ jsxs24(HorizontalRhythm5, { align: "center", gap: "xs", css: { width: "100%" }, children: [
|
|
4951
4984
|
/* @__PURE__ */ jsx41("div", { css: { flex: 1 }, children }),
|
|
4952
4985
|
disabled ? null : /* @__PURE__ */ jsx41(
|
|
4953
4986
|
Menu3,
|
|
@@ -4959,7 +4992,7 @@ function ParameterConnectionIndicator({
|
|
|
4959
4992
|
{
|
|
4960
4993
|
title: menuTooltip,
|
|
4961
4994
|
"aria-pressed": hasVariablesInValue,
|
|
4962
|
-
css: [menuBtn,
|
|
4995
|
+
css: [menuBtn, variableBindButton],
|
|
4963
4996
|
type: "button",
|
|
4964
4997
|
children: /* @__PURE__ */ jsx41(CgUsbC2, { size: "1.4rem" })
|
|
4965
4998
|
}
|
|
@@ -4972,7 +5005,7 @@ function ParameterConnectionIndicator({
|
|
|
4972
5005
|
}
|
|
4973
5006
|
|
|
4974
5007
|
// src/components/Variables/ParameterOrSingleVariable.tsx
|
|
4975
|
-
import { HorizontalRhythm as
|
|
5008
|
+
import { HorizontalRhythm as HorizontalRhythm6 } from "@uniformdev/design-system";
|
|
4976
5009
|
import { useCallback as useCallback4 } from "react";
|
|
4977
5010
|
|
|
4978
5011
|
// src/components/Variables/composer/OnDisconnectPlugin.tsx
|
|
@@ -5058,7 +5091,7 @@ function ParameterOrSingleVariable(props) {
|
|
|
5058
5091
|
/* @__PURE__ */ jsx42(OnDisconnectPlugin, { onDisconnect: handleDisconnect }),
|
|
5059
5092
|
editorRef ? /* @__PURE__ */ jsx42(EditorRefPlugin, { editorRef }) : null,
|
|
5060
5093
|
/* @__PURE__ */ jsx42(ControlledValuePlugin, { enabled: true, value }),
|
|
5061
|
-
/* @__PURE__ */ jsxs25(
|
|
5094
|
+
/* @__PURE__ */ jsxs25(HorizontalRhythm6, { align: "center", gap: "xs", css: { width: "100%" }, children: [
|
|
5062
5095
|
/* @__PURE__ */ jsx42("div", { css: { flex: 1 }, children: inputWhenNoVariables && !hadVariablesInValue ? inputWhenNoVariables : /* @__PURE__ */ jsx42(
|
|
5063
5096
|
VariablesComposerInput,
|
|
5064
5097
|
{
|
|
@@ -5071,7 +5104,7 @@ function ParameterOrSingleVariable(props) {
|
|
|
5071
5104
|
VariablesComposerVariableMenu,
|
|
5072
5105
|
{
|
|
5073
5106
|
...sharedMenuProps,
|
|
5074
|
-
buttonCss: [
|
|
5107
|
+
buttonCss: [variableBindButton],
|
|
5075
5108
|
buttonProps: hasVariablesInValue ? { "aria-pressed": "true" } : void 0,
|
|
5076
5109
|
replaceValueOnVariableInsert: true,
|
|
5077
5110
|
filterVariable
|
|
@@ -5085,8 +5118,8 @@ function ParameterOrSingleVariable(props) {
|
|
|
5085
5118
|
}
|
|
5086
5119
|
|
|
5087
5120
|
// src/components/Variables/ParameterVariables.tsx
|
|
5088
|
-
import { css as
|
|
5089
|
-
import { HorizontalRhythm as
|
|
5121
|
+
import { css as css25 } from "@emotion/react";
|
|
5122
|
+
import { HorizontalRhythm as HorizontalRhythm7 } from "@uniformdev/design-system";
|
|
5090
5123
|
import { jsx as jsx43, jsxs as jsxs26 } from "@emotion/react/jsx-runtime";
|
|
5091
5124
|
function ParameterVariables(props) {
|
|
5092
5125
|
const {
|
|
@@ -5125,7 +5158,7 @@ function ParameterVariables(props) {
|
|
|
5125
5158
|
editorRef ? /* @__PURE__ */ jsx43(EditorRefPlugin, { editorRef }) : null,
|
|
5126
5159
|
/* @__PURE__ */ jsx43(ControlledValuePlugin, { value, enabled: useInputWhenNoVariables }),
|
|
5127
5160
|
/* @__PURE__ */ jsxs26(
|
|
5128
|
-
|
|
5161
|
+
HorizontalRhythm7,
|
|
5129
5162
|
{
|
|
5130
5163
|
align: "center",
|
|
5131
5164
|
gap: "xs",
|
|
@@ -5144,8 +5177,8 @@ function ParameterVariables(props) {
|
|
|
5144
5177
|
"data-text-value": value,
|
|
5145
5178
|
css: [
|
|
5146
5179
|
input2,
|
|
5147
|
-
typeof multiLine === "number" ? inputMultiLine(multiLine) : multiLine === true ? inputMultiLine(2) :
|
|
5148
|
-
inputCss != null ? inputCss :
|
|
5180
|
+
typeof multiLine === "number" ? inputMultiLine(multiLine) : multiLine === true ? inputMultiLine(2) : css25``,
|
|
5181
|
+
inputCss != null ? inputCss : css25``
|
|
5149
5182
|
]
|
|
5150
5183
|
}
|
|
5151
5184
|
) }),
|
|
@@ -5153,7 +5186,7 @@ function ParameterVariables(props) {
|
|
|
5153
5186
|
VariablesComposerVariableMenu,
|
|
5154
5187
|
{
|
|
5155
5188
|
...sharedMenuProps,
|
|
5156
|
-
buttonCss: [
|
|
5189
|
+
buttonCss: [variableBindButton],
|
|
5157
5190
|
tip: useInputWhenNoVariables ? void 0 : "Tip: access this list by typing $$",
|
|
5158
5191
|
buttonProps: hasVariablesInValue ? { "aria-pressed": "true" } : void 0,
|
|
5159
5192
|
replaceValueOnVariableInsert: useInputWhenNoVariables
|
|
@@ -5181,7 +5214,7 @@ ${prettifyBindExpression(bindExpression)}`
|
|
|
5181
5214
|
}
|
|
5182
5215
|
|
|
5183
5216
|
// src/components/Variables/VariablesList.tsx
|
|
5184
|
-
import { css as
|
|
5217
|
+
import { css as css27 } from "@emotion/react";
|
|
5185
5218
|
import {
|
|
5186
5219
|
AddListButton,
|
|
5187
5220
|
button,
|
|
@@ -5196,8 +5229,8 @@ import {
|
|
|
5196
5229
|
import { Draggable as Draggable2, Droppable as Droppable2 } from "react-beautiful-dnd";
|
|
5197
5230
|
|
|
5198
5231
|
// src/components/Variables/styles/VariablesList.styles.ts
|
|
5199
|
-
import { css as
|
|
5200
|
-
var tableRow = (isDragging) =>
|
|
5232
|
+
import { css as css26 } from "@emotion/react";
|
|
5233
|
+
var tableRow = (isDragging) => css26`
|
|
5201
5234
|
position: relative;
|
|
5202
5235
|
${isDragging ? `
|
|
5203
5236
|
display: table;
|
|
@@ -5205,7 +5238,7 @@ var tableRow = (isDragging) => css25`
|
|
|
5205
5238
|
top: auto !important;
|
|
5206
5239
|
` : void 0}
|
|
5207
5240
|
`;
|
|
5208
|
-
var tableCellDragIcon =
|
|
5241
|
+
var tableCellDragIcon = css26`
|
|
5209
5242
|
&::after {
|
|
5210
5243
|
content: '';
|
|
5211
5244
|
display: block;
|
|
@@ -5223,7 +5256,7 @@ var tableCellDragIcon = css25`
|
|
|
5223
5256
|
opacity: 1;
|
|
5224
5257
|
}
|
|
5225
5258
|
`;
|
|
5226
|
-
var variableName =
|
|
5259
|
+
var variableName = css26`
|
|
5227
5260
|
border: none;
|
|
5228
5261
|
font-weight: var(--fw-medium);
|
|
5229
5262
|
padding: 0;
|
|
@@ -5233,7 +5266,7 @@ var variableName = css25`
|
|
|
5233
5266
|
white-space: nowrap;
|
|
5234
5267
|
max-width: 20ch;
|
|
5235
5268
|
`;
|
|
5236
|
-
var variableValue =
|
|
5269
|
+
var variableValue = css26`
|
|
5237
5270
|
overflow: hidden;
|
|
5238
5271
|
text-overflow: ellipsis;
|
|
5239
5272
|
white-space: nowrap;
|
|
@@ -5310,7 +5343,7 @@ function VariablesList() {
|
|
|
5310
5343
|
title: `delete ${text}`,
|
|
5311
5344
|
css: [
|
|
5312
5345
|
button,
|
|
5313
|
-
|
|
5346
|
+
css27`
|
|
5314
5347
|
background: transparent;
|
|
5315
5348
|
`
|
|
5316
5349
|
],
|
|
@@ -5344,6 +5377,10 @@ function VariablesList() {
|
|
|
5344
5377
|
|
|
5345
5378
|
// src/components/DataResourceDynamicInputProvider.tsx
|
|
5346
5379
|
import { jsx as jsx45 } from "@emotion/react/jsx-runtime";
|
|
5380
|
+
var DataResourceInputContext = createContext4(void 0);
|
|
5381
|
+
var useDataResourceDynamicInputs = () => {
|
|
5382
|
+
return useContext6(DataResourceInputContext);
|
|
5383
|
+
};
|
|
5347
5384
|
function DataResourceDynamicInputProvider(props) {
|
|
5348
5385
|
const { children, dynamicInputs } = props;
|
|
5349
5386
|
if (dynamicInputs) {
|
|
@@ -5362,7 +5399,7 @@ function DataResourceDynamicInputProviderRenderer({
|
|
|
5362
5399
|
dynamicInputs
|
|
5363
5400
|
}) {
|
|
5364
5401
|
const variables = useDynamicInputsAsVariables(dynamicInputs);
|
|
5365
|
-
return /* @__PURE__ */ jsx45(VariablesProvider, { value: variables, readOnly: true, children });
|
|
5402
|
+
return /* @__PURE__ */ jsx45(DataResourceInputContext.Provider, { value: dynamicInputs, children: /* @__PURE__ */ jsx45(VariablesProvider, { value: variables, readOnly: true, children }) });
|
|
5366
5403
|
}
|
|
5367
5404
|
|
|
5368
5405
|
// src/components/DataResourceVariablesList.tsx
|
|
@@ -5439,7 +5476,7 @@ function TextVariableRenderer({ definition, value, setValue }) {
|
|
|
5439
5476
|
}
|
|
5440
5477
|
|
|
5441
5478
|
// src/components/Request/RequestBody.tsx
|
|
5442
|
-
import { css as
|
|
5479
|
+
import { css as css29 } from "@emotion/react";
|
|
5443
5480
|
import { InputSelect as InputSelect4, JsonEditor } from "@uniformdev/design-system";
|
|
5444
5481
|
import { useState as useState14 } from "react";
|
|
5445
5482
|
|
|
@@ -5525,11 +5562,11 @@ function useRequest() {
|
|
|
5525
5562
|
}
|
|
5526
5563
|
|
|
5527
5564
|
// src/components/Request/styles/Request.styles.ts
|
|
5528
|
-
import { css as
|
|
5529
|
-
var innerContentStyles =
|
|
5565
|
+
import { css as css28 } from "@emotion/react";
|
|
5566
|
+
var innerContentStyles = css28`
|
|
5530
5567
|
background: var(--white);
|
|
5531
5568
|
`;
|
|
5532
|
-
var requestTypeContainer = (bgColor) =>
|
|
5569
|
+
var requestTypeContainer = (bgColor) => css28`
|
|
5533
5570
|
align-items: start;
|
|
5534
5571
|
background: ${bgColor};
|
|
5535
5572
|
display: grid;
|
|
@@ -5571,7 +5608,7 @@ function RequestBody() {
|
|
|
5571
5608
|
return /* @__PURE__ */ jsxs28(
|
|
5572
5609
|
"div",
|
|
5573
5610
|
{
|
|
5574
|
-
css:
|
|
5611
|
+
css: css29`
|
|
5575
5612
|
background: var(--white);
|
|
5576
5613
|
`,
|
|
5577
5614
|
children: [
|
|
@@ -5579,7 +5616,7 @@ function RequestBody() {
|
|
|
5579
5616
|
RequestTypeContainer,
|
|
5580
5617
|
{
|
|
5581
5618
|
bgColor: "var(--gray-100)",
|
|
5582
|
-
css:
|
|
5619
|
+
css: css29`
|
|
5583
5620
|
padding: var(--spacing-sm) var(--spacing-base);
|
|
5584
5621
|
`,
|
|
5585
5622
|
children: /* @__PURE__ */ jsx49(
|
|
@@ -5868,7 +5905,7 @@ function RequestParameters({
|
|
|
5868
5905
|
}
|
|
5869
5906
|
|
|
5870
5907
|
// src/components/Request/RequestUrl.tsx
|
|
5871
|
-
import { css as
|
|
5908
|
+
import { css as css30 } from "@emotion/react";
|
|
5872
5909
|
import { useMemo as useMemo13 } from "react";
|
|
5873
5910
|
|
|
5874
5911
|
// src/components/Request/urlEncodeRequestParameter.ts
|
|
@@ -5905,7 +5942,7 @@ function RequestUrl() {
|
|
|
5905
5942
|
return /* @__PURE__ */ jsxs31(
|
|
5906
5943
|
"small",
|
|
5907
5944
|
{
|
|
5908
|
-
css:
|
|
5945
|
+
css: css30`
|
|
5909
5946
|
display: inline-block;
|
|
5910
5947
|
margin-bottom: var(--spacing-xs);
|
|
5911
5948
|
word-break: break-word;
|
|
@@ -6206,7 +6243,7 @@ var MeshApp = ({
|
|
|
6206
6243
|
};
|
|
6207
6244
|
|
|
6208
6245
|
// src/components/ObjectSearch/DataRefreshButton.tsx
|
|
6209
|
-
import { css as
|
|
6246
|
+
import { css as css31 } from "@emotion/react";
|
|
6210
6247
|
import { Button as Button3, LoadingIndicator as LoadingIndicator4 } from "@uniformdev/design-system";
|
|
6211
6248
|
import { jsx as jsx58, jsxs as jsxs33 } from "@emotion/react/jsx-runtime";
|
|
6212
6249
|
var DataRefreshButton = ({
|
|
@@ -6219,7 +6256,7 @@ var DataRefreshButton = ({
|
|
|
6219
6256
|
!isLoading ? null : /* @__PURE__ */ jsx58(
|
|
6220
6257
|
LoadingIndicator4,
|
|
6221
6258
|
{
|
|
6222
|
-
css:
|
|
6259
|
+
css: css31`
|
|
6223
6260
|
${isLoading ? "opacity: 0.2;" : void 0}
|
|
6224
6261
|
`
|
|
6225
6262
|
}
|
|
@@ -6229,22 +6266,23 @@ var DataRefreshButton = ({
|
|
|
6229
6266
|
};
|
|
6230
6267
|
|
|
6231
6268
|
// src/components/ObjectSearch/ObjectSearchContainer.tsx
|
|
6232
|
-
import { css as
|
|
6269
|
+
import { css as css36 } from "@emotion/react";
|
|
6233
6270
|
import { bindVariables } from "@uniformdev/canvas";
|
|
6234
6271
|
import { Callout as Callout5, Container, IconsProvider, ScrollableList, VerticalRhythm as VerticalRhythm2 } from "@uniformdev/design-system";
|
|
6272
|
+
import React12 from "react";
|
|
6235
6273
|
|
|
6236
6274
|
// src/components/ObjectSearch/hooks/ObjectSearchContext.tsx
|
|
6237
6275
|
import { bindVariablesToObject as bindVariablesToObject2 } from "@uniformdev/canvas";
|
|
6238
6276
|
import {
|
|
6239
|
-
createContext as
|
|
6277
|
+
createContext as createContext6,
|
|
6240
6278
|
useCallback as useCallback5,
|
|
6241
|
-
useContext as
|
|
6279
|
+
useContext as useContext8,
|
|
6242
6280
|
useDeferredValue,
|
|
6243
6281
|
useMemo as useMemo14,
|
|
6244
6282
|
useState as useState16
|
|
6245
6283
|
} from "react";
|
|
6246
6284
|
import { jsx as jsx59 } from "@emotion/react/jsx-runtime";
|
|
6247
|
-
var ObjectSearchContext =
|
|
6285
|
+
var ObjectSearchContext = createContext6({
|
|
6248
6286
|
onSetQuery: () => {
|
|
6249
6287
|
},
|
|
6250
6288
|
onSelectItem: () => {
|
|
@@ -6252,8 +6290,6 @@ var ObjectSearchContext = createContext5({
|
|
|
6252
6290
|
query: {},
|
|
6253
6291
|
boundQuery: {},
|
|
6254
6292
|
list: {},
|
|
6255
|
-
onSetList: () => {
|
|
6256
|
-
},
|
|
6257
6293
|
selectedListItems: [],
|
|
6258
6294
|
onRemoveAllSelectedItems: () => {
|
|
6259
6295
|
},
|
|
@@ -6337,7 +6373,7 @@ var ObjectSearchProvider = ({
|
|
|
6337
6373
|
return /* @__PURE__ */ jsx59(ObjectSearchContext.Provider, { value, children });
|
|
6338
6374
|
};
|
|
6339
6375
|
function useObjectSearchContext() {
|
|
6340
|
-
return
|
|
6376
|
+
return useContext8(ObjectSearchContext);
|
|
6341
6377
|
}
|
|
6342
6378
|
function bindQuery(query, inputs) {
|
|
6343
6379
|
const { result, errors } = bindVariablesToObject2({
|
|
@@ -6355,9 +6391,9 @@ function bindQuery(query, inputs) {
|
|
|
6355
6391
|
import { Chip, Popover } from "@uniformdev/design-system";
|
|
6356
6392
|
|
|
6357
6393
|
// src/components/ObjectSearch/styles/ObjectSearchListItem.styles.ts
|
|
6358
|
-
import { css as
|
|
6394
|
+
import { css as css32 } from "@emotion/react";
|
|
6359
6395
|
import { skeletonLoading } from "@uniformdev/design-system";
|
|
6360
|
-
var ObjectListItemContainer =
|
|
6396
|
+
var ObjectListItemContainer = css32`
|
|
6361
6397
|
align-items: center;
|
|
6362
6398
|
border: 1px solid var(--gray-300);
|
|
6363
6399
|
border-radius: var(--rounded-base);
|
|
@@ -6366,11 +6402,11 @@ var ObjectListItemContainer = css31`
|
|
|
6366
6402
|
grid-template-columns: 1fr auto;
|
|
6367
6403
|
padding: var(--spacing-sm);
|
|
6368
6404
|
`;
|
|
6369
|
-
var ObjectListItemContainerDisabled =
|
|
6405
|
+
var ObjectListItemContainerDisabled = css32`
|
|
6370
6406
|
opacity: var(--opacity-50);
|
|
6371
6407
|
pointer-events: none;
|
|
6372
6408
|
`;
|
|
6373
|
-
var ObjectListItemLoading =
|
|
6409
|
+
var ObjectListItemLoading = css32`
|
|
6374
6410
|
animation: ${skeletonLoading} 1s linear infinite alternate;
|
|
6375
6411
|
border-color: transparent;
|
|
6376
6412
|
min-height: 42px;
|
|
@@ -6394,36 +6430,36 @@ var ObjectListItemLoading = css31`
|
|
|
6394
6430
|
width: 1rem;
|
|
6395
6431
|
}
|
|
6396
6432
|
`;
|
|
6397
|
-
var ObjectListItemHeadingGroup =
|
|
6433
|
+
var ObjectListItemHeadingGroup = css32`
|
|
6398
6434
|
align-items: center;
|
|
6399
6435
|
display: grid;
|
|
6400
6436
|
`;
|
|
6401
|
-
var ObjectListItemThumbnail =
|
|
6437
|
+
var ObjectListItemThumbnail = css32`
|
|
6402
6438
|
width: 30px;
|
|
6403
6439
|
object-fit: contain;
|
|
6404
6440
|
`;
|
|
6405
|
-
var ObjectListItemTitle =
|
|
6441
|
+
var ObjectListItemTitle = css32`
|
|
6406
6442
|
color: var(--typography-base);
|
|
6407
6443
|
display: block;
|
|
6408
6444
|
font-size: var(--fs-sm);
|
|
6409
6445
|
`;
|
|
6410
|
-
var ObjectListItemSubtitle =
|
|
6446
|
+
var ObjectListItemSubtitle = css32`
|
|
6411
6447
|
color: var(--gray-500);
|
|
6412
6448
|
display: block;
|
|
6413
6449
|
font-size: var(--fs-xs);
|
|
6414
6450
|
line-height: 1;
|
|
6415
6451
|
`;
|
|
6416
|
-
var ObjectListItemInfoContainer =
|
|
6452
|
+
var ObjectListItemInfoContainer = css32`
|
|
6417
6453
|
align-items: center;
|
|
6418
6454
|
display: flex;
|
|
6419
6455
|
gap: var(--spacing-sm);
|
|
6420
6456
|
justify-content: center;
|
|
6421
6457
|
`;
|
|
6422
|
-
var ObjectListItemControlledContent =
|
|
6458
|
+
var ObjectListItemControlledContent = css32`
|
|
6423
6459
|
display: flex;
|
|
6424
6460
|
gap: var(--spacing-sm);
|
|
6425
6461
|
`;
|
|
6426
|
-
var ObjectListItemUnControlledContent =
|
|
6462
|
+
var ObjectListItemUnControlledContent = css32`
|
|
6427
6463
|
margin-top: var(--spacing-sm);
|
|
6428
6464
|
grid-column: 1 / -1;
|
|
6429
6465
|
`;
|
|
@@ -6493,201 +6529,18 @@ var ObjectSearchListItemLoadingSkeleton = () => {
|
|
|
6493
6529
|
return /* @__PURE__ */ jsx60("div", { role: "presentation", css: [ObjectListItemContainer, ObjectListItemLoading] });
|
|
6494
6530
|
};
|
|
6495
6531
|
|
|
6496
|
-
// src/components/ObjectSearch/
|
|
6497
|
-
import {
|
|
6498
|
-
|
|
6499
|
-
label,
|
|
6500
|
-
enableDynamicInputToResultId,
|
|
6501
|
-
searchFilters,
|
|
6502
|
-
resultList,
|
|
6503
|
-
children
|
|
6504
|
-
}) => {
|
|
6505
|
-
var _a, _b;
|
|
6506
|
-
const { onSelectItem, selectedListItems, list } = useObjectSearchContext();
|
|
6507
|
-
const { flatVariables } = useVariables(true);
|
|
6508
|
-
const inputValue = (_b = (_a = selectedListItems == null ? void 0 : selectedListItems[0]) == null ? void 0 : _a.id) != null ? _b : "";
|
|
6509
|
-
const listItems = resultList != null ? resultList : /* @__PURE__ */ jsx61(
|
|
6510
|
-
ScrollableList,
|
|
6511
|
-
{
|
|
6512
|
-
role: "list",
|
|
6513
|
-
css: css32`
|
|
6514
|
-
> div {
|
|
6515
|
-
transition: max-height var(--duration-slow) var(--timing-ease-out);
|
|
6516
|
-
max-height: ${selectedListItems.length === 0 ? "50vh" : "184px"};
|
|
6517
|
-
}
|
|
6518
|
-
`,
|
|
6519
|
-
children: /* @__PURE__ */ jsx61(DefaultResultList, {})
|
|
6520
|
-
}
|
|
6521
|
-
);
|
|
6522
|
-
const body = /* @__PURE__ */ jsxs35(VerticalRhythm2, { children: [
|
|
6523
|
-
searchFilters,
|
|
6524
|
-
listItems
|
|
6525
|
-
] });
|
|
6526
|
-
const handleSelectedVariableChange = (selectedValue) => {
|
|
6527
|
-
var _a2;
|
|
6528
|
-
if (!selectedValue) {
|
|
6529
|
-
onSelectItem([]);
|
|
6530
|
-
return;
|
|
6531
|
-
}
|
|
6532
|
-
const { result, errors } = bindVariables({
|
|
6533
|
-
value: selectedValue,
|
|
6534
|
-
variables: flatVariables,
|
|
6535
|
-
errorPrefix: "Dynamic input"
|
|
6536
|
-
});
|
|
6537
|
-
if (!result) {
|
|
6538
|
-
onSelectItem([]);
|
|
6539
|
-
return;
|
|
6540
|
-
}
|
|
6541
|
-
const item = (_a2 = list.items) == null ? void 0 : _a2.find((i) => i.id === result);
|
|
6542
|
-
onSelectItem([
|
|
6543
|
-
{
|
|
6544
|
-
title: selectedValue,
|
|
6545
|
-
contentType: (errors == null ? void 0 : errors.length) ? errors[0] instanceof Error ? errors[0].message : errors[0] : `Current dynamic value "${result}" is not an ID in the options`,
|
|
6546
|
-
// spread any matched list item, overriding the above default props
|
|
6547
|
-
...item,
|
|
6548
|
-
// we want to make sure the ID is our dynamic value
|
|
6549
|
-
id: selectedValue
|
|
6550
|
-
}
|
|
6551
|
-
]);
|
|
6552
|
-
};
|
|
6553
|
-
return /* @__PURE__ */ jsx61(IconsProvider, { children: /* @__PURE__ */ jsxs35(VerticalRhythm2, { children: [
|
|
6554
|
-
/* @__PURE__ */ jsx61(Container, { backgroundColor: "gray-50", padding: "var(--spacing-base)", border: true, children: label ? /* @__PURE__ */ jsx61(
|
|
6555
|
-
InputVariables,
|
|
6556
|
-
{
|
|
6557
|
-
label,
|
|
6558
|
-
value: inputValue,
|
|
6559
|
-
onChange: (value) => {
|
|
6560
|
-
if (value === inputValue) {
|
|
6561
|
-
return;
|
|
6562
|
-
}
|
|
6563
|
-
handleSelectedVariableChange(value);
|
|
6564
|
-
},
|
|
6565
|
-
inputWhenNoVariables: body,
|
|
6566
|
-
disableVariables: !enableDynamicInputToResultId
|
|
6567
|
-
}
|
|
6568
|
-
) : body }),
|
|
6569
|
-
children
|
|
6570
|
-
] }) });
|
|
6571
|
-
};
|
|
6572
|
-
var DefaultResultList = () => {
|
|
6573
|
-
var _a;
|
|
6574
|
-
const { list } = useObjectSearchContext();
|
|
6575
|
-
if (!list.items) {
|
|
6576
|
-
return Array.from(Array(5).keys()).map((i) => /* @__PURE__ */ jsx61(ObjectSearchListItemLoadingSkeleton, {}, i));
|
|
6577
|
-
}
|
|
6578
|
-
if (list.items.length === 0) {
|
|
6579
|
-
return /* @__PURE__ */ jsx61(Callout5, { type: "info", children: "No results were found" });
|
|
6580
|
-
}
|
|
6581
|
-
return (_a = list.items) == null ? void 0 : _a.map((item) => /* @__PURE__ */ jsx61(ObjectSearchListItem, { ...item }, item.id));
|
|
6582
|
-
};
|
|
6583
|
-
|
|
6584
|
-
// src/components/ObjectSearch/ObjectSearchFilter.tsx
|
|
6585
|
-
import { DebouncedInputKeywordSearch, InputSelect as InputSelect6 } from "@uniformdev/design-system";
|
|
6586
|
-
import { useMemo as useMemo15, useState as useState17 } from "react";
|
|
6587
|
-
|
|
6588
|
-
// src/components/ObjectSearch/styles/ObjectSearchFilterContainer.styles.ts
|
|
6589
|
-
import { css as css33 } from "@emotion/react";
|
|
6590
|
-
var ObjectSearchFilterContainerLabel = css33`
|
|
6591
|
-
align-items: center;
|
|
6592
|
-
display: flex;
|
|
6593
|
-
font-size: var(--fs-sm);
|
|
6594
|
-
font-weight: var(--fw-bold);
|
|
6595
|
-
line-height: 1rem;
|
|
6596
|
-
margin-bottom: var(--spacing-sm);
|
|
6597
|
-
`;
|
|
6598
|
-
var ObjectSearchFilterContainer = css33`
|
|
6599
|
-
display: grid;
|
|
6600
|
-
gap: var(--spacing-base);
|
|
6601
|
-
`;
|
|
6602
|
-
var ObjectSearchFilterGrid = (gridColumns) => css33`
|
|
6603
|
-
display: grid;
|
|
6604
|
-
grid-template-columns: ${gridColumns};
|
|
6605
|
-
gap: var(--spacing-base);
|
|
6606
|
-
`;
|
|
6607
|
-
|
|
6608
|
-
// src/components/ObjectSearch/ObjectSearchFilter.tsx
|
|
6609
|
-
import { jsx as jsx62, jsxs as jsxs36 } from "@emotion/react/jsx-runtime";
|
|
6610
|
-
var ObjectSearchFilter = ({
|
|
6611
|
-
requireContentType,
|
|
6612
|
-
typeSelectorAllTypesOptionText = "All content types",
|
|
6613
|
-
searchInputName = "searchText",
|
|
6614
|
-
searchInputPlaceholderText = "Enter keyword to narrow your results",
|
|
6615
|
-
selectLabel = "Content Type Select",
|
|
6616
|
-
selectOptions
|
|
6617
|
-
}) => {
|
|
6618
|
-
var _a, _b;
|
|
6619
|
-
const { query, onSetQuery } = useObjectSearchContext();
|
|
6620
|
-
const [searchState, setSearchState] = useState17({
|
|
6621
|
-
contentType: (_a = query.contentType) != null ? _a : "",
|
|
6622
|
-
keyword: (_b = query.keyword) != null ? _b : ""
|
|
6623
|
-
});
|
|
6624
|
-
const handleFilterChange = (value) => {
|
|
6625
|
-
setSearchState((prev) => {
|
|
6626
|
-
return { ...prev, ...value };
|
|
6627
|
-
});
|
|
6628
|
-
onSetQuery({ ...query, ...value });
|
|
6629
|
-
};
|
|
6630
|
-
const memoizedSelectOptions = useMemo15(() => {
|
|
6631
|
-
if (!requireContentType && !(selectOptions == null ? void 0 : selectOptions.length)) {
|
|
6632
|
-
return [];
|
|
6633
|
-
}
|
|
6634
|
-
return [
|
|
6635
|
-
...!requireContentType ? [{ value: "any", label: typeSelectorAllTypesOptionText }] : [],
|
|
6636
|
-
...selectOptions != null ? selectOptions : []
|
|
6637
|
-
];
|
|
6638
|
-
}, [requireContentType, typeSelectorAllTypesOptionText, selectOptions]);
|
|
6639
|
-
const shouldRenderSelect = memoizedSelectOptions.length > 0;
|
|
6640
|
-
return /* @__PURE__ */ jsxs36(
|
|
6641
|
-
"fieldset",
|
|
6642
|
-
{
|
|
6643
|
-
css: [
|
|
6644
|
-
ObjectSearchFilterContainer,
|
|
6645
|
-
ObjectSearchFilterGrid(shouldRenderSelect ? "1fr 2fr" : "1fr")
|
|
6646
|
-
],
|
|
6647
|
-
children: [
|
|
6648
|
-
memoizedSelectOptions.length ? /* @__PURE__ */ jsx62(
|
|
6649
|
-
InputSelect6,
|
|
6650
|
-
{
|
|
6651
|
-
label: selectLabel,
|
|
6652
|
-
showLabel: false,
|
|
6653
|
-
onChange: (e) => handleFilterChange({ contentType: e.target.value }),
|
|
6654
|
-
options: memoizedSelectOptions,
|
|
6655
|
-
value: query.contentType
|
|
6656
|
-
}
|
|
6657
|
-
) : null,
|
|
6658
|
-
/* @__PURE__ */ jsx62(
|
|
6659
|
-
DebouncedInputKeywordSearch,
|
|
6660
|
-
{
|
|
6661
|
-
inputFieldName: searchInputName,
|
|
6662
|
-
placeholder: searchInputPlaceholderText,
|
|
6663
|
-
onSearchTextChanged: (keyword) => handleFilterChange({ keyword }),
|
|
6664
|
-
disabledFieldSubmission: true,
|
|
6665
|
-
defaultValue: searchState.keyword,
|
|
6666
|
-
delay: 300
|
|
6667
|
-
}
|
|
6668
|
-
)
|
|
6669
|
-
]
|
|
6670
|
-
}
|
|
6671
|
-
);
|
|
6672
|
-
};
|
|
6673
|
-
|
|
6674
|
-
// src/components/ObjectSearch/ObjectSearchFilterContainer.tsx
|
|
6675
|
-
import { jsx as jsx63, jsxs as jsxs37 } from "@emotion/react/jsx-runtime";
|
|
6676
|
-
var ObjectSearchFilterContainer2 = ({ label, children }) => {
|
|
6677
|
-
return /* @__PURE__ */ jsxs37("div", { children: [
|
|
6678
|
-
label ? /* @__PURE__ */ jsx63("span", { css: ObjectSearchFilterContainerLabel, children: label }) : null,
|
|
6679
|
-
/* @__PURE__ */ jsx63("div", { css: ObjectSearchFilterContainer, children })
|
|
6680
|
-
] });
|
|
6681
|
-
};
|
|
6532
|
+
// src/components/ObjectSearch/ObjectSearchResultList.tsx
|
|
6533
|
+
import { Button as Button5, Counter } from "@uniformdev/design-system";
|
|
6534
|
+
import { Draggable as Draggable3, Droppable as Droppable3 } from "react-beautiful-dnd";
|
|
6682
6535
|
|
|
6683
6536
|
// src/components/ObjectSearch/ObjectSearchResultItem.tsx
|
|
6684
6537
|
import { Badge, Button as Button4, Popover as Popover2 } from "@uniformdev/design-system";
|
|
6685
6538
|
import { format as timeagoFormat } from "timeago.js";
|
|
6686
6539
|
|
|
6687
6540
|
// src/components/ObjectSearch/styles/ObjectSearchResultItemButton.styles.ts
|
|
6688
|
-
import { css as
|
|
6541
|
+
import { css as css33 } from "@emotion/react";
|
|
6689
6542
|
import { button as button2 } from "@uniformdev/design-system";
|
|
6690
|
-
var ButtonStyles =
|
|
6543
|
+
var ButtonStyles = css33`
|
|
6691
6544
|
${button2}
|
|
6692
6545
|
background: transparent;
|
|
6693
6546
|
border: 1px solid var(--typography-base);
|
|
@@ -6714,20 +6567,20 @@ var ButtonStyles = css34`
|
|
|
6714
6567
|
text-decoration: none;
|
|
6715
6568
|
}
|
|
6716
6569
|
`;
|
|
6717
|
-
var ButtonIcon =
|
|
6570
|
+
var ButtonIcon = css33`
|
|
6718
6571
|
width: 1rem;
|
|
6719
6572
|
height: 1rem;
|
|
6720
6573
|
`;
|
|
6721
6574
|
|
|
6722
6575
|
// src/components/ObjectSearch/ObjectSearchResultItemButton.tsx
|
|
6723
|
-
import { jsx as
|
|
6576
|
+
import { jsx as jsx61, jsxs as jsxs35 } from "@emotion/react/jsx-runtime";
|
|
6724
6577
|
var ObjectSearchResultItemButton = ({
|
|
6725
6578
|
text,
|
|
6726
6579
|
icon,
|
|
6727
6580
|
...props
|
|
6728
6581
|
}) => {
|
|
6729
|
-
return /* @__PURE__ */
|
|
6730
|
-
!icon ? null : /* @__PURE__ */
|
|
6582
|
+
return /* @__PURE__ */ jsxs35("button", { type: "button", css: ButtonStyles, ...props, children: [
|
|
6583
|
+
!icon ? null : /* @__PURE__ */ jsx61(Image, { src: icon, css: ButtonIcon }),
|
|
6731
6584
|
text
|
|
6732
6585
|
] });
|
|
6733
6586
|
};
|
|
@@ -6736,15 +6589,15 @@ var LinkButton = ({
|
|
|
6736
6589
|
icon,
|
|
6737
6590
|
...props
|
|
6738
6591
|
}) => {
|
|
6739
|
-
return /* @__PURE__ */
|
|
6740
|
-
!icon ? null : /* @__PURE__ */
|
|
6592
|
+
return /* @__PURE__ */ jsxs35("a", { ...props, css: ButtonStyles, target: "_blank", rel: "noopener noreferrer", children: [
|
|
6593
|
+
!icon ? null : /* @__PURE__ */ jsx61(Image, { src: icon, css: ButtonIcon }),
|
|
6741
6594
|
text
|
|
6742
6595
|
] });
|
|
6743
6596
|
};
|
|
6744
6597
|
|
|
6745
6598
|
// src/components/ObjectSearch/styles/ObjectSearchResultItem.styles.ts
|
|
6746
|
-
import { css as
|
|
6747
|
-
var ObjectSearchResultItemContainer =
|
|
6599
|
+
import { css as css34 } from "@emotion/react";
|
|
6600
|
+
var ObjectSearchResultItemContainer = css34`
|
|
6748
6601
|
align-items: center;
|
|
6749
6602
|
border: 1px solid var(--gray-300);
|
|
6750
6603
|
border-radius: var(--rounded-base);
|
|
@@ -6760,7 +6613,7 @@ var ObjectSearchResultItemContainer = css35`
|
|
|
6760
6613
|
}
|
|
6761
6614
|
}
|
|
6762
6615
|
`;
|
|
6763
|
-
var ObjectSearchDragHandle =
|
|
6616
|
+
var ObjectSearchDragHandle = css34`
|
|
6764
6617
|
border-left: 2px dotted var(--gray-300);
|
|
6765
6618
|
border-right: 2px dotted var(--gray-300);
|
|
6766
6619
|
position: absolute;
|
|
@@ -6769,41 +6622,41 @@ var ObjectSearchDragHandle = css35`
|
|
|
6769
6622
|
transition: opacity var(--duration-fast) var(--timing-ease-out);
|
|
6770
6623
|
opacity: 0;
|
|
6771
6624
|
`;
|
|
6772
|
-
var ObjectSearchResultItemSubtitle =
|
|
6625
|
+
var ObjectSearchResultItemSubtitle = css34`
|
|
6773
6626
|
color: var(--gray-500);
|
|
6774
6627
|
display: block;
|
|
6775
6628
|
font-size: var(--fs-xs);
|
|
6776
6629
|
line-height: 1;
|
|
6777
6630
|
`;
|
|
6778
|
-
var ObjectSearchResultItemTitle =
|
|
6631
|
+
var ObjectSearchResultItemTitle = css34`
|
|
6779
6632
|
align-items: center;
|
|
6780
6633
|
color: var(--typography-base);
|
|
6781
6634
|
display: flex;
|
|
6782
6635
|
gap: var(--spacing-xs);
|
|
6783
6636
|
`;
|
|
6784
|
-
var ObjectSearchResultItemTimeStamp =
|
|
6637
|
+
var ObjectSearchResultItemTimeStamp = css34`
|
|
6785
6638
|
color: var(--gray-500);
|
|
6786
6639
|
font-size: var(--fs-xs);
|
|
6787
6640
|
`;
|
|
6788
|
-
var ObjectSearchAuthorStateGroup =
|
|
6641
|
+
var ObjectSearchAuthorStateGroup = css34`
|
|
6789
6642
|
align-items: center;
|
|
6790
6643
|
display: flex;
|
|
6791
6644
|
gap: var(--spacing-sm);
|
|
6792
6645
|
`;
|
|
6793
|
-
var ObjectSearchUpdateGroup =
|
|
6646
|
+
var ObjectSearchUpdateGroup = css34`
|
|
6794
6647
|
display: grid;
|
|
6795
6648
|
`;
|
|
6796
|
-
var ObjectSearchContentContainer =
|
|
6649
|
+
var ObjectSearchContentContainer = css34`
|
|
6797
6650
|
display: flex;
|
|
6798
6651
|
gap: var(--spacing-base);
|
|
6799
6652
|
`;
|
|
6800
|
-
var ObjectSearchImage =
|
|
6653
|
+
var ObjectSearchImage = css34`
|
|
6801
6654
|
width: 56px;
|
|
6802
6655
|
object-fit: contain;
|
|
6803
6656
|
`;
|
|
6804
6657
|
|
|
6805
6658
|
// src/components/ObjectSearch/ObjectSearchResultItem.tsx
|
|
6806
|
-
import { jsx as
|
|
6659
|
+
import { jsx as jsx62, jsxs as jsxs36 } from "@emotion/react/jsx-runtime";
|
|
6807
6660
|
var ObjectSearchResultItem = ({
|
|
6808
6661
|
id,
|
|
6809
6662
|
title,
|
|
@@ -6827,70 +6680,66 @@ var ObjectSearchResultItem = ({
|
|
|
6827
6680
|
onSelectItem({ id, title: id });
|
|
6828
6681
|
onRemove == null ? void 0 : onRemove();
|
|
6829
6682
|
};
|
|
6830
|
-
return /* @__PURE__ */
|
|
6831
|
-
disableDnD ? null : /* @__PURE__ */
|
|
6832
|
-
/* @__PURE__ */
|
|
6833
|
-
!imageUrl ? null : /* @__PURE__ */
|
|
6834
|
-
/* @__PURE__ */
|
|
6835
|
-
/* @__PURE__ */
|
|
6836
|
-
/* @__PURE__ */
|
|
6683
|
+
return /* @__PURE__ */ jsxs36("div", { css: ObjectSearchResultItemContainer, "data-testid": "search-result-item", children: [
|
|
6684
|
+
disableDnD ? null : /* @__PURE__ */ jsx62("div", { role: "presentation", className: "drag-handle", css: ObjectSearchDragHandle }),
|
|
6685
|
+
/* @__PURE__ */ jsx62("div", { children: /* @__PURE__ */ jsxs36("div", { css: ObjectSearchContentContainer, children: [
|
|
6686
|
+
!imageUrl ? null : /* @__PURE__ */ jsx62("img", { src: imageUrl, alt: `Thumbnail for ${title}`, css: ObjectSearchImage }),
|
|
6687
|
+
/* @__PURE__ */ jsxs36("div", { children: [
|
|
6688
|
+
/* @__PURE__ */ jsx62("span", { css: ObjectSearchResultItemSubtitle, "data-testid": "sub-title", children: formatedContentType }),
|
|
6689
|
+
/* @__PURE__ */ jsxs36("span", { role: "heading", css: ObjectSearchResultItemTitle, "data-testid": "title", children: [
|
|
6837
6690
|
title != null ? title : name,
|
|
6838
|
-
!popoverData ? null : /* @__PURE__ */
|
|
6691
|
+
!popoverData ? null : /* @__PURE__ */ jsx62(Popover2, { baseId: title, ariaLabel: title, buttonText: `See ${title} details`, children: popoverData })
|
|
6839
6692
|
] }),
|
|
6840
|
-
!createdAt && !publishStatus ? null : /* @__PURE__ */
|
|
6841
|
-
!(publishStatus == null ? void 0 : publishStatus.text) ? null : /* @__PURE__ */
|
|
6842
|
-
!createdAt && !publishedAt ? null : /* @__PURE__ */
|
|
6843
|
-
!createdAt ? null : /* @__PURE__ */
|
|
6844
|
-
/* @__PURE__ */
|
|
6693
|
+
!createdAt && !publishStatus ? null : /* @__PURE__ */ jsxs36("div", { css: ObjectSearchAuthorStateGroup, children: [
|
|
6694
|
+
!(publishStatus == null ? void 0 : publishStatus.text) ? null : /* @__PURE__ */ jsx62(Badge, { ...publishStatus, size: "sm", uppercaseText: true }),
|
|
6695
|
+
!createdAt && !publishedAt ? null : /* @__PURE__ */ jsxs36("div", { css: ObjectSearchUpdateGroup, children: [
|
|
6696
|
+
!createdAt ? null : /* @__PURE__ */ jsxs36("small", { css: ObjectSearchResultItemTimeStamp, children: [
|
|
6697
|
+
/* @__PURE__ */ jsx62("strong", { children: "Last updated: " }),
|
|
6845
6698
|
timeagoFormat(createdAt)
|
|
6846
6699
|
] }),
|
|
6847
|
-
!publishedAt ? null : /* @__PURE__ */
|
|
6848
|
-
/* @__PURE__ */
|
|
6700
|
+
!publishedAt ? null : /* @__PURE__ */ jsxs36("small", { css: ObjectSearchResultItemTimeStamp, children: [
|
|
6701
|
+
/* @__PURE__ */ jsx62("strong", { children: "Last published: " }),
|
|
6849
6702
|
timeagoFormat(publishedAt)
|
|
6850
6703
|
] })
|
|
6851
6704
|
] })
|
|
6852
6705
|
] }),
|
|
6853
|
-
/* @__PURE__ */
|
|
6706
|
+
/* @__PURE__ */ jsx62("div", { children })
|
|
6854
6707
|
] })
|
|
6855
6708
|
] }) }),
|
|
6856
|
-
!editLink && hideRemoveButton ? null : /* @__PURE__ */
|
|
6857
|
-
!editLink ? null : /* @__PURE__ */
|
|
6858
|
-
hideRemoveButton ? null : /* @__PURE__ */
|
|
6709
|
+
!editLink && hideRemoveButton ? null : /* @__PURE__ */ jsxs36("div", { css: ObjectSearchAuthorStateGroup, children: [
|
|
6710
|
+
!editLink ? null : /* @__PURE__ */ jsx62(LinkButton, { text: "Edit", href: editLink, icon: editLinkIcon }),
|
|
6711
|
+
hideRemoveButton ? null : /* @__PURE__ */ jsx62(Button4, { buttonType: "ghostDestructive", onClick: onRemoveItem, children: "Remove" })
|
|
6859
6712
|
] })
|
|
6860
6713
|
] });
|
|
6861
6714
|
};
|
|
6862
6715
|
|
|
6863
|
-
// src/components/ObjectSearch/ObjectSearchResultList.tsx
|
|
6864
|
-
import { Button as Button5, Counter } from "@uniformdev/design-system";
|
|
6865
|
-
import { Draggable as Draggable3, Droppable as Droppable3 } from "react-beautiful-dnd";
|
|
6866
|
-
|
|
6867
6716
|
// src/components/ObjectSearch/styles/ObjectSearchResultList.styles.ts
|
|
6868
|
-
import { css as
|
|
6869
|
-
var ObjectSearchResultListContainer =
|
|
6717
|
+
import { css as css35 } from "@emotion/react";
|
|
6718
|
+
var ObjectSearchResultListContainer = css35`
|
|
6870
6719
|
align-items: center;
|
|
6871
6720
|
display: flex;
|
|
6872
6721
|
gap: var(--spacing-sm);
|
|
6873
6722
|
justify-content: space-between;
|
|
6874
6723
|
`;
|
|
6875
|
-
var ObjectSearchDragContainer =
|
|
6724
|
+
var ObjectSearchDragContainer = css35`
|
|
6876
6725
|
margin: 0 0 var(--spacing-sm);
|
|
6877
6726
|
`;
|
|
6878
|
-
var ObjectSearchContainerDragging =
|
|
6727
|
+
var ObjectSearchContainerDragging = css35`
|
|
6879
6728
|
box-shadow: var(--shadow-base);
|
|
6880
6729
|
opacity: var(--opacity-50);
|
|
6881
6730
|
`;
|
|
6882
|
-
var ObjectSearchResultListCounterContainer =
|
|
6731
|
+
var ObjectSearchResultListCounterContainer = css35`
|
|
6883
6732
|
align-items: center;
|
|
6884
6733
|
display: flex;
|
|
6885
6734
|
gap: var(--spacing-sm);
|
|
6886
6735
|
`;
|
|
6887
|
-
var ObjectSearchResultListTitle =
|
|
6736
|
+
var ObjectSearchResultListTitle = css35`
|
|
6888
6737
|
font-weight: var(--fw-bold);
|
|
6889
6738
|
line-height: 1;
|
|
6890
6739
|
`;
|
|
6891
6740
|
|
|
6892
6741
|
// src/components/ObjectSearch/ObjectSearchResultList.tsx
|
|
6893
|
-
import { Fragment as Fragment13, jsx as
|
|
6742
|
+
import { Fragment as Fragment13, jsx as jsx63, jsxs as jsxs37 } from "@emotion/react/jsx-runtime";
|
|
6894
6743
|
function ObjectSearchResultList({
|
|
6895
6744
|
resultLabelText = "Selected",
|
|
6896
6745
|
removeButtonText = "Remove all",
|
|
@@ -6898,7 +6747,7 @@ function ObjectSearchResultList({
|
|
|
6898
6747
|
hideRemoveButton = false,
|
|
6899
6748
|
resultLabelOverride,
|
|
6900
6749
|
additionalButtons,
|
|
6901
|
-
renderResultComponent = (value) => /* @__PURE__ */
|
|
6750
|
+
renderResultComponent = (value) => /* @__PURE__ */ jsx63(ObjectSearchResultItem, { ...value }),
|
|
6902
6751
|
multiSelectId,
|
|
6903
6752
|
disableDnD = false,
|
|
6904
6753
|
getContainerForDnDReparenting,
|
|
@@ -6925,7 +6774,7 @@ function ObjectSearchResultList({
|
|
|
6925
6774
|
...item,
|
|
6926
6775
|
disableDnD: selectedListItems.length === 1 || disableDnD
|
|
6927
6776
|
});
|
|
6928
|
-
return /* @__PURE__ */
|
|
6777
|
+
return /* @__PURE__ */ jsx63(
|
|
6929
6778
|
"div",
|
|
6930
6779
|
{
|
|
6931
6780
|
css: [
|
|
@@ -6940,16 +6789,16 @@ function ObjectSearchResultList({
|
|
|
6940
6789
|
}
|
|
6941
6790
|
);
|
|
6942
6791
|
};
|
|
6943
|
-
return /* @__PURE__ */
|
|
6944
|
-
/* @__PURE__ */
|
|
6945
|
-
!resultLabelOverride ? /* @__PURE__ */
|
|
6946
|
-
/* @__PURE__ */
|
|
6792
|
+
return /* @__PURE__ */ jsxs37(Fragment13, { children: [
|
|
6793
|
+
/* @__PURE__ */ jsxs37("div", { role: "group", css: ObjectSearchResultListContainer, children: [
|
|
6794
|
+
!resultLabelOverride ? /* @__PURE__ */ jsxs37("div", { role: "note", css: ObjectSearchResultListCounterContainer, children: [
|
|
6795
|
+
/* @__PURE__ */ jsx63("span", { css: ObjectSearchResultListTitle, children: resultLabelText }),
|
|
6947
6796
|
" ",
|
|
6948
|
-
!selectedListItems.length ? null : /* @__PURE__ */
|
|
6797
|
+
!selectedListItems.length ? null : /* @__PURE__ */ jsx63(Counter, { count: selectedListItems.length })
|
|
6949
6798
|
] }) : resultLabelOverride,
|
|
6950
|
-
/* @__PURE__ */
|
|
6799
|
+
/* @__PURE__ */ jsxs37("div", { css: ObjectSearchResultListCounterContainer, children: [
|
|
6951
6800
|
additionalButtons,
|
|
6952
|
-
hideRemoveButton ? null : /* @__PURE__ */
|
|
6801
|
+
hideRemoveButton ? null : /* @__PURE__ */ jsx63(
|
|
6953
6802
|
Button5,
|
|
6954
6803
|
{
|
|
6955
6804
|
buttonType: "ghostDestructive",
|
|
@@ -6961,15 +6810,15 @@ function ObjectSearchResultList({
|
|
|
6961
6810
|
)
|
|
6962
6811
|
] })
|
|
6963
6812
|
] }),
|
|
6964
|
-
!selectedListItems.length ? whenNothingSelected : /* @__PURE__ */
|
|
6813
|
+
!selectedListItems.length ? whenNothingSelected : /* @__PURE__ */ jsx63(DragDropContext, { onDragEnd: (res) => onDragEnd(res), children: /* @__PURE__ */ jsx63(
|
|
6965
6814
|
Droppable3,
|
|
6966
6815
|
{
|
|
6967
6816
|
droppableId: multiSelectId != null ? multiSelectId : "canvas-multi-select",
|
|
6968
6817
|
renderClone: getContainerForDnDReparenting ? getDraggableItem : void 0,
|
|
6969
6818
|
getContainerForClone: getContainerForDnDReparenting,
|
|
6970
|
-
children: (provided) => /* @__PURE__ */
|
|
6819
|
+
children: (provided) => /* @__PURE__ */ jsxs37("div", { ...provided.droppableProps, ref: provided.innerRef, children: [
|
|
6971
6820
|
selectedListItems.map((item, i) => {
|
|
6972
|
-
return /* @__PURE__ */
|
|
6821
|
+
return /* @__PURE__ */ jsx63(
|
|
6973
6822
|
Draggable3,
|
|
6974
6823
|
{
|
|
6975
6824
|
draggableId: item.id,
|
|
@@ -6987,9 +6836,273 @@ function ObjectSearchResultList({
|
|
|
6987
6836
|
] });
|
|
6988
6837
|
}
|
|
6989
6838
|
|
|
6839
|
+
// src/components/ObjectSearch/ObjectSearchContainer.tsx
|
|
6840
|
+
import { Fragment as Fragment14, jsx as jsx64, jsxs as jsxs38 } from "@emotion/react/jsx-runtime";
|
|
6841
|
+
var ObjectSearchContainer = ({
|
|
6842
|
+
label,
|
|
6843
|
+
enableDynamicInputToResultId,
|
|
6844
|
+
searchFilters,
|
|
6845
|
+
resultList,
|
|
6846
|
+
children = /* @__PURE__ */ jsx64(ObjectSearchResultList, {})
|
|
6847
|
+
}) => {
|
|
6848
|
+
var _a, _b;
|
|
6849
|
+
const { onSelectItem, selectedListItems, list, dynamicEntryId, onSetQuery, query } = useObjectSearchContext();
|
|
6850
|
+
const { flatVariables } = useVariables(true);
|
|
6851
|
+
const inputValue = (_b = dynamicEntryId != null ? dynamicEntryId : (_a = selectedListItems[0]) == null ? void 0 : _a.id) != null ? _b : "";
|
|
6852
|
+
const isDynamicEntryIdAvailable = React12.useMemo(
|
|
6853
|
+
() => Boolean(inputValue && hasReferencedVariables(inputValue)),
|
|
6854
|
+
[inputValue]
|
|
6855
|
+
);
|
|
6856
|
+
const listItems = resultList != null ? resultList : /* @__PURE__ */ jsx64(
|
|
6857
|
+
ScrollableList,
|
|
6858
|
+
{
|
|
6859
|
+
role: "list",
|
|
6860
|
+
css: css36`
|
|
6861
|
+
> div {
|
|
6862
|
+
transition: max-height var(--duration-slow) var(--timing-ease-out);
|
|
6863
|
+
max-height: ${selectedListItems.length === 0 ? "50vh" : "184px"};
|
|
6864
|
+
}
|
|
6865
|
+
`,
|
|
6866
|
+
children: /* @__PURE__ */ jsx64(DefaultResultList, {})
|
|
6867
|
+
}
|
|
6868
|
+
);
|
|
6869
|
+
const handleSelectedVariableChange = (selectedValue) => {
|
|
6870
|
+
var _a2;
|
|
6871
|
+
if (!selectedValue) {
|
|
6872
|
+
onSelectItem([]);
|
|
6873
|
+
return;
|
|
6874
|
+
}
|
|
6875
|
+
const { result, errors } = bindVariables({
|
|
6876
|
+
value: selectedValue,
|
|
6877
|
+
variables: flatVariables,
|
|
6878
|
+
errorPrefix: "Dynamic input"
|
|
6879
|
+
});
|
|
6880
|
+
if (!result) {
|
|
6881
|
+
onSelectItem([]);
|
|
6882
|
+
return;
|
|
6883
|
+
}
|
|
6884
|
+
const item = (_a2 = list.items) == null ? void 0 : _a2.find((i) => i.id === result);
|
|
6885
|
+
onSelectItem([
|
|
6886
|
+
{
|
|
6887
|
+
title: selectedValue,
|
|
6888
|
+
contentType: (errors == null ? void 0 : errors.length) ? errors[0] instanceof Error ? errors[0].message : errors[0] : `Current dynamic value "${result}" is not an ID in the options`,
|
|
6889
|
+
// spread any matched list item, overriding the above default props
|
|
6890
|
+
...item,
|
|
6891
|
+
// we want to make sure the ID is our dynamic value
|
|
6892
|
+
id: selectedValue
|
|
6893
|
+
}
|
|
6894
|
+
]);
|
|
6895
|
+
if (hasReferencedVariables(selectedValue)) {
|
|
6896
|
+
onSetQuery({ ...query, dynamicEntryId: selectedValue });
|
|
6897
|
+
}
|
|
6898
|
+
};
|
|
6899
|
+
const showSearchList = !label || !isDynamicEntryIdAvailable || !enableDynamicInputToResultId;
|
|
6900
|
+
return /* @__PURE__ */ jsx64(IconsProvider, { children: /* @__PURE__ */ jsxs38(VerticalRhythm2, { children: [
|
|
6901
|
+
/* @__PURE__ */ jsx64(Container, { backgroundColor: "gray-50", padding: "var(--spacing-base)", border: true, children: /* @__PURE__ */ jsxs38(VerticalRhythm2, { children: [
|
|
6902
|
+
label ? /* @__PURE__ */ jsx64(
|
|
6903
|
+
InputVariables,
|
|
6904
|
+
{
|
|
6905
|
+
id: "entryId",
|
|
6906
|
+
label,
|
|
6907
|
+
value: inputValue,
|
|
6908
|
+
onChange: (value) => {
|
|
6909
|
+
if (value === inputValue) {
|
|
6910
|
+
return;
|
|
6911
|
+
}
|
|
6912
|
+
handleSelectedVariableChange(value);
|
|
6913
|
+
},
|
|
6914
|
+
inputWhenNoVariables: /* @__PURE__ */ jsx64(Fragment14, { children: searchFilters }),
|
|
6915
|
+
disableVariables: !enableDynamicInputToResultId
|
|
6916
|
+
}
|
|
6917
|
+
) : searchFilters,
|
|
6918
|
+
showSearchList ? listItems : null
|
|
6919
|
+
] }) }),
|
|
6920
|
+
children
|
|
6921
|
+
] }) });
|
|
6922
|
+
};
|
|
6923
|
+
var DefaultResultList = () => {
|
|
6924
|
+
var _a, _b;
|
|
6925
|
+
const { list, isListLoading } = useObjectSearchContext();
|
|
6926
|
+
if (isListLoading || !list.items) {
|
|
6927
|
+
return Array.from(Array(5).keys()).map((i) => /* @__PURE__ */ jsx64(ObjectSearchListItemLoadingSkeleton, {}, i));
|
|
6928
|
+
}
|
|
6929
|
+
if (((_a = list.items) == null ? void 0 : _a.length) === 0) {
|
|
6930
|
+
return /* @__PURE__ */ jsx64(Callout5, { type: "info", children: "No results were found" });
|
|
6931
|
+
}
|
|
6932
|
+
return (_b = list.items) == null ? void 0 : _b.map((item) => /* @__PURE__ */ jsx64(ObjectSearchListItem, { ...item }, item.id));
|
|
6933
|
+
};
|
|
6934
|
+
|
|
6935
|
+
// src/components/ObjectSearch/ObjectSearchFilter.tsx
|
|
6936
|
+
import { DebouncedInputKeywordSearch, InputSelect as InputSelect6, VerticalRhythm as VerticalRhythm3 } from "@uniformdev/design-system";
|
|
6937
|
+
import { useMemo as useMemo15, useState as useState17 } from "react";
|
|
6938
|
+
import { useDebounce as useDebounce4 } from "react-use";
|
|
6939
|
+
|
|
6940
|
+
// src/utils/createLocationValidator.ts
|
|
6941
|
+
function createLocationValidator(setValue, validate) {
|
|
6942
|
+
return (dispatch) => setValue((previous) => {
|
|
6943
|
+
const { newValue, options } = dispatch(previous);
|
|
6944
|
+
return { newValue, options: validate(newValue, options) };
|
|
6945
|
+
});
|
|
6946
|
+
}
|
|
6947
|
+
|
|
6948
|
+
// src/utils/useContentDataResourceLocaleInfo.ts
|
|
6949
|
+
import { bindVariables as bindVariables2, createVariableReference as createVariableReference4, LOCALE_DYNAMIC_INPUT_NAME as LOCALE_DYNAMIC_INPUT_NAME2 } from "@uniformdev/canvas";
|
|
6950
|
+
import { useEffect as useEffect16, useRef as useRef15 } from "react";
|
|
6951
|
+
function useContentDataResourceLocaleInfo({
|
|
6952
|
+
locale,
|
|
6953
|
+
setLocale,
|
|
6954
|
+
dynamicInputs
|
|
6955
|
+
}) {
|
|
6956
|
+
var _a;
|
|
6957
|
+
const setLocaleRef = useRef15(setLocale);
|
|
6958
|
+
setLocaleRef.current = setLocale;
|
|
6959
|
+
const { flatVariables } = useVariables();
|
|
6960
|
+
const effectiveLocale = locale != null ? locale : dynamicInputs[LOCALE_DYNAMIC_INPUT_NAME2] ? createVariableReference4(LOCALE_DYNAMIC_INPUT_NAME2) : "";
|
|
6961
|
+
const boundLocale = (_a = bindVariables2({ variables: flatVariables, value: effectiveLocale }).result) != null ? _a : effectiveLocale;
|
|
6962
|
+
useEffect16(() => {
|
|
6963
|
+
if (locale === void 0 && effectiveLocale && setLocaleRef.current) {
|
|
6964
|
+
setLocaleRef.current(createVariableReference4(LOCALE_DYNAMIC_INPUT_NAME2));
|
|
6965
|
+
}
|
|
6966
|
+
}, [locale, effectiveLocale]);
|
|
6967
|
+
return { effectiveLocale, boundLocale: boundLocale ? boundLocale : void 0 };
|
|
6968
|
+
}
|
|
6969
|
+
|
|
6970
|
+
// src/components/ObjectSearch/styles/ObjectSearchFilterContainer.styles.ts
|
|
6971
|
+
import { css as css37 } from "@emotion/react";
|
|
6972
|
+
var ObjectSearchFilterContainerLabel = css37`
|
|
6973
|
+
align-items: center;
|
|
6974
|
+
display: flex;
|
|
6975
|
+
font-size: var(--fs-sm);
|
|
6976
|
+
font-weight: var(--fw-bold);
|
|
6977
|
+
line-height: 1rem;
|
|
6978
|
+
margin-bottom: var(--spacing-sm);
|
|
6979
|
+
`;
|
|
6980
|
+
var ObjectSearchFilterContainer = css37`
|
|
6981
|
+
display: grid;
|
|
6982
|
+
gap: var(--spacing-base);
|
|
6983
|
+
`;
|
|
6984
|
+
var ObjectSearchFilterGrid = (gridColumns) => css37`
|
|
6985
|
+
display: grid;
|
|
6986
|
+
grid-template-columns: ${gridColumns};
|
|
6987
|
+
gap: var(--spacing-base);
|
|
6988
|
+
`;
|
|
6989
|
+
|
|
6990
|
+
// src/components/ObjectSearch/ObjectSearchFilter.tsx
|
|
6991
|
+
import { jsx as jsx65, jsxs as jsxs39 } from "@emotion/react/jsx-runtime";
|
|
6992
|
+
var ObjectSearchFilter = ({
|
|
6993
|
+
requireContentType,
|
|
6994
|
+
typeSelectorAllTypesOptionText = "All content types",
|
|
6995
|
+
searchInputName = "searchText",
|
|
6996
|
+
searchInputPlaceholderText = "Enter keyword to narrow your results",
|
|
6997
|
+
selectLabel = "Content Type Select",
|
|
6998
|
+
localeFilterLabel = "Filter by locale",
|
|
6999
|
+
selectOptions
|
|
7000
|
+
}) => {
|
|
7001
|
+
var _a, _b, _c;
|
|
7002
|
+
const { query, onSetQuery, localeOptions, enableFilterByLocale } = useObjectSearchContext();
|
|
7003
|
+
const dynamicInputs = useDataResourceDynamicInputs();
|
|
7004
|
+
const { boundLocale = "", effectiveLocale } = useContentDataResourceLocaleInfo({
|
|
7005
|
+
locale: query.locale,
|
|
7006
|
+
dynamicInputs: dynamicInputs != null ? dynamicInputs : {},
|
|
7007
|
+
setLocale: (newLocale) => handleFilterChange({ locale: newLocale != null ? newLocale : "" })
|
|
7008
|
+
});
|
|
7009
|
+
const [searchState, setSearchState] = useState17({
|
|
7010
|
+
keyword: (_a = query.keyword) != null ? _a : "",
|
|
7011
|
+
contentType: (_b = query.contentType) != null ? _b : "",
|
|
7012
|
+
locale: (_c = query.locale) != null ? _c : ""
|
|
7013
|
+
});
|
|
7014
|
+
const handleFilterChange = (value) => {
|
|
7015
|
+
setSearchState((prev) => {
|
|
7016
|
+
return { ...prev, ...value };
|
|
7017
|
+
});
|
|
7018
|
+
};
|
|
7019
|
+
useDebounce4(
|
|
7020
|
+
() => {
|
|
7021
|
+
onSetQuery({ ...query, ...searchState });
|
|
7022
|
+
},
|
|
7023
|
+
500,
|
|
7024
|
+
[searchState]
|
|
7025
|
+
);
|
|
7026
|
+
const memoizedSelectOptions = useMemo15(() => {
|
|
7027
|
+
if (!requireContentType && !(selectOptions == null ? void 0 : selectOptions.length)) {
|
|
7028
|
+
return [];
|
|
7029
|
+
}
|
|
7030
|
+
return [
|
|
7031
|
+
...!requireContentType ? [{ value: "any", label: typeSelectorAllTypesOptionText }] : [],
|
|
7032
|
+
...selectOptions != null ? selectOptions : []
|
|
7033
|
+
];
|
|
7034
|
+
}, [requireContentType, typeSelectorAllTypesOptionText, selectOptions]);
|
|
7035
|
+
const shouldRenderSelect = memoizedSelectOptions.length > 0;
|
|
7036
|
+
return /* @__PURE__ */ jsxs39(VerticalRhythm3, { gap: "base", children: [
|
|
7037
|
+
/* @__PURE__ */ jsxs39(
|
|
7038
|
+
"fieldset",
|
|
7039
|
+
{
|
|
7040
|
+
css: [
|
|
7041
|
+
ObjectSearchFilterContainer,
|
|
7042
|
+
ObjectSearchFilterGrid(shouldRenderSelect ? "1fr 2fr" : "1fr")
|
|
7043
|
+
],
|
|
7044
|
+
children: [
|
|
7045
|
+
memoizedSelectOptions.length ? /* @__PURE__ */ jsx65(
|
|
7046
|
+
InputSelect6,
|
|
7047
|
+
{
|
|
7048
|
+
label: selectLabel,
|
|
7049
|
+
showLabel: false,
|
|
7050
|
+
onChange: (e) => handleFilterChange({ contentType: e.target.value }),
|
|
7051
|
+
options: memoizedSelectOptions,
|
|
7052
|
+
value: query.contentType,
|
|
7053
|
+
"data-testid": "select-entry"
|
|
7054
|
+
}
|
|
7055
|
+
) : null,
|
|
7056
|
+
/* @__PURE__ */ jsx65(
|
|
7057
|
+
DebouncedInputKeywordSearch,
|
|
7058
|
+
{
|
|
7059
|
+
inputFieldName: searchInputName,
|
|
7060
|
+
placeholder: searchInputPlaceholderText,
|
|
7061
|
+
onSearchTextChanged: (keyword) => handleFilterChange({ keyword }),
|
|
7062
|
+
disabledFieldSubmission: true,
|
|
7063
|
+
defaultValue: searchState.keyword,
|
|
7064
|
+
delay: 300
|
|
7065
|
+
}
|
|
7066
|
+
)
|
|
7067
|
+
]
|
|
7068
|
+
}
|
|
7069
|
+
),
|
|
7070
|
+
enableFilterByLocale && (localeOptions == null ? void 0 : localeOptions.length) && /* @__PURE__ */ jsx65(
|
|
7071
|
+
InputVariables,
|
|
7072
|
+
{
|
|
7073
|
+
label: localeFilterLabel,
|
|
7074
|
+
id: "locale",
|
|
7075
|
+
value: effectiveLocale,
|
|
7076
|
+
onChange: (newLocale) => handleFilterChange({ locale: newLocale != null ? newLocale : "" }),
|
|
7077
|
+
disableInlineMenu: true,
|
|
7078
|
+
inputWhenNoVariables: /* @__PURE__ */ jsx65(
|
|
7079
|
+
InputSelect6,
|
|
7080
|
+
{
|
|
7081
|
+
id: "locale",
|
|
7082
|
+
options: localeOptions,
|
|
7083
|
+
name: "locale",
|
|
7084
|
+
label: "",
|
|
7085
|
+
value: boundLocale,
|
|
7086
|
+
onChange: (e) => handleFilterChange({ locale: e.target.value })
|
|
7087
|
+
}
|
|
7088
|
+
)
|
|
7089
|
+
}
|
|
7090
|
+
)
|
|
7091
|
+
] });
|
|
7092
|
+
};
|
|
7093
|
+
|
|
7094
|
+
// src/components/ObjectSearch/ObjectSearchFilterContainer.tsx
|
|
7095
|
+
import { jsx as jsx66, jsxs as jsxs40 } from "@emotion/react/jsx-runtime";
|
|
7096
|
+
var ObjectSearchFilterContainer2 = ({ label, children }) => {
|
|
7097
|
+
return /* @__PURE__ */ jsxs40("div", { children: [
|
|
7098
|
+
label ? /* @__PURE__ */ jsx66("span", { css: ObjectSearchFilterContainerLabel, children: label }) : null,
|
|
7099
|
+
/* @__PURE__ */ jsx66("div", { css: ObjectSearchFilterContainer, children })
|
|
7100
|
+
] });
|
|
7101
|
+
};
|
|
7102
|
+
|
|
6990
7103
|
// src/components/ObjectSearch/QueryFilter.tsx
|
|
6991
|
-
import { DebouncedInputKeywordSearch as DebouncedInputKeywordSearch2, Input as Input5, InputSelect as InputSelect7, VerticalRhythm as
|
|
6992
|
-
import { useEffect as
|
|
7104
|
+
import { DebouncedInputKeywordSearch as DebouncedInputKeywordSearch2, Input as Input5, InputSelect as InputSelect7, VerticalRhythm as VerticalRhythm4 } from "@uniformdev/design-system";
|
|
7105
|
+
import { useEffect as useEffect17, useState as useState18 } from "react";
|
|
6993
7106
|
import { jsx as jsx67, jsxs as jsxs41 } from "@emotion/react/jsx-runtime";
|
|
6994
7107
|
var QueryFilter = ({
|
|
6995
7108
|
requireContentType,
|
|
@@ -7030,12 +7143,12 @@ var QueryFilter = ({
|
|
|
7030
7143
|
setQueryState((prev) => ({ ...prev, ...value }));
|
|
7031
7144
|
onSetQuery({ ...query, ...value });
|
|
7032
7145
|
};
|
|
7033
|
-
|
|
7146
|
+
useEffect17(() => {
|
|
7034
7147
|
onSetQuery(queryState);
|
|
7035
7148
|
}, []);
|
|
7036
7149
|
return /* @__PURE__ */ jsxs41("fieldset", { children: [
|
|
7037
7150
|
/* @__PURE__ */ jsx67("span", { css: ObjectSearchFilterContainerLabel, children: queryFilterTitle }),
|
|
7038
|
-
/* @__PURE__ */ jsx67("div", { css: ObjectSearchFilterContainer, children: /* @__PURE__ */ jsxs41(
|
|
7151
|
+
/* @__PURE__ */ jsx67("div", { css: ObjectSearchFilterContainer, children: /* @__PURE__ */ jsxs41(VerticalRhythm4, { children: [
|
|
7039
7152
|
/* @__PURE__ */ jsx67(
|
|
7040
7153
|
InputVariables,
|
|
7041
7154
|
{
|
|
@@ -7155,9 +7268,108 @@ var QueryFilter = ({
|
|
|
7155
7268
|
] });
|
|
7156
7269
|
};
|
|
7157
7270
|
|
|
7158
|
-
// src/components/
|
|
7159
|
-
import {
|
|
7271
|
+
// src/components/ObjectSearch/ObjectSearchListOfSearchResults.tsx
|
|
7272
|
+
import { Callout as Callout6 } from "@uniformdev/design-system";
|
|
7160
7273
|
import { jsx as jsx68 } from "@emotion/react/jsx-runtime";
|
|
7274
|
+
function ObjectSearchListOfSearchResults() {
|
|
7275
|
+
var _a, _b;
|
|
7276
|
+
const { list, isListLoading } = useObjectSearchContext();
|
|
7277
|
+
if (isListLoading) {
|
|
7278
|
+
return Array.from(Array(5).keys()).map((i) => /* @__PURE__ */ jsx68(ObjectSearchListItemLoadingSkeleton, {}, i));
|
|
7279
|
+
}
|
|
7280
|
+
if (((_a = list.items) == null ? void 0 : _a.length) === 0) {
|
|
7281
|
+
return /* @__PURE__ */ jsx68(Callout6, { type: "info", children: "No results were found" });
|
|
7282
|
+
}
|
|
7283
|
+
return (_b = list.items) == null ? void 0 : _b.map((item) => /* @__PURE__ */ jsx68(ObjectSearchListItem, { ...item }, item.id));
|
|
7284
|
+
}
|
|
7285
|
+
|
|
7286
|
+
// src/components/ObjectSearch/hooks/ControlledObjectSearchProvider.tsx
|
|
7287
|
+
import { useCallback as useCallback6, useDeferredValue as useDeferredValue2, useMemo as useMemo16 } from "react";
|
|
7288
|
+
import { jsx as jsx69 } from "@emotion/react/jsx-runtime";
|
|
7289
|
+
var ControlledObjectSearchProvider = ({
|
|
7290
|
+
selectedItems,
|
|
7291
|
+
searchResultItems,
|
|
7292
|
+
selectedItemsLoading,
|
|
7293
|
+
searchResultListLoading,
|
|
7294
|
+
searchResultItemsLoading,
|
|
7295
|
+
onQueryChange,
|
|
7296
|
+
onSelectItemsChange,
|
|
7297
|
+
isMulti = false,
|
|
7298
|
+
children,
|
|
7299
|
+
query,
|
|
7300
|
+
enableFilterByLocale,
|
|
7301
|
+
localeOptions,
|
|
7302
|
+
dynamicEntryId
|
|
7303
|
+
}) => {
|
|
7304
|
+
const { flatVariables } = useVariables(true);
|
|
7305
|
+
const querySearchDeferred = useDeferredValue2(query);
|
|
7306
|
+
const onSetQuery = useCallback6(
|
|
7307
|
+
(value2) => {
|
|
7308
|
+
const newQuery = { ...query, ...value2 };
|
|
7309
|
+
onQueryChange(newQuery);
|
|
7310
|
+
},
|
|
7311
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7312
|
+
[onQueryChange]
|
|
7313
|
+
);
|
|
7314
|
+
const onSelectItem = useCallback6(
|
|
7315
|
+
(selectedResult) => {
|
|
7316
|
+
if (Array.isArray(selectedResult)) {
|
|
7317
|
+
onSelectItemsChange(selectedResult);
|
|
7318
|
+
} else {
|
|
7319
|
+
if (selectedItems == null ? void 0 : selectedItems.some((item) => item.id === selectedResult.id)) {
|
|
7320
|
+
onSelectItemsChange(selectedItems.filter((item) => item.id !== selectedResult.id));
|
|
7321
|
+
} else {
|
|
7322
|
+
onSelectItemsChange([...selectedItems != null ? selectedItems : [], selectedResult]);
|
|
7323
|
+
}
|
|
7324
|
+
}
|
|
7325
|
+
},
|
|
7326
|
+
[onSelectItemsChange, selectedItems]
|
|
7327
|
+
);
|
|
7328
|
+
const onRemoveAllSelectedItems = useCallback6(() => {
|
|
7329
|
+
onSelectItemsChange([]);
|
|
7330
|
+
}, [onSelectItemsChange]);
|
|
7331
|
+
const list = useMemo16(() => ({ items: searchResultItems }), [searchResultItems]);
|
|
7332
|
+
const boundQuery = useMemo16(() => bindQuery(query, flatVariables), [query, flatVariables]);
|
|
7333
|
+
const value = useMemo16(
|
|
7334
|
+
() => ({
|
|
7335
|
+
boundQuery,
|
|
7336
|
+
onSetQuery,
|
|
7337
|
+
query: querySearchDeferred,
|
|
7338
|
+
onSelectItem,
|
|
7339
|
+
selectedListItems: selectedItems != null ? selectedItems : [],
|
|
7340
|
+
onRemoveAllSelectedItems,
|
|
7341
|
+
list,
|
|
7342
|
+
selectedItemsLoading,
|
|
7343
|
+
searchResultItemsLoading,
|
|
7344
|
+
searchResultListLoading,
|
|
7345
|
+
isMulti,
|
|
7346
|
+
localeOptions,
|
|
7347
|
+
enableFilterByLocale,
|
|
7348
|
+
dynamicEntryId
|
|
7349
|
+
}),
|
|
7350
|
+
[
|
|
7351
|
+
boundQuery,
|
|
7352
|
+
onSetQuery,
|
|
7353
|
+
querySearchDeferred,
|
|
7354
|
+
onSelectItem,
|
|
7355
|
+
selectedItems,
|
|
7356
|
+
selectedItemsLoading,
|
|
7357
|
+
searchResultItemsLoading,
|
|
7358
|
+
onRemoveAllSelectedItems,
|
|
7359
|
+
searchResultListLoading,
|
|
7360
|
+
list,
|
|
7361
|
+
isMulti,
|
|
7362
|
+
localeOptions,
|
|
7363
|
+
enableFilterByLocale,
|
|
7364
|
+
dynamicEntryId
|
|
7365
|
+
]
|
|
7366
|
+
);
|
|
7367
|
+
return /* @__PURE__ */ jsx69(ObjectSearchContext.Provider, { value, children });
|
|
7368
|
+
};
|
|
7369
|
+
|
|
7370
|
+
// src/components/ParamTypeDynamicDataProvider.tsx
|
|
7371
|
+
import { useEffect as useEffect18, useMemo as useMemo17, useRef as useRef16 } from "react";
|
|
7372
|
+
import { jsx as jsx70 } from "@emotion/react/jsx-runtime";
|
|
7161
7373
|
function ParamTypeDynamicDataProvider(props) {
|
|
7162
7374
|
const { children } = props;
|
|
7163
7375
|
const {
|
|
@@ -7165,11 +7377,11 @@ function ParamTypeDynamicDataProvider(props) {
|
|
|
7165
7377
|
} = useMeshLocation("paramType");
|
|
7166
7378
|
const dynamicInputsAsVariables = useDynamicInputsAsVariables(dynamicInputs);
|
|
7167
7379
|
const connectedDataAsVariables = useConnectedDataAsVariables(connectedData);
|
|
7168
|
-
const variables =
|
|
7380
|
+
const variables = useMemo17(
|
|
7169
7381
|
() => ({ ...connectedDataAsVariables, ...dynamicInputsAsVariables }),
|
|
7170
7382
|
[dynamicInputsAsVariables, connectedDataAsVariables]
|
|
7171
7383
|
);
|
|
7172
|
-
return /* @__PURE__ */
|
|
7384
|
+
return /* @__PURE__ */ jsx70(VariablesProvider, { value: variables, onChange: () => {
|
|
7173
7385
|
}, editVariableComponent: JsonMeshVariableEditor, children });
|
|
7174
7386
|
}
|
|
7175
7387
|
var JsonMeshVariableEditor = ({
|
|
@@ -7178,9 +7390,9 @@ var JsonMeshVariableEditor = ({
|
|
|
7178
7390
|
variable,
|
|
7179
7391
|
context
|
|
7180
7392
|
}) => {
|
|
7181
|
-
const sillyRef =
|
|
7393
|
+
const sillyRef = useRef16(false);
|
|
7182
7394
|
const { editConnectedData } = useMeshLocation("paramType");
|
|
7183
|
-
|
|
7395
|
+
useEffect18(() => {
|
|
7184
7396
|
if (sillyRef.current) {
|
|
7185
7397
|
return;
|
|
7186
7398
|
}
|
|
@@ -7208,41 +7420,65 @@ var JsonMeshVariableEditor = ({
|
|
|
7208
7420
|
return null;
|
|
7209
7421
|
};
|
|
7210
7422
|
|
|
7211
|
-
// src/
|
|
7212
|
-
|
|
7213
|
-
|
|
7214
|
-
|
|
7215
|
-
|
|
7216
|
-
|
|
7423
|
+
// src/components/SearchAndFilter/filtersMapper.tsx
|
|
7424
|
+
import {
|
|
7425
|
+
filterMapper,
|
|
7426
|
+
FilterMultiChoiceEditor
|
|
7427
|
+
} from "@uniformdev/design-system";
|
|
7428
|
+
import { DateEditor, FilterSingleChoiceEditor, NumberEditor, TextEditor } from "@uniformdev/design-system";
|
|
7429
|
+
import { jsx as jsx71 } from "@emotion/react/jsx-runtime";
|
|
7430
|
+
function withInputVariables(WrappedComponent) {
|
|
7431
|
+
const WithInputVariables = (props) => {
|
|
7432
|
+
if (Array.isArray(props.value) || !props.bindable || props.disabled || props.readOnly) {
|
|
7433
|
+
return /* @__PURE__ */ jsx71(WrappedComponent, { ...props });
|
|
7434
|
+
}
|
|
7435
|
+
return /* @__PURE__ */ jsx71(
|
|
7436
|
+
InputVariables,
|
|
7437
|
+
{
|
|
7438
|
+
disableInlineMenu: true,
|
|
7439
|
+
showMenuPosition: "inline-right",
|
|
7440
|
+
onChange: (newValue) => props.onChange(newValue != null ? newValue : ""),
|
|
7441
|
+
value: props.value,
|
|
7442
|
+
disabled: props.disabled,
|
|
7443
|
+
inputWhenNoVariables: /* @__PURE__ */ jsx71(WrappedComponent, { ...props })
|
|
7444
|
+
}
|
|
7445
|
+
);
|
|
7446
|
+
};
|
|
7447
|
+
return WithInputVariables;
|
|
7217
7448
|
}
|
|
7218
|
-
|
|
7219
|
-
|
|
7220
|
-
|
|
7221
|
-
|
|
7222
|
-
|
|
7223
|
-
locale,
|
|
7224
|
-
setLocale,
|
|
7225
|
-
dynamicInputs
|
|
7226
|
-
}) {
|
|
7227
|
-
var _a;
|
|
7228
|
-
const setLocaleRef = useRef16(setLocale);
|
|
7229
|
-
setLocaleRef.current = setLocale;
|
|
7230
|
-
const { flatVariables } = useVariables();
|
|
7231
|
-
const effectiveLocale = locale != null ? locale : dynamicInputs[LOCALE_DYNAMIC_INPUT_NAME2] ? createVariableReference4(LOCALE_DYNAMIC_INPUT_NAME2) : "";
|
|
7232
|
-
const boundLocale = (_a = bindVariables2({ variables: flatVariables, value: effectiveLocale }).result) != null ? _a : effectiveLocale;
|
|
7233
|
-
useEffect18(() => {
|
|
7234
|
-
if (locale === void 0 && effectiveLocale && setLocaleRef.current) {
|
|
7235
|
-
setLocaleRef.current(createVariableReference4(LOCALE_DYNAMIC_INPUT_NAME2));
|
|
7449
|
+
function withInputVariablesForMultiValue(WrappedComponent) {
|
|
7450
|
+
const WithInputVariables = (props) => {
|
|
7451
|
+
var _a;
|
|
7452
|
+
if (!props.bindable || props.disabled || props.readOnly) {
|
|
7453
|
+
return /* @__PURE__ */ jsx71(WrappedComponent, { ...props });
|
|
7236
7454
|
}
|
|
7237
|
-
|
|
7238
|
-
|
|
7455
|
+
return /* @__PURE__ */ jsx71(
|
|
7456
|
+
InputVariables,
|
|
7457
|
+
{
|
|
7458
|
+
disableInlineMenu: true,
|
|
7459
|
+
showMenuPosition: "inline-right",
|
|
7460
|
+
onChange: (newValue) => props.onChange(newValue ? [newValue] : []),
|
|
7461
|
+
value: (_a = props.value) == null ? void 0 : _a[0],
|
|
7462
|
+
inputWhenNoVariables: /* @__PURE__ */ jsx71(WrappedComponent, { ...props })
|
|
7463
|
+
}
|
|
7464
|
+
);
|
|
7465
|
+
};
|
|
7466
|
+
return WithInputVariables;
|
|
7239
7467
|
}
|
|
7468
|
+
var bindableFiltersMapper = {
|
|
7469
|
+
...filterMapper,
|
|
7470
|
+
multiChoice: withInputVariablesForMultiValue(FilterMultiChoiceEditor),
|
|
7471
|
+
singleChoice: withInputVariables(FilterSingleChoiceEditor),
|
|
7472
|
+
date: withInputVariables(DateEditor),
|
|
7473
|
+
text: withInputVariables(TextEditor),
|
|
7474
|
+
number: withInputVariables(NumberEditor)
|
|
7475
|
+
};
|
|
7240
7476
|
|
|
7241
7477
|
// src/index.ts
|
|
7242
7478
|
import {
|
|
7243
7479
|
AddListButton as AddListButton2,
|
|
7244
7480
|
Button as Button6,
|
|
7245
|
-
Callout as
|
|
7481
|
+
Callout as Callout7,
|
|
7246
7482
|
DrawerContent,
|
|
7247
7483
|
Heading,
|
|
7248
7484
|
Input as Input6,
|
|
@@ -7281,12 +7517,14 @@ export {
|
|
|
7281
7517
|
$isVariableNode,
|
|
7282
7518
|
AddListButton2 as AddListButton,
|
|
7283
7519
|
Button6 as Button,
|
|
7284
|
-
|
|
7520
|
+
Callout7 as Callout,
|
|
7521
|
+
ControlledObjectSearchProvider,
|
|
7285
7522
|
ControlledValuePlugin,
|
|
7286
7523
|
DISCONNECT_VARIABLE_COMMAND,
|
|
7287
7524
|
DamSelectedItem,
|
|
7288
7525
|
DataRefreshButton,
|
|
7289
7526
|
DataResourceDynamicInputProvider,
|
|
7527
|
+
DataResourceInputContext,
|
|
7290
7528
|
DataResourceVariablesList,
|
|
7291
7529
|
DataResourceVariablesListExplicit,
|
|
7292
7530
|
DataSourceEditor,
|
|
@@ -7314,10 +7552,12 @@ export {
|
|
|
7314
7552
|
MeshApp,
|
|
7315
7553
|
OPEN_INSERT_VARIABLE_COMMAND,
|
|
7316
7554
|
ObjectSearchContainer,
|
|
7555
|
+
ObjectSearchContext,
|
|
7317
7556
|
ObjectSearchFilter,
|
|
7318
7557
|
ObjectSearchFilterContainer2 as ObjectSearchFilterContainer,
|
|
7319
7558
|
ObjectSearchListItem,
|
|
7320
7559
|
ObjectSearchListItemLoadingSkeleton,
|
|
7560
|
+
ObjectSearchListOfSearchResults,
|
|
7321
7561
|
ObjectSearchProvider,
|
|
7322
7562
|
ObjectSearchResultItem,
|
|
7323
7563
|
ObjectSearchResultItemButton,
|
|
@@ -7371,6 +7611,8 @@ export {
|
|
|
7371
7611
|
VariablesPlugin,
|
|
7372
7612
|
VariablesProvider,
|
|
7373
7613
|
badgeIcon,
|
|
7614
|
+
bindQuery,
|
|
7615
|
+
bindableFiltersMapper,
|
|
7374
7616
|
convertConnectedDataToVariable,
|
|
7375
7617
|
createLocationValidator,
|
|
7376
7618
|
damSelectItemImage,
|
|
@@ -7442,6 +7684,7 @@ export {
|
|
|
7442
7684
|
urlEncodeRequestUrl,
|
|
7443
7685
|
useConnectedDataAsVariables,
|
|
7444
7686
|
useContentDataResourceLocaleInfo,
|
|
7687
|
+
useDataResourceDynamicInputs,
|
|
7445
7688
|
useDynamicInputsAsVariables,
|
|
7446
7689
|
useMeshLocation,
|
|
7447
7690
|
useObjectSearchContext,
|